BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AaronJ
Obsidian | Level 7

I have a code written for a split-plot analysis with repeated measures written with Proc MIXED. However, I have not been able to write a code that will deliver results for whether dates are significantly different from each other. LS Means commands do this quite nicely, but i haven't been able to write an LS Means code that produces an output. 4 plots in 4 Blocks (N=4), and the plot is what the repeated measures are performed on (n=16). PlotID was written to give each plot a unique ID. Compound Symmetry was determined to be the best covariance structure for the data. How do i write code to test if the mean logN2O values differ by Date?

Code:

ODS graphics on ;
proc mixed data=AllEvents covtest;
Class Block Fert Nfix Date PlotID;
Model logN2O= Fert Nfix Fert*Nfix / s;
Random Block Block*Fert;
Repeated / Type=CS subject=plotID r;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

The design structure of your study is not totally clear to me. If levels of both FERT and NFIX are assigned randomly to plots within blocks, then something like this might be appropriate:

 

proc mixed data=AllEvents covtest;
  class block fert nfix date plotid;
  model logN2O= fert|nfix|date / s;
  random block;
*random block*fert*nfix; /* deliberately omitted for type=cs */ repeated date / subject=block*fert*nfix type=cs; run;

Note that block*fert*nfix identifies the same levels of a random effects factor as does plotid.

 

See http://onlinelibrary.wiley.com/doi/10.1002/1097-0258(20000715)19:13%3C1793::AID-SIM482%3E3.0.CO;2-Q/... for a discussion of when  

 

random block*fert*nfix;

 

would be included depending on covariance structure type.

 

See the SAS documentation for the REPEATED statement in MIXED for details about using "repeated date / subject=..." rather than "repeated / subject=...".

 

View solution in original post

3 REPLIES 3
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

If you want to compare mean logN2O among dates, the DATE factor must be in the MODEL statement.

AaronJ
Obsidian | Level 7

I assume that is true as well. The question then becomes how to correctly write the error term(s) for including Date? Or does Proc MIXED do that automatically?

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

The design structure of your study is not totally clear to me. If levels of both FERT and NFIX are assigned randomly to plots within blocks, then something like this might be appropriate:

 

proc mixed data=AllEvents covtest;
  class block fert nfix date plotid;
  model logN2O= fert|nfix|date / s;
  random block;
*random block*fert*nfix; /* deliberately omitted for type=cs */ repeated date / subject=block*fert*nfix type=cs; run;

Note that block*fert*nfix identifies the same levels of a random effects factor as does plotid.

 

See http://onlinelibrary.wiley.com/doi/10.1002/1097-0258(20000715)19:13%3C1793::AID-SIM482%3E3.0.CO;2-Q/... for a discussion of when  

 

random block*fert*nfix;

 

would be included depending on covariance structure type.

 

See the SAS documentation for the REPEATED statement in MIXED for details about using "repeated date / subject=..." rather than "repeated / subject=...".

 

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
  • 3 replies
  • 1510 views
  • 2 likes
  • 2 in conversation