Programming the statistical procedures from SAS

proc mixed question

Reply
Contributor
Posts: 22

proc mixed question

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?

Thanks
Bhupinder
Respected Advisor
Posts: 2,655

Re: proc mixed question

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.

Steve Denham
Contributor
Posts: 22

Re: proc mixed question

So, it means I need to write contrasts to get those particular estimates?

One more question on this model, will same model work good if I don't have Prate and Krate treatments in one of the three years under study?

Thanks
Bhupinder
Respected Advisor
Posts: 2,655

Re: proc mixed question

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).

Steve Denham
Ask a Question
Discussion stats
  • 3 replies
  • 76 views
  • 0 likes
  • 2 in conversation