Hi All,
I’m working with some longitudinal binomial data in glimmix. I’ve got 3 time points (0, 1, and 2 as values) and I have some subgroups that are of interest (6, to be exact, two of which are race/ethnicity of White and Black). I have treated subgroup as a class variable, time as continuous.
I have crafted ESTIMATE statements that provide the estimate for subgroups at each time point (e.g. White at time 0, time 1…Black at time 0, time 1). I’m also trying to estimate the difference between two points (e.g. say, between time 0 and time 1 for White students. I’ve been able estimate differences between time, differences between subgroup (White in position 6, Black in position 1)…but I keep getting Non-Est for my interaction of subgroup*time. I’ve been working from this resource:
Below are the estimate statements I have thus far...all but the last one appear to work as I expect. Can someone kindly tell me what I’m missing (I must be in the weeds on this one)
proc glimmix data=cgr_sch method=rspl pconv=.001;
class school_code time_class subgroup;
model cgr_num/cgr_den=time subgroup subgroup*time/link=logit dist=binomial solution ddfm=bw htype=1;
random intercept time/subject=school_code type=un g gcorr;
estimate 'white at time 0' intercept 1 time 0 subgroup 0 0 0 0 0 1 subgroup*time [1,0 6],
'white at time 1' intercept 1 time 1 subgroup 0 0 0 0 0 1 subgroup*time [1,1 6]/cl exp ilink e;
estimate 'diff 0 vs 1' time [-1,0] [1,1];
estimate 'diff white v black' subgroup [-1,1] [1,6]/e;
estimate 'diff 0 vs 1-white' subgroup*time [1,0 6] [-1,1 6]/e;
run;
Jason
Hi All,
Finally got a solution from Susan Durham at Utah State. Effectively, you have to subtract the code for time 0:
estimate intercept 1 subgroup [1, 6] time [1, 0] subgroup*time [1, 0 6];
and time 1:
estimate intercept 1 subgroup [1, 6] time [1, 1] subgroup*time [1, 1 6];
With some cancellation of intercept and subgroup, you get:
estimate 'diff 0 vs 1-white' time [1,1] [-1,0] subgroup*time [1,1 6] [-1,0 6];
Try changing your model statement to this:
model cgr_num/cgr_den= subgroup*time /link=logit dist=binomial solution ddfm=bw htype=1;
Which may get your last Estimate statement to work, but will break the others.
Otherwise you willl need to specify the contrast values for time and subgroup, as well as time*subgroup.
Not sure, but based on the example SAS may have parameterized Time as the last effect. Try this:
estimate 'diff 0 vs 1-white' subgroup*time [1,6 0] [-1,6 0]/e;
If you have just a few times, you can make Time a class effect and use LSMeans or LSEstimate / AT Time = 0.
This is sometimes useful with the /e option to show you the correct contract vector, which you can then plug into the Estimate statement.
Some days I hate SAS. 😉
I can't say why it's not working without seeing the parameterization (and maybe not even then), but I suspect the cause is there. I can't always get all the estimates I need from a single paramerterization, sometimes multiple passes at the model are needed.
You might try looking at the different parameterizations you get from:
subgroup*time
subgroup subgroup*time
subgroup|time
to see it that gives you any hints at what is missing.
Hi All,
Finally got a solution from Susan Durham at Utah State. Effectively, you have to subtract the code for time 0:
estimate intercept 1 subgroup [1, 6] time [1, 0] subgroup*time [1, 0 6];
and time 1:
estimate intercept 1 subgroup [1, 6] time [1, 1] subgroup*time [1, 1 6];
With some cancellation of intercept and subgroup, you get:
estimate 'diff 0 vs 1-white' time [1,1] [-1,0] subgroup*time [1,1 6] [-1,0 6];
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.
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.