BookmarkSubscribeRSS Feed
HimaAalamuri
Fluorite | Level 6

Hi all,

please help me to come out from this problem!

i have one table need to develop, on that table i have to use Anova procedure to display (adjusted mean, SE of Adj mean, diff of adj mean , SE of adj mean, 95% CI of adj diff and p-value).

i am getting results for ajusted mean, SE of adj mean, diff of adj mean and 95%CI values but i am not getting values for SE of adj mean & diff of p-values?

so how can i get those results by using ANOVA??

Code:

proc glm data=datasetname;

class subject visit trt covar1 covar2 covar3 covar4;

model value=trt visit trt*visit  covar1 covar2 covar3 covar4;

estimate "Plac Vs study" trt 1 -1;

lsmeans trt*visit/ pdiff tdiff CL alpha=0.05 stderr;

run;

please help me out!

Thanks in advance.

4 REPLIES 4
SteveDenham
Jade | Level 19

Add the following to your code:

ods output lsmeans=lsmeans lsmeandiffcl=diffs;

The datasets from this will include an estimate (adjusted mean for the lsmeans dataset, difference in adjusted means for the diffs dataset), standard errors of those estimates, and since you specified the CL option on the LSMEANS statement, 95% confidence bounds for the estimates.

If this does not give you what you need, consider using PROC GLIMMIX, as it can handle standard ANOVA and still produce a variety of outputs that seem more straightforward (at least to me).

Steve Denham

HimaAalamuri
Fluorite | Level 6

i used ods output statment but no use ..

i will try proc glimmix and let you know what happend.

but my doubt is we have a right to use proc GLIMMIX instead of ANOVA? Both are same or yeilds diff resutls.. how can i prove we can use GLIMMIX instead of Proc glm with my team/sponsor?

Could you suggest!!

Hima

SteveDenham
Jade | Level 19

PROC GLIMMIX and PROC GLM will give the same results for simple designs, while for more complex designs GLIMMIX will give correct values (especially for standard errors of the lsmeans) that GLM will not.  It is as if you have to race across a lake--you may choose a raft (ANOVA/GLM) or a speedboat (GLIMMIX).  Both are capable of getting you there, but you have to be very sure of a lot of things for the raft (ANOVA) to work out.  And you have to have some experience to make the speedboat work (GLIMMIX).

Consider this code for your data:

proc glimmix data=datasetname;

class subject visit trt covar1 covar2 covar3 covar4;

model value=trt visit trt*visit  covar1 covar2 covar3 covar4;

random visit/residual subject=subject /* a type= option would be appropriate here to model the correlation of value from visit to visit */;

lsmestimate trt "Plac Vs study"1 -1;

lsmeans trt*visit/diff CL alpha=0.05;

ods output lsmeans=lsmeans diffs=diffs lsmestimate=lsmestimate;

run;

Steve Denham

HimaAalamuri
Fluorite | Level 6

Hi SteveDenham,

Please see this path and please give me the solution.

https://communities.sas.com/message/249713#249713

Thanks in advance.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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