I'm analycing some data with R.mark and I'll like to find a better solution for dealing with the age groups
My data originally was like this
- Code: Select all
ch Fem Mal Span
1000 0 1 0
1010 0 1 0
1000 0 1 1
1000 1 0 0
1000 0 1 2
1001 1 0 1
Where Fem and Mal are the sex of the individuals and Span is the initial age class of release for each individual
Span levels go from 0 to 3
I started analysing it as a group and a covariate
- Code: Select all
jsexspanc.convert=convert.inp("Jsexspanc.inp", group.df= data.frame(sex=c("Male", "Female")), covariates="Span", use.comments=TRUE)
But after checking my old notes on the markbook and some workshops I found online, I realised a better way to deal with the initial age, so I transformed the input file:
- Code: Select all
ch Fe0 Fe1 Fe2 Fe3 Ma0 Ma1 Ma2 Ma3
1000 0 0 0 0 1 0 0 0
1010 0 0 0 0 1 0 0 0
1000 0 0 0 0 0 1 0 0
1000 1 0 0 0 0 0 0 0
1000 0 0 0 0 0 0 1 0
1001 0 1 0 0 0 0 0 0
So now we have one group for each combination of sex and initial age.
Then I proceed the model design
- Code: Select all
jrestall8g.convert=convert.inp("jrestall8g.inp", group.df=data.frame(sex=c("Female", "Female", "Female", "Female", "Male", "Male", "Male", "Male"), span=c("Fresh", "Good", "Old", "Worn", "Fresh", "Good", "Old", "Worn")))
str(jrestall8g.convert)
jrestall8g.convert
(I named the four levels of span like this, so they conserve the same order when in alphabetical order)
Then
- Code: Select all
jrestall8g.proc=process.data(jrestall8g.convert, begin.time=110703, model="POPAN", groups=c("sex", "span"), age.var=2, initial.ages=c(0,1,2,3), time.intervals=c(3,3,2))
str(jrestall8g.proc)
jrestall8g.proc
jrestall8g.ddl=make.design.data(jrestall8g.proc)
I think I got exactly the initial dates and age that I was looking for, in the future I may use add.design.data to bin age in four intervals.
The problem is that I don't really want to analyse and get the estimates of all the parameters, separately for each of the 8 groups
I will like to set the initial ages for each individual and to include the covariate in the model (To test if a model with Phi(span) is better than one with Phi(time)) but get the estimates for all the individuals of each sex (2 groups), not for each combination of sex and "span" (8 groups).
Does this makes sense or I am too tired? Is it possible to treat "span" as a covariate, but somehow add it as a initial age?
Thank you for your time.