I am using RMark and have a question. I hope you can help with this.
I’ve been reading MARK and RMark books. I found in chapter 6 how to analyze a temporal trend. However, it is still not completely clear how should I write my model because all my variables are continuous, so then year is an individual covariate, not a factor.
I want to analyze if there is a change over time on the seasonal variation of nest survival and also get DSR for each year using:
- year=1,2,3,4...
- relative laying date (RLD) where the median = 0
- nest age
I tried:
A) using the original value of year as a factor for grouping (yearf=1990,1991, etc.)
B) I also substituted RLD by ~Time
See here the code for A):
- Code: Select all
df.process <- process.data(nestDF,model="Nest", nocc=41, groups = "yearf")
df.ddl <- make.design.data(df.process)
full.model=list(formula=~1+RLD+year+I(year^2)+RLD:year +RLD:I(year^2+NestAge)
NS1=mark(df.process, df.ddl, model.parameters=list(S = full.model))
My design matrix doesn't show a matrix (because I have only continuous variables and the matrix is created using contrasts), and it only shows one group.
This is what I get when I try to call the matrix:
S:(Intercept) S:RLD S:year S:year2 S:NestAge S:RLD:year S:RLD:year2
S g1990 a0 t1 "1" "RLD" "year" "year2" "NestAge" "product(year,RLD)" "product(year2,RLD)"
I assume this is a major problem since there is no variation on the values for each occasion nor year.
See here the code for B):
- Code: Select all
full.model=list(formula=~1+Time+yr+I(yr^2)+Time:yr +Time:I(yr^2)+NestAge)
What is the best way to write the model or how can I analyze my data?
Thanks a lot in advance,