Per code from a previous study, half-life is calculated as follows using a linear model. However, in addition to the mean half-life, I also want the minimum and maximum, and I want to calculate a p-value (Mann Whitney U Test). Is there a way to get the half-life results for each individual subject using GENMOD or a different SAS procedure?
data DSNIN;
label USUBJID = "Unique Subject Identifier"
ACTARMN = "Actual Treatment Arm (N)"
ATPTN = "Analysis Time Point (N)"
AVAL = "Analysis Value (PRNT Result)"
;
input USUBJID ACTARMN ATPTN AVAL @@;
cards;
1 1 1 10 1 1 15 49 1 1 29 79
1 1 43 271 1 1 57 216 1 1 90 142
1 1 181 86 1 1 365 20
2 1 1 12 2 1 15 54 2 1 29 89
2 1 43 267 2 1 57 209 2 1 90 131
2 1 181 80 2 1 365 26
3 1 1 21 3 1 15 60 3 1 29 101
3 1 43 282 3 1 57 220 3 1 90 151
3 1 181 85 3 1 365 29
4 2 1 17 4 2 15 55 4 2 29 90
4 2 43 291 4 2 57 232 4 2 90 160
4 2 181 100 4 2 365 32
5 2 1 17 5 2 15 59 5 2 29 99
5 2 43 286 5 2 57 203 5 2 90 151
5 2 181 91 5 2 365 18
6 2 1 20 6 2 15 56 6 2 29 92
6 2 43 288 6 2 57 226 6 2 90 151
6 2 181 90 6 2 365 18
;
data DSNIN;
set DSNIN;
where ATPTN>=29; /*after second vaccination*/
log2_AVAL = log2(AVAL);
run;
/*GEE Model*/
proc genmod data= DSNIN;
by ACTARMN;
class USUBJID;
model log2_AVAL=ATPTN / dist= normal link= identity corrb type3;
ods output GEEEmpPEst= Reg_Mod;
repeated subject= USUBJID / corr= ar(1) corrw;
run;
proc sql;
create table Results as
select 'PRNT' as ASSAY, ACTARMN, -1*(1/Estimate) as T_HALF, -1*(1/LowerCL) as T_HALF_LB, -1*(1/UpperCL) as T_HALF_UB
from Reg_Mod
where PARM= 'ATPTN';
quit;
If I understand your question, you can use PROC MIXED to fit the model, then use the OUTPRED= option on the MODEL statement to create an output data set in which the predicted values incorporate the random intercept for each person.
See the last example and discussion at
Visualize a mixed model that has repeated measures or random coefficients
I used the following code to get a similar result to the PROC GENMOD. Is there a way to tweak my code to yield the same result? The confidence intervals are also wider with PROC MIXED. I assume that's from the different methodology used to calculate them, but it doesn't look like you can specify method with PROC MIXED.
proc mixed data= DSNIN;
by ACTARMN;
class USUBJID;
model log2_AVAL=ATPTN / s htype= 3 cl corrb outpred= Prediction;
*random int / sub= USUBJID;
repeated / subject= USUBJID type= ar(1);
ods output SolutionF= Reg_Mod2;
run;
They are different models, so rather than trying to get the results to be the same, you should ask yourself which model is more appropriate for your data. The GEE model is marginal, whereas the mixed model is conditional. You can do an internet search to read more about when you should use GEE vs mixed models. For example, see When to use generalized estimating equations vs. mixed effects models? - Cross Validated (stackexcha...
Kathleen Kiernan wrote a paper on using GLIMMIX to model data and she includes a discussion of GEE vs mixed on p 9-11
She also shows how you can use the EMPIRICAL option in PROC GLIMMIX to obtain results that are similar to estimating a GEE model in PROC GENMOD.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.