Hello all,
I am working on some mixed models where I am interested in the change of values from a baseline reading. However, I need to log-transform these in some instances. The second problem comes from these "changes" potentially being negative values. For example if I was using change in triglycerides from baseline, it's possible that someone may have a decrease in triglycerides from 200 mg/dL to 150 mg/dL at the next reading. For the example, assuming the largest difference is 50 unit decrease. To overcome these negative values, I am planning to add a constant of the largest negative values plus one to all values like so:
data ds;
set old;
if trig_chg ne . then do;
trig_chgt = trig_chg + 51;
logtrigc_chg = log(trigc_chgt);
end;
run;
So if I use my model code for non-log transformed values as shown below:
proc mixed data=ds method=reml plots=NONE noclprint;
class treatment(ref='0') visit subj;
model logtrigc_chg = &baseline. treatment visit treatment*visit/ ddfm=kenwardroger;
repeated visit / subject=subj type=UN ;
lsmeans treatment*visit / at means diff cl;
lsmestimate treatment "Placebo over time for &baseline." 0 1,
"Treatment over time for &baseline." 1 0,
"Treatment Vs Placebo for &baseline." 1 -1/cl alpha=0.05;
ods output lsmeans=lsmeans
diffs=diffs
run;
The output from "diff" in the LSMEANS and the third LSMESTIMATE statement are both working off of the log-value comparisons. I can report the individual statements in my LSMESTIMATE through exponentiating and subtracting the difference:
data lsmeans2;
set lsmeans;
expest = exp(estimate) - 51;
explow = exp(lower) - 51;
expupr = exp(upper) - 51;
run;
What can I do for the difference comparisons? Is there anyway to back transform these for calculations? Or how can these be calculated?
I would like the point estimate and the 95% CI. I appreciate any insight anyone may have on this!
I suggest taking the ratio (instead of difference). So, the outcome would be trig_2/trig_1 where trig_2 is the triglyceride measure at the second time point, and trig_1 is the measure at baseline. Then take log(trig_2/trig_1) as the measure to be analyze. Of course, this assumes that trig_2 is measured at the same time point for all participants in study. For example, everyone has baseline and 6-mo follow-up.
Thanks for your input cminard. I have done other modeling with the actual values, but not ratios or these. There is a really big interest in keeping it in the actual change format though for interpretation.
Consider shifting to GLIMMIX, and using either a log link or a lognormal distribution. For the former, the ILINK option will work for the differences between time points. For the latter (log normal), you can derive the significances for differences in the log space (which is what you are getting from a log transform in MIXED). Actual differences will have to be computed externally in a DATA step. You can either look at differences between geometric means (simple exponentiating of the lsmean estimates), or at differences in the expected values (complex exponentiation that takes 3 lines of code, followed by the difference). Note that neither of these backtransforms yields the standard error of the difference, although the second method depends on calculating a variance, from which a standard error of the backtransformed mean can be obtained. See the documentation for the DIST= option in the MODEL statement of PROC GLIMMIX for the equations needed.
SteveDenham
Agreed - the p values obtained are based on differences in the log normal space. My thought was to be able to present the results on the original scale as well.
SteveDenham
Thank you cminard and Steve. Both of you have added great points for me to consider further. I was overlooking reporting the differences as adjusted geometric mean ratios and specifying, but also appreciate the insight on modeling in GLIMMIX.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.