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