BookmarkSubscribeRSS Feed
jacksonan123
Lapis Lazuli | Level 10
ods trace on /listing;
ods output estimates=stat1;
ods output FITSTATISTICS=stat2; 
ods output LSMEANCL=stat3;
ods output OverallANOVA=stat4;
ods output LsmeandiffCL=stat5;
ods output LsmeanCL=stat6;
proc glm data=new1;
class trt;
model clnr=trt/ss1 ss2 ss3 ss4;
lsmeans trt/pdiff cl alpha=0.10;
estimate 'A vs B' trt 1 -1;
quit; run;

ods trace on /listing
ods output estimates=stat7;
ods output FITSTATISTICS=stat8; 
ods output LSMEANCL=stat9;
ods output OverallANOVA=stat10;
ods output LsmeandiffCL=stat11;
ods output LsmeanCL=stat12;
proc glm data=newL1; 
class trt;
model Lclnr=trt/ss1 ss2 ss3 ss4;
lsmeans trt/pdiff cl alpha=0.10;
estimate 'A vs B' trt 1 -1; quit;

The code was used to analyze the attached data set  CLnr1.  The outputs from stat6 and stat12 were compared which are the Lsmean CI.

Stat6

Obs Effect Dependent TRT LowerCL LSMean UpperCL 1 2

TRTCLnrA102.984141114.620000126.255859
TRTCLnrB38.76354647.96250057.161454

 

Stat12

Obs Effect Dependent TRT LowerCL LSMean UpperCL 1 2

TRTLCLnrA4.5541364.7328124.911488
TRTLCLnrB3.6997953.8410513.982307

The values of exp(lower CL) and exp(upper CL) give values for A (94-134) and B(40-53) which are close to the values for the normal scale. 

However for stat5 for the difference on the normal scale I get:

bs Effect Dependent i j LowerCL Difference UpperCL TRT _TRT 1

TRTCLnr1251.82463266.65750081.490368AB

Whereas for stat 11 for the LClnr I get

s Effect Dependent i j LowerCL Difference UpperCL TRT _TRT 1

TRTLCLnr120.6639930.8917611.119529AB

If I do the exp(lowerCL) and exp(UpperCL) I get (1.93-3.03) which is not in agreement with the normal scale.

 

Can someone explain to me why the normal scale and log scale agree for the CL for A and B but not for the difference between A and B for the normal and log scale?

6 REPLIES 6
PGStats
Opal | Level 21

On the log scale, Difference is an estimate of log(A) - log(B) = log(A/B)

 

So, EXP(Difference) is an estimate of the ratio A/B, not A - B.

PG
jacksonan123
Lapis Lazuli | Level 10

I have used EXP(difference) which based upon your response is not correct.

Therefore my question is how should the log(A/B) ratio on the log scale be exponentiated  to have it reflect the A-B difference on the Normal scale for the respective confidence intervals?  

SteveDenham
Jade | Level 19

This is why it is a good idea to use GENMOD or GLIMMIX, so that results can be presented on both the transformed and original scale.  PROC GLM just can't do that.

 

Steve Denham

jacksonan123
Lapis Lazuli | Level 10

I was able to get the CI on the log scale (see code below) by use of the command LRCI. How do I get the CI

m on the normal scale per your suggestion?

 

Proc genmod data=y;

class trt;

model lauc144=trt/lrci;

run;

Doc_Duke
Rhodochrosite | Level 12

When you take a log transform, you are now in the realm of the geometric distribution.  Google

geometric mean site:sas.com

for lots of information on your question.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 6 replies
  • 3154 views
  • 2 likes
  • 4 in conversation