Page 1 of 1
Covariates >9 Primary or Secondary Occasions in RDOccupancy

Posted:
Wed Aug 17, 2011 12:24 pm
by bwalexander
I have a robust design data set with 16 primary occasions and 10 secondary occasions. In this instance, how do I label time varying covariates so that RMark will read them correctly? I know that covij is used for a covariate that applies to the ith primary occasion and the jth secondary occasion. However, I have not seen how I would label a covariate that applies the the >=10th primary or secondary occasion. For example how would I label these:
1. A covariate that applies to the 10th primary and 10th secondary occasion.
2. A covariate that applies to the 10th primary and 1st secondary occasion.
2. A covariate that applies to the 1th primary and 10th secondary occasion.
Thanks,
Brad Alexander
Re: Covariates >9 Primary or Secondary Occasions in RDOccupa

Posted:
Mon Aug 22, 2011 4:10 pm
by jlaake
It simply pastes values together. sessiontime where session is the primary and time is the secondary values in the design data. Look at the design data for the parameter that the covariate will apply to.
The answers below assume that time=secondary occasion and session=primary occasion value.
1. A covariate that applies to the 10th primary and 10th secondary
occasion.
cov1010
2. A covariate that applies to the 10th primary and 1st secondary occasion.
cov101
2. A covariate that applies to the 1th primary and 10th secondary occasion.
cov110
Let me know if you have any problems. I've been away on vacation or would have answered sooner. --jeff
Re: Covariates >9 Primary or Secondary Occasions in RDOccupa

Posted:
Tue Aug 23, 2011 2:01 pm
by bwalexander
Thanks that is what I was looking for.
Brad
Re: Covariates >9 Primary or Secondary Occasions in RDOccupa

Posted:
Tue Sep 25, 2018 9:51 pm
by jnorthrup
What about if you have > 11 primary and secondary occasions? It seems like this would lead to redundant covariate names, e.g.,
11th primary and 1st secondary would be cov111
and 1st primary and 11th secondary would also cov111
How do you deal with this?
Re: Covariates >9 Primary or Secondary Occasions in RDOccupa

Posted:
Wed Sep 26, 2018 10:23 am
by jlaake
A big oversight on my part. I hadn't thought of that combination. I'll have to change the code to handle this situation. Stay tuned.
--jeff
Re: Covariates >9 Primary or Secondary Occasions in RDOccupa

Posted:
Wed Sep 26, 2018 12:26 pm
by jlaake
So one way out of the pickle is to assign begin.time to a value so the times for the secondary occasion don't match the values of session. It is session-time that is combined for covariate names.
For example, with the ?RDOccupancy example if you add begin.time=1990 then the covariates would have to be named occ19901, occ19902,occ1993,occ19911,... Any value for begin.time could be used to avoid confusion. Likewise, you could modify the value of time in the design data but that would have to be done manually with R commands after creating design data with make.design.data. I'll add a check to code for redundant covariate names like cov111, cov111 for the case that you identified.
I apologize for any problems this may have caused.
--jeff