I have the following error when I try to run any parameter for P that isnt time or a dot model (I'm running a MSORD.)
- Code: Select all
> model.15=mark(rd, ddl=rd.ddl,
+ time.intervals=time.intervals,
+ model.parameters=list(S=S.a, pent=pent.time,
+ p=p.age, Psi=Psi.rand, Phi=Phi.a),output = FALSE,threads=2)
Error in make.mark.model(data.proc, title = title, parameters = model.parameters, :
Error: Variable age used in formula is not defined in data
Error in mark(rd, ddl = rd.ddl, time.intervals = time.intervals, model.parameters = list(S = S.a, :
Misspecification of model or internal error in code
I think I understand what the issue is (I need to add 'age' to the design data). What is concerning me is that my other models where I use age run fine e.g using Phi.age, so why is it just throwing up this when I try to use it for P?
I've read the handbook and the section on design data for the rmark package in the rmark documents, and I'm struggling to add age or cohort within the design data for p. I want to see how p changes across the years 2012-1018. currently my design data looks like this;
- Code: Select all
rd.ddl<-make.design.data(rd,
parameters=list(Psi=list(subtract.stratum=c("1","U"))))
which works fine for everything but p.
I tried this to add in cohorts
- Code: Select all
rd.ddl<-add.design.data(rd,rd.ddl, parameter="p", type="cohort", bins = c(2012, 2013, 2014, 2015, 2016, 2017), name = "test")
but with no luck.
Any thoughts would be really appreciated, I'm sure it's very simple!!
Thank you so much!