For year 2007, and 2008 I have four levels of phosphorus and potassium but in 2009, only two levels of each. Can you please tell if my following model will take of this unbalanced design?
proc mixed data=Soils covtest cl ic;
ods output InfoCrit=ic;
class year Block Plot Tillplc Prate Krate Depth;
model log_Phos = year|Tillplc|Prate|Krate|Depth / ddfm=kr ;
random int tillplc tillplc*prate tillplc*Krate/subject = Block(year)
lsmeans year*Prate/ adjust=tukey;
lsmeans year*Krate/ adjust=tukey;
lsmeans year*Prate*Krate/ adjust=tukey;
Will I be able to still make correct comparisons of Prate and Krate for different years like i am showing in lsmeans statement?
This should work OK, as the year*Prate, year*Krate, and year*Prate*Krate lsmeans should all be estimable. However, main effect lsmeans will not be estimable.
Actually, I would use the LSMESTIMATE option (if you have v 9.2), otherwise it would require estimates/contrasts.
I guess I don't quite know what you mean by the last statement--are you missing all of the treatments, or just some of them?
I begin to think that a means model may be what is needed. See SAS System for Mixed Models (Littel et al.) or Analysis of Messy Data, vol. 1 (Milliken and Johnson).
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.