My understanding is that, you wanted the percent change, also wanted the significance of the percent change (p-value, or 95%ci, or both), correct? If so, you would need to use PROC NLMIXED to fit your model and use the ESTIMATE statement to get what you want.
The syntax of the ESTIMATE statement depends on your model set up. For this new request, can you send me your current program (proc glm or proc mixed) and exactly what percent change you want? I will see if I can come up with the PROC NLMIXED program for you.
Thanks,
Jill
Thank you Jill. Here is what I am trying to solve for :
I have two groups with a metric that is measured across two time frames say T+2 and T0 , where T0 is the baseline. I need to compare the percentage change in the metric from T0 to T+2 across the two groups, with the baseline metric being one of the covariates. Additionally, I have been tasked to identify other covariates eg. Cov A Cov B and Cov C (mix of continuous and categorical) that are associated (have statistically significant relationship) with the change. I am aware and as Steve has rightly pointed out that we cannot regress percentage change or the difference T+2- T0 values. Hence, I tried to regress T+2 metric ~ T0baseline + group . Here is what I have put together :
proc glm data=have;
class group;
model T+2_metric= group T0_metric covA cov B covC /solution;
lsmeans group/pdiff=all ;
run;
I am struggling with how to arrive at the percentage change comparison from here.
With the proc mixed code, Steve had provided I was able to get the % Change in Group A vs Group B. However, I would need to control for the baseline value as well. Please let me know if this makes sense or if I have been approaching the problem incorrectly.
Thanks,
Rhea
There is one issue that you should think about some more, in my opinion. It looks like you are "adjusting" for baseline twice - once by calculating the percent change for the given subject, and again by using the baseline as a covariate. If you have the percentage change for each subject, then I would remove the baseline covariate from the model.
SteveDenham
Hi Steve,
Since using percentage change as a response variable isn't recommended, I had to restate the equation as T+2_metric ~ T0_metric (baseline) + group.
As recommended, should I compare the means of t0_metric to get the average for each group and then calculate the difference between those values and the corresponding least squares means, dividing by the average t0_metric X100?
Will this lead to adjusting of baseline twice?
Thanks,
Rhea
Your PROC GLM code treats the baseline measurements (T0) as a covariate, and I am not sure if a percent changes between the measurements at T2 and T0 can be computed based on this model specification.
Steve's PROC MIXED model specification computes the difference between the groups in T2, accounting for the baseline measurements. Is that what you wanted?
If you want to compute the difference between T2 and T0, whether it is a percent difference or the raw difference, you would probably need to arrange your data to have a TIME variable in there, just like what you sent in the original post.
I think my PROC NLMIXED code worked for your original question, right? That model has TIME and TREATMENT (or GROUP?) in there. How is your new question different from the previous one in terms of the data and model?
Thanks,
Jill
Hi Jill,
"Steve's PROC MIXED model specification computes the difference between the groups in T2, accounting for the baseline measurements. Is that what you wanted? " - Answer: Yes.
Essentially I need to be able to compute the %change in the metric from T0 to T+2 for the two groups A&B. I can arrange the data in the long format to achieve it. Additionally, I need to check if any other covariates (continuous or categorical) also have an impact on the delta. I believe, I will need to create separate groups based on the levels of categorical variables I have. Perhaps for continuous I will need to bin the data to create sub- groups ?
I am sorry, I was not the person who originally posted this question. I found my issue to be similar hence wanted your advice as to how to solve for it.
Thanks,
Rhea
Sorry I did not realize that you are a different person 🙂
Please note that Steve's code computes the difference in T2 (the response) between the groups, not the difference between T2 and T0. You said that his approach answers your question, but you want the difference between T2 and T0 -- that does not make sense to me. Maybe I still miss your request.
Jill
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.