BookmarkSubscribeRSS Feed
jstats13
Fluorite | Level 6

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;

4 REPLIES 4
SteveDenham
Jade | Level 19

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

jstats13
Fluorite | Level 6

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?

Rick_SAS
SAS Super FREQ

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.

 

jstats13
Fluorite | Level 6

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? 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 5168 views
  • 5 likes
  • 3 in conversation