I want to run a statistical model assessing the effects of light and herbivory on the length of plants (n = 53 observations). I developed one model with Site|Treatment as fixed effects (with Treatment containing both light and herbivory factors into one (-He = herbivores absent, +He = herbivores present, -Sh = unshaded, +Sh = shaded). Then, I tried a different model with Site|Light|Herbivory as fixed effects (splitting Treatment into two separate factors: light and herbivory). See the screenshot below. Even though the models are coded a bit differently, I would imagine that LSMESTIMATE should arrive at the same least squares mean values for both models considering they will calculate the mean of the response variable based on the same contrasts. However, I keep getting drastically different results for these two with respect to magnitude and direction of the means, and p-value? Treatment Model: DATA WORK.MONTH89; SET WORK.OR_LH_Under10_Index; IF Month >= 8 THEN OUTPUT; RUN; ods graphics on; PROC MIXED DATA = WORK.MONTH89 plots=all;; CLASS Treatment Site Month Block; MODEL'Change_Length'n = Site|Treatment /SOLUTION ddfm = KR CL ALPHA=0.05 INTERCEPT; RANDOM Block Month /CL ALPHA=0.05 TYPE=VC; LSMESTIMATE Site*Treatment 'SH +He/-Sh x SH -He/-Sh'[1,2 2][-1,4 2], 'SH +He/+Sh x SH -He/+Sh'[1,1 2][-1,3 2], 'SH +He/-Sh x SH +He/+Sh'[1,2 2][-1,1 2], 'SH -He/-Sh x SH -He/+Sh'[1,4 2][-1,3 2], 'SH +He/-Sh x SH -He/+Sh'[1,2 2][-1,3 2], 'CB +He/-Sh x CB -He/-Sh'[1,2 1][-1,4 1], 'CB +He/+Sh x CB -He/+Sh'[1,1 1][-1,3 1], 'CB +He/-Sh x CB +He/+Sh'[1,2 1][-1,1 1], 'CB -He/-Sh x CB -He/+Sh'[1,4 1][-1,3 1], 'CB +He/-Sh x CB -He/+Sh'[1,2 1][-1,3 1] / CL Alpha=0.05; LSMESTIMATE Site 'SH x CB'[1,2][-1,1] / CL Alpha=0.05; RUN; ods graphics off; Light/Herbivory Model: DATA WORK.MONTH89; SET WORK.OR_LH_Under10_Index; IF Month >= 8 THEN OUTPUT; RUN; ods graphics on; PROC MIXED DATA = WORK.MONTH89 plots=all; CLASS Light Herbivory Month Block Site; MODEL 'Change_Length'n = Site|Light|Herbivory /SOLUTION ddfm = KR CL ALPHA=0.05 INTERCEPT; RANDOM Block Month /CL ALPHA=0.05 TYPE=VC; LSMESTIMATE Site*Light*Herbivory 'Herbivory: SH Unshaded Present x Unshaded Absent'[1,2 2 2][-1,2 2 1], 'Herbivory: SH Shaded Present x Shaded Absent'[1,2 1 2][-1,2 1 1], 'Light: SH Unshaded Present x Shaded Present'[1,2 2 2][-1,2 1 2], 'Light: SH Unshaded Absent x Shaded Absent'[1,2 2 1][-1,2 1 1], 'H x L: SH Shaded Present x Unshaded Absent'[1,2 1 2][-1,2 2 1], 'Herbivory: CB Unshaded Present x Unshaded Absent'[1,1 2 2][-1,1 2 1], 'Herbivory: CB Shaded Present x Shaded Absent'[1,1 1 2][-1,1 1 1], 'Light: CB Unshaded Present x Shaded Present'[1,1 2 2][-1,1 1 2], 'Light: CB Unshaded Absent x Shaded Absent'[1,1 2 1][-1,1 1 1], 'H x L: CB Unshaded Present x Shaded Absent'[1,1 2 2][-1,1 1 1] / CL Alpha=0.05; RUN; ods graphics off; I am not sure if this is a content question or a programming question. I am hoping someone can help me understand what is happening behind the scenes.
... View more