BookmarkSubscribeRSS Feed
Clg
Obsidian | Level 7 Clg
Obsidian | Level 7

Hello,

 

I do an one-way ANOVA with a proc mixed to can do estimates. I have in my model only the treatment group and my variable to explain is in log. I need to have the between subject variability but I don't know if it's correct. 

 

My model is :

 

%macro model(PARAM);
proc mixed data=ANOVA_TMP method=type3 ;
class usubjid TRTA_TMP;
model &PARAM= TRTA_TMP / s alpha=0.10 ddfm=kr ;
estimate "b versus A " TRTA_TMP -1 1 0 / cl alpha=0.10 ;
estimate " c versus b" TRTA_TMP 0 -1 1 / cl alpha=0.10 ;
lsmeans TRTA_TMP / cl alpha=0.05;

ods output estimates=_Estim;
ods output lsmeans=_LSMEANS;
ods output Type3=_Type3;
run;

 

data _Estim;
set _Estim;
estim_exp=exp(Estimate);
se_exp=exp(StdErr);

ci_inf_exp=exp(lower);
ci_sup_exp=exp(upper);
run;

 

data _LSMEANS;
set _LSMEANS;
estim_exp=exp(Estimate);
ci_inf_exp=exp(lower);
ci_sup_exp=exp(upper);
run;

 

data _Type3;
set _Type3;
std_log=sqrt(MS);
CV_inter_geometric=((exp(std_log**2)-1)**(1/2))*100;
run;

%mend;

 

With this way, I obtain a CV%inter group (and not between-subject) equal to 37% but in each group I have an CV% respectively, 20.7% ; 30.6% and 13% so i think that it's not constistent. Could you help me please ?

 

Thank you in advance

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

Re-titled and moved the procedures forum.

SteveDenham
Jade | Level 19

In this model, the between subject variability is characterized by the RESIDUAL variance, since you are doing an OLS solution (due to the method=type3 option).  The model does not have a within-subject structure, so that is not presented.

 

So, when you divide the residual standard deviation by the treatment means, you get different CV's for each treatment.  That is not surprising, and in fact, exactly what I would expect, as the model assumes a constant variance by group, and you have one value divided successively by 3 different values.  Consequently, I think your macro is doing exactly what the data tells us.  You will have to explain why you think something different should occur, and then we could perhaps come up with an alternative.  And by the way, the variable se_exp is not the standard error of estim_exp.  Consider this: estim = 2, se =0.2.  Applying your formulas, I get estim_exp = 7.389 and  se_exp=1.221.  Note that se_exp is bounded below by 1, whereas the standard error of data with a mean of 2 is bounded below by 0, as n goes to infinity.  Check some references for a proper conversion - the formula will be almost identical to the one you have for CV_inter_geometric (divided by sqrt(N))..

 

Finally, since this is in log space, you are implicitly making the assumption that the CV is identical for all treatment groups - it is a multiplicative model, and the standard deviation is in a constant ratio to the mean.

 

You may want to use PROC GENMOD on your untransformed data to get the information you want.

 

SteveDenham

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 2611 views
  • 0 likes
  • 3 in conversation