Hi,
I came across these posts, and I'm having a similar problem. I have a similar dataset as Jeff with 4 years of nest survival data that I am trying to model with occasion (time) specific covariates (as well as other nest covariates such as nest height). The time specific variables I'm dealing with are daily mean temperatures, precepitation, and vegetation leaf lengths, which should be grouped for nests (like in Jeff's example) by year. I recently downloaded the lastest version of RMark. Has the code been fixed to use groups (without using dummy variables - which seems to work) in the nest survival model?
I am getting a similar error as Jeff had (note I don't have 2011 data here):
- Code: Select all
> z$year<-as.factor(z$year)
> Year=mark(z,nocc=78,model="Nest", model.parameters=list(S=list(formula=~year)),
+ groups=c("year2008","year2009","year2010"))
Error in make.mark.model(data.proc, title = title, covariates = covariates, :
The following individual covariates are not allowed because they are factor variables: year
Also, after following your post, I was able to use merge_design.covariates to merge the weather data with the z.ddl$S (design data?), to group the precip and temperature covariates by year.
- Code: Select all
z$year<-as.factor(z$year)
> z.process<-process.data(z, model="Nest", nocc=78, groups="year")
> z.ddl<-make.design.data(z.process)
>
> zz<-merge_design.covariates(z.ddl$S,weather, bygroup=TRUE)
> tail(zz)
group time age Age Time year X precip maxtemp meantemp mintemp
226 2010 72 71 71 71 2010 25-Jul-10 0 88.2 76.33750 64.4
227 2010 73 72 72 72 2010 26-Jul-10 0 83.7 66.56667 47.8
228 2010 74 73 73 73 2010 27-Jul-10 0 91.6 69.48750 48.2
229 2010 75 74 74 74 2010 28-Jul-10 0 90.7 73.02083 50.9
230 2010 76 75 75 75 2010 29-Jul-10 0 88.9 77.24167 64.2
231 2010 77 76 76 76 2010 30-Jul-10 0 83.8 64.94583 47.1
>
Now I am confused about how to run the model with zz, as this is the weather data grouped by year, and time is matched up, however this does not contain the nest survival data. Is this possible using the mark() function, or do I need to use the other functions (i.e. make.mark.model() ). I am relatively new to Mark and RMark, although I have been able to follow the mallard example and run other models with my data that work with Time, nest age, and nest-specific covariates. I tried to follow the RMARK appendix dealing with this (starting p.73), and I also looked at the RMark workshop notes-- However, if I create a vector of precipitation covariates for every time (with a prefix), i.e. precip1, precip2, etc. to put into the model, I don't see how these covariates can then be grouped by year?
Please let me know if you have any suggestions about this. I really appreciate any help. Thanks!
Mike