BookmarkSubscribeRSS Feed
bionazm
Calcite | Level 5

I would like to generate a table with Lsmeans, SEM, and the P-value for a Proc GLM used for an experiment with 4 treatments. I am not sure what syntax to use.

2 REPLIES 2
ballardw
Super User

Start by sharing your current code for Proc GLM.

Then tell which variables/effects you want LSMEANS output for and which specific P-values. The procedure can create multiple p-values depending on requests.

 

If this is to be a single "table" then likely that means creating output data set(s) and combining and selecting.

bionazm
Calcite | Level 5

Thanks for getting back to me! 

The experimental design has 4 increased doses of a supplement (0, 5, 10, and 20%) in poultry with 10 animals/pen and 5 pens/treatment.

Here the syntax I used:

proc GLM;
Class Pen TRT Sex;
Model par1 par2 par3 par4 =TRT;
lsmeans TRT/ pdiff;
means SHB / t lines;
run;

 

proc GLM;

Model par1 par2 par3 par4 =TRT TRT*TRT;

Run;

 

 

I am interested in having a table such this:

                         

ParameterLsmean TRTSEMP-valueLinearQuadratic
 051020    
par1        
par2        
par3        
par4        

 

 

Thanks!

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

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
  • 799 views
  • 3 likes
  • 2 in conversation