BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
caroline_rg
Fluorite | Level 6

Hi!

 

I would like to look at the LSmeans and SE for all of my data (not separated by treatment). I tried using a simple code to look at it, but it gives an estimate for each experimental unit (same as observation value), standard error and of 0 and no other values. Here is that code:

/* LS means calc */
proc mixed data=fetus_truie;
class truie;
model nbr_pig=truie;
lsmeans truie;
run;

 

This is the code I used to do LSmeans (&other stats) separated by treatment (trait):

proc mixed data=fetus_truie;
  class TRAIT truie;
  model NBR_PIG=TRAIT/alpha=0.05 noint;
  repeated / group=TRAIT;
  ods output tests3=tests;
  lsmeans TRAIT / cl;
  ods output lsmeans=lsm;
run;

Is the average LSmeans and SE for each treatment equal to the LSmeans and SE for all the data?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

It sounds like your TRUIE variable uniquely identifies each experimental unit. If that is correct and you just want an overall mean estimate (which assumes all units come from the same population), then the intercept in an intercept-only model estimates it.  Of course, in that case you don't really need to fit a model and can just use PROC MEANS. 

proc mixed data=fetus_truie;
model nbr_pig= / s;
run;
proc means data=fetus_truie mean stderr; 
var nbr_pig; 
run;

View solution in original post

1 REPLY 1
StatDave
SAS Super FREQ

It sounds like your TRUIE variable uniquely identifies each experimental unit. If that is correct and you just want an overall mean estimate (which assumes all units come from the same population), then the intercept in an intercept-only model estimates it.  Of course, in that case you don't really need to fit a model and can just use PROC MEANS. 

proc mixed data=fetus_truie;
model nbr_pig= / s;
run;
proc means data=fetus_truie mean stderr; 
var nbr_pig; 
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 419 views
  • 1 like
  • 2 in conversation