I conducted a study for two years with two locations (fields) in the first year and two different locations (fields) in the second year for a total of 4 site-year combinations. At each location I have 4 blocks. Within each block is the whole plot of cover crop (3 factors) and a sublplot factor of N rate (3 factors). We took soil samples in each plot three times during the year.
My objective is to determine how different cover crop and N rate treatments affect various soil measurements and if that varies by sample timing and/or the site and year combinations. Below is the code I have so far. I am not sure if it is correct or not.
proc mixed data = CCSHCorn1 covtest plots = studentpanel ;
class block siteyear sampletiming covercrop nratecat ;
model activeC =siteyear|covercrop|nratecat|sampletiming /ddfm=kr2;
random block block(siteyear) covercrop*block(siteyear) ;
repeated sampletiming/subject=block(covercrop*nratecat)type=un;
lsmeans siteyear*covercrop*nratecat*sampletiming /diff adjust = Tukey;
ods output tests3=tests3
CovParms = RandomVar ;
ods exclude lsmeans;
ods exclude diffs;
ods output diffs=ppp lsmeans=mmm;
run;
The three groups are split by a specific trait, and all receive the same intervention. So yes, it is similar to three different classrooms of students that each receive the same teaching intervention.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.