turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Time-varying predictor for PROC MIXED

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-13-2017 07:35 PM

Hello,

I have been searching from some resources, but seem to be stuck. I am looking at a treatment program (variable name is trtprogram) from 2000 (time 0) to 2007 (time 7). People could have been in (coded as 1) and out of the treatment program (coded as 0). But, I want to see it's affect on the outcome (variable name is: cd4). I am using a quadratic model because it fits the data the best. How do I best write and interepret this data? Below is my hypothesis but I am not sure if this is taking into account the time-varying predictor (trtprogram).

**proc** **mixed** data = work noclprint covtest;

class id trtprogram (ref='0');

model cd4 = time time2 trtprogram trtprogram*time trtprogram*time2/ ddfm=bw solution cl;

random intercept time time2/subject = id type = un;

**run**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to jstats13

02-14-2017 11:56 AM

The only way I can think of to handle time varying covariates in PROC MIXED involves having time as a class variable, and fitting time*covariable with a noint option--and I'm not real happy with that approach.

PROC PHREG does better with this, although I have never tried it It appears that you could pull several of the examples in the documentation together to approach this. You would have no censoring (I assume), so between Example 85.7 Time-Dependent Repeated Measurements of a Covariate and Example 85.11 Analysis of Clustered Data, you might be able to get where you want to go.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

02-14-2017 07:31 PM

Hello,

Thanks for the information. I believe it can be used with PROC MIXED. Wouldn't it be possible to put it in the Random Statement?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to jstats13

02-14-2017 01:10 PM

This isn't my area, but for what it's worth there is a similar problem in *SAS for Mixed Models* (2nd Ed), p. 190-196.

In that book, they let

t=time;

t2=time*time;

be continuous variables and they fit

class id trtprogram (ref='0') time;

model cd4 = trtprogram time t t2

trtprogram*time trtprogram*t trtprogram*t2 ;

The time-related variables are not included as random effects in the example. If you have access to that book, you might want to read that section to see if it is relevant to your data.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

02-14-2017 07:34 PM - edited 02-14-2017 07:35 PM

Thanks for the example. I am thinking that the time-varying predictor...in this case would need to be in the Random Statement.

Maybe something like this...

**proc** **mixed** data = work noclprint covtest;

class id trtprogram (ref='0');

model cd4 = time time2 trtprogram/ ddfm=bw solution cl;

random intercept time time2 mcm_dico /subject = id type = un;

**run**;

Thoughts? Am I still able to say the change in CD4 cell counts based on Treat Program from this analysis?