I've been trying to do this and have run into an error. In the next set of code, I ran the dot model with the same group structure (combined age and year, 14 groups) as my MARK file,
- Code: Select all
# convert
LYC=convert.inp("C:/Users/abreton.CNRDOM/Documents/CSU_Project/MARK_Analyses/LYC_2004_2008/EH_File_LYC_2004_10_Bins.inp",
group.df=data.frame(age.yr=c("SA04","A04","SA05","A05","SA06","A06","SA07","A07","SA08","A08","SA09","A09","SA10","A10"),
aclass=rep(c("SA","A"),7),
syear=c(rep("2004",2),rep("2005",2),rep("2006",2),rep("2007",2),rep("2008",2),rep("2009",2),rep("2010",2))),
covariates=c("L1","L2","L3","L4","L5","L6","L7","L8","L9","L10","L11","may1Bin","RMiBin"),use.comments=FALSE)
# process
LYC.huggins=process.data(LYC,model="Huggins",begin.time=1,mixtures=1,
time.intervals=c(1,1,1,1,1,1,1,1,1,1), groups=("age.yr"))
# make design data
LYC.ddl=make.design.data(LYC.huggins)
# specify parameters to fix
p.fix.indices=c(83:88,6:11,93:99,16:22,107:110,30:33,119:121,42:44,129:132,52:55,154,77)
c.fix.indices=c(229:234,159:164,238:244,168:174,251:254,181:184,262:264,192:194,271:274,201:204,275:277,205:207,285:286,
294,215:216,224)
p.fix.count=rep(0,length(p.fix.indices))
c.fix.count=rep(0,length(c.fix.indices))
# specify pim
p.dot.fix.shared=list(formula=~1,share=TRUE,fixed=list(index=c(p.fix.indices,c.fix.indices),value=c(p.fix.count,c.fix.count)))
# fit dot model
initial=-3.0337564
LYC.huggins.M0=mark(LYC.huggins,LYC.ddl, model="dot",
model.parameters=list(p=p.dot.fix.shared),output=FALSE, simplify=FALSE, initial=initial)
..and the results match MARK perfectly. Here are elements from the dm,
- Code: Select all
> LYC.huggins.M0$design.matrix[1:14,]
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 1 1 1 1 1 1 1 1 1 1 1 1 1
Levels: 1
> LYC.huggins.M0$design.matrix[155:168,]
155 156 157 158 159 160 161 162 163 164 165 166 167 168
1 1 1 1 1 1 1 1 1 1 1 1 1 1
Levels: 1
Next, I changed the group specified in process.data from age.yr to syear (sample year). This resulted in an error. Here is the process.data with the alternative group structure,
- Code: Select all
LYC.huggins=process.data(LYC,model="Huggins",begin.time=1,mixtures=1,
time.intervals=c(1,1,1,1,1,1,1,1,1,1), groups=("syear"))
The error,
Error in extract.mark.output(out, model, adjust, realvcv) :
MARK did not run properly. If error message was not shown, re-run MARK with invisible=FALSE
********Following model failed to run : p(~1)c() **********
...and elements of the design matrix,
- Code: Select all
> LYC.huggins.M0$results$beta
NULL
> LYC.huggins.M0$design.matrix[1:14,]
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 1 1 1 1 1 1 1 1 1 1 1 1 1
Levels: 1
> LYC.huggins.M0$design.matrix[155:168,]
<NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
<NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
Thanks for having a look.
andre