BookmarkSubscribeRSS Feed
jcl1
Calcite | Level 5

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; 

 

1 REPLY 1
tanakma5
Calcite | Level 5

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.

sas-innovate-wordmark-gradient-background 3.pngSAS Innovate

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 971 views
  • 0 likes
  • 2 in conversation