I am testing the effect of a product applied at four different concentrations (continuous variable), at two sites and six genotypes (class variables). The treatments were blocked at each site. Site*concentration is significant, which is interesting. Two specific follow-up questions are 1. what is the slope for concentration at each site, averaged across genotypes? and 2. are each of those slopes different from zero (i.e., does concentration actually affect the response at both of the sites)?
This may not be the most elegant strategy, but I'm able to get the response = slope*concentration + intercept lines for each site by sending the lsmeans through proc reg. However, since the data variability is lost, this does not tell me whether each slope is different from zero. My attempts at proc mixed estimate statements for this test are giving errors; any help would be much appreciated!
proc mixed data=data ;
class site genotype block;
model response = site|genotype|concentration ;
random block(site) ;
lsmeans site / at concentration = 0 ;
lsmeans site / at concentration = 10 ;
lsmeans site / at concentration = 20 ;
lsmeans site / at concentration = 30 ;
ods output lsmeans = lsmeans;
proc sort data=lsmeans; by site;
proc reg data=lsmeans;
model estimate = concentration;
Estimate statements for slopes are tricky. It gets even trickier when you have many interactions. Harder still is averaging slopes over one of the model CLASS effects. The best strategies for getting to your end result is to build up your ESTIMATE statements using more simple tests and using the /E option on the ESTIMATE statement to make sure you have coefficients in the correct place. It is scarily easy to write an ESTIMATE statement that is giving you an answer but that is testing the wrong hypothesis!
First, try to write ESTIMATE statements for each of the 6 slopes on genotype for the 2 sites. Those ESTIMATE statements will involve the main effect of CONCENTRATION and the interactions of SITE*CONCENTRATION, GENOTYPE*CONCENTRATION, and SITE*GENOTYPE*CONCENTRATION. The coefficients on the ESTIMATE statement will all be 1's here, in the appropriate spots for each of these 4 effects. Again, that /E option will show you if you have your coefficients in the right spot.
Then, you can average the coefficients over the genotypes in a site to get your final result. With 6 genotypes, you can either use .1666666 as the coefficients on the G*C and S*G*C interactions, or use 1 and the DIVISOR=6 option on the ESTIMATE statement. The coefficient on C and S*C would be 6 in this case using that DIVISOR= option.
If you get a non-estimable result for that ESTIMATE, check the /E option output to make sure you have the coefficients in the right place. Check that output even if you don't get a non-estimable result to make sure you are testing the correct hypothesis.
It takes a lot of experience to get estimates like this correct. Working with an experienced statistician is always a good idea when writing post-hoc tests like these.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.