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!
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;
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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.