Page 1 of 1

individual covariates in secr 1.4.0

PostPosted: Thu Jun 10, 2010 2:07 pm
by bdt
Hi,

I’m running secr 1.4.0 in R 2.11.1 on Windows XP and I’m having trouble including individual covariates in the model argument for secr.fit. To eliminate the possibility of data entry errors, I also ran models using the “housemouse” data. As with my data set, models without individual covariates ran fine; however, the following did not:

>secr.fit(housemouse,model=list(D~1, g0~sex, sigma~1), detectfn=0)
Checking data
Preparing detection design matrices
Error in secr.design.MS(capthist, model, timecov, sessioncov, groups, :
Covariate(s) sex not found

I also tried alternative model statements such as g0~covariates(housemouse)$sex.

From examining the function “serc.design.MS”, it appears that the function “findvars.MS” is not finding the covariate “sex” in object “vars”. As with my data, str(capthist) indicates that the covariate was incorporated into the capture history object and because covariates(capthist) returns the proper covariate values, I’m assuming that the object zcov (in serc.design.MS) was properly assigned.

I searched for further details and examples but found no solution.

Any suggestions?

Thank you,
Brian

Re: individual covariates in secr 1.4.0

PostPosted: Thu Jun 10, 2010 5:52 pm
by murray.efford
Brian
I think this might be just a simple misunderstanding - individual covariates are available only when you use the conditional likelihood fitting option (CL = TRUE in secr.fit). Use derived() to obtain density (D) from the fitted model. This is analogous to fitting a Huggins model in conventional capture-recapture. You might also treat sex as a group (g) and use the groups argument to identify sex as the grouping covariate in a full-likelihood model.
Murray

Re: individual covariates in secr 1.4.0

PostPosted: Thu Jun 10, 2010 6:34 pm
by bdt
Murray,
Yes, I overlooked the conditional likelihood option. The models with individual covariates are working now. Thank you for identifying my oversight.
Brian