RMark: Constraining with "real" covariates

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

RMark: Constraining with "real" covariates

Postby Joana » Thu Aug 13, 2009 9:45 pm

Hello again,

I have 4 groups (ponds) and I'm trying to constrain survival and recapture on each pond with abiotic factors such as shading or aquatic vegetation and this is what I did:

>alytes.process=process.data(alytes,model="POPAN",time.intervals=c(1,3,0.86,0.57,2.14),groups="pond")
>alytes.ddl=make.design.data(alytes.process)
>df=data.frame(group=c(rep("31",310),rep("32",540),rep("30",140),rep("33",225)),time=rep(c(1:5),243),shading=c(rep("0.3",310),rep("0.07",540),rep("0",140),rep("0.2",225)))
>merge.design.covariates(alytes.ddl$Phi,df,bygroup=T)
Error in merge.design.covariates(alytes.ddl$Phi, df, bygroup = T) :
df does not contain a time value for each time in design data


"31","32","30","33" refer to the 4 ponds' "name"...I don't understand what I'm doing wrong and would very much appreciate if someone would help me...

Thanks,
Joana
Joana
 
Posts: 3
Joined: Wed Aug 05, 2009 5:40 am

Postby jlaake » Thu Aug 13, 2009 11:51 pm

Joana-

Based on the time.interval your times are 0,1,4,4.86 etc rather than 1 to 5.. Also you only need to provide one record in the dataframe per time per group and it will fill in all the design data. Since the covariate is for Phi the value for time is the time at the beginning of the time interval. So if begin.time=0, then you would use 0 for the first interval, 1 for the second interval, 4 for the third interval, etc. But it is the time values rather than a count of occasions.

Hope this helps. --jeff
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Postby Joana » Sat Aug 15, 2009 8:45 pm

Hi Jeff,

Thanks for your help.
I have another question: after defining the parameters with the corresponding variables, creating the model list and using mark.wrapper, the results don't include every possible model with the defined parameters...again, what am I missing?

Thanks and sorry for being a n00b... :wink:

Joana
Joana
 
Posts: 3
Joined: Wed Aug 05, 2009 5:40 am

Postby jlaake » Sun Aug 16, 2009 11:16 pm

It would have issued an error but you most likely didn't see it amongst the output summaries for the models that did run. Use run=FALSE with mark.wrapper and run the code and it will build each model but won't run them. Then you can see the error message. There is a list of error messages at the end of the Appendix material. if t is not in there or you can't figure it out let me know but I'll have to see the error to give you any suggestions as to what is wrong. --jeff
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Postby FroggyDew » Fri Aug 21, 2009 2:11 am

If some models are not run, it might be due to some variables being declared as factors in the formulas. It just happened to me today...
FroggyDew
 
Posts: 2
Joined: Sat Sep 01, 2007 6:53 pm
Location: Palmerston North - New Zealand

Postby jlaake » Fri Aug 21, 2009 9:56 am

That is a possibility but I think all of her covariates are in the design data. Factor variables are ok in the design data but not as individual covariates because for the latter the name of the covariate is put in the DM and MARK fills in the value to compute the parameters for each animal. For many factor varianbles this would not make sense because the factor levls would be treated as a numerical covariate. You can use factor variables as individual covarates if you create k-1 dummy (0/1) numeric variables for a k-level factor variable but typically it ibetter to use factor variables to define groups.

regards --jeff
jlaake
 
Posts: 1479
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Postby cooch » Fri Aug 21, 2009 10:08 am

jlaake wrote:You can use factor variables as individual covarates if you create k-1 dummy (0/1) numeric variables for a k-level factor variable but typically it ibetter to use factor variables to define groups.

regards --jeff


Actually, I think Jeff meant you can use individual covariates as factor variables (k-1 dummy variables for a k-level factor group). This is discussed in some detail in section 11.7 of chapter 11 in 'the book'.
cooch
 
Posts: 1652
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University


Return to RMark

Who is online

Users browsing this forum: No registered users and 2 guests

cron