Covariates >9 Primary or Secondary Occasions in RDOccupancy

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

Covariates >9 Primary or Secondary Occasions in RDOccupancy

Postby bwalexander » Wed Aug 17, 2011 12:24 pm

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
bwalexander
 
Posts: 2
Joined: Fri Mar 04, 2011 10:22 am

Re: Covariates >9 Primary or Secondary Occasions in RDOccupa

Postby jlaake » Mon Aug 22, 2011 4:10 pm

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
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Covariates >9 Primary or Secondary Occasions in RDOccupa

Postby bwalexander » Tue Aug 23, 2011 2:01 pm

Thanks that is what I was looking for.

Brad
bwalexander
 
Posts: 2
Joined: Fri Mar 04, 2011 10:22 am

Re: Covariates >9 Primary or Secondary Occasions in RDOccupa

Postby jnorthrup » Tue Sep 25, 2018 9:51 pm

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?
jnorthrup
 
Posts: 1
Joined: Tue Sep 25, 2018 9:21 pm

Re: Covariates >9 Primary or Secondary Occasions in RDOccupa

Postby jlaake » Wed Sep 26, 2018 10:23 am

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
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: Covariates >9 Primary or Secondary Occasions in RDOccupa

Postby jlaake » Wed Sep 26, 2018 12:26 pm

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
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to RMark

Who is online

Users browsing this forum: No registered users and 12 guests