Programming the statistical procedures from SAS

P-values from Analysis of Variance (ANOVA)

Reply
Contributor
Posts: 44

P-values from Analysis of Variance (ANOVA)

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.

Respected Advisor
Posts: 2,655

Re: P-values from Analysis of Variance (ANOVA)

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

Contributor
Posts: 44

Re: P-values from Analysis of Variance (ANOVA)

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

Respected Advisor
Posts: 2,655

Re: P-values from Analysis of Variance (ANOVA)

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

Contributor
Posts: 44

Re: P-values from Analysis of Variance (ANOVA)

Hi SteveDenham,

Please see this path and please give me the solution.

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

Thanks in advance.

Ask a Question
Discussion stats
  • 4 replies
  • 463 views
  • 2 likes
  • 2 in conversation