Help using Base SAS procedures

Post Hoc Comparisons in PROC GLM for Analysis of Covariance?

Reply
N/A
Posts: 0

Post Hoc Comparisons in PROC GLM for Analysis of Covariance?

How does one get PROC GLM to report post hoc comparisons among means in an Analysis of Covariance rather than an Analysis of Variance setup?

In PROC GLM, one can ask for post hoc comparisons among means and get a convenient display of ordered means showing which pairs are significantly different:
proc glm data=indz;
class school;
model meanZ=school yrstopublish ;
lsmeans school ;
means school / lsd opt=lines;
run;

Here, lsd is one type of post hoc comparison test, and opt=lines creates a compact graph showing which ordered means differ significantly.

Unfortunately, one can't ask for / lsd opt = lines in the lsmeans statement rather than the means statement. Therefore, the post hoc tests use an error term that ignores the information in the covariate, giving the same output as if the model had omitted the covariate yrstopublish -- that is, the same as:

proc glm data=indz;
class school;
model meanZ=school ;
lsmeans school ;
means school / lsd opt=lines;
run;

Thanks!
Ask a Question
Discussion stats
  • 0 replies
  • 141 views
  • 0 likes
  • 1 in conversation