Hello everyone,
I need your urgent help.
I have 16 plants treated with 16 different fertilizers and a control plant (untreated), for a total of 17 units. The pots were randomly arranged without replication. However, these plants were fertilized for 27 weeks. What would be the repeated measure code for this? I want to see the effects of these fertilizers on plant height for 27 weeks. This is the coding I came up with. Thanks for your valuable time.
frt= fertilizers
ph= plant height
Proc glimmix Data =first;
class frt ph week;
model ph = fert week fert*week;
random week/subject=frt*rep type=ar(1) residual;
lsmeans fert*week / pdiff Adjust = Tukey lines slicediff= day;
output out=second predicted=pred residual=resid residual(noblup)=mresid student=studentresid student(noblup)=smresid;
Run;
Because you have no replication of your fertilizer treatments, other than in time, this looks like a classic growth curve comparison. I think your code might have some redundant parts, so consider the following:
Proc glimmix Data =first;
class frt ph week;
model ph = fert week fert*week;
random week/subject=frt type=ar(1) residual; /* Removed rep as it is confounded with tertilizer */
lsmeans fert*week / Adjust = Tukey lines slicediff= week; /* changed the slicediff to reflect the terms in the lsmeans, deleted the pdiff as the slicediff handles all differences of interest */
output out=second predicted=pred residual=resid residual(noblup)=mresid student=studentresid student(noblup)=smresid;
run;
I hope this helps. I have been pretty busy with my real world work and haven't been able to answer here as soon as folks need.
SteveDenham
Because you have no replication of your fertilizer treatments, other than in time, this looks like a classic growth curve comparison. I think your code might have some redundant parts, so consider the following:
Proc glimmix Data =first;
class frt ph week;
model ph = fert week fert*week;
random week/subject=frt type=ar(1) residual; /* Removed rep as it is confounded with tertilizer */
lsmeans fert*week / Adjust = Tukey lines slicediff= week; /* changed the slicediff to reflect the terms in the lsmeans, deleted the pdiff as the slicediff handles all differences of interest */
output out=second predicted=pred residual=resid residual(noblup)=mresid student=studentresid student(noblup)=smresid;
run;
I hope this helps. I have been pretty busy with my real world work and haven't been able to answer here as soon as folks need.
SteveDenham
It doesn't mean that - what it does mean is that you have included it in the CLASS statement. If a dependent variable is given in the CLASS statement, GLIMMIX defaults to a multinomial. So, remove "ph" from the CLASS statement.
SteveDenham
This is what I feared when you described the experimental design. I would first try removing the main effects of frt and week from the MODEL statement leaving
model ph =frt*week;
This one-way model would test whether any plant at any time point differed from any other plant at any time point. It should get away from the saturated mean/profiled variance.
If that does not work, consider analyzing the data with a generalized estimating equation approach (PROC GEE). Something like this may be possible:
Proc gee Data =first;
class frt week;
model ph = week;
repeated subject=frt/type=ar(1) covb corrb;
run;
If this runs, we can work on getting marginal means and pairwise comparisons out later. Additionally, look at Example 49.3 (SAS/STAT 15.2) Weighted GEE for Longitudinal Data That Have Missing Values.
SteveDenham
Yes, the experimental design is not ideal, unfortunately.
When I run the proc gee, I do not see whether treatments differ from each other. I only see the week differences.
there are 27 weeks but somehow the data mixed up with plant height data ( pls see the ss below)
log:
What does the "H" designate for the variable ph? Has the plant been harvested? If so, then it should be replaced with a period if it no longer exists, or perhaps with the last observation carried forward (LOCF method). Mixed modeling is robust to missing data when there is adequate replication. You will have to make a scientific decision as to how to proceed, based on what your research question is.
SteveDenham
I've corrected that one in SAS. It is a letter from a treatment name with a space in between. I would like to have a pairwise comparison of treatments ( fertilizers) with letters. The hypothesis is that the fertilizers will increase the plant height.
I tried adding;
Proc gee Data =Waterford;
class frt week;
model ph=frt;
repeated subject=frt/type=ar(1) covb corrb;
lsmeans frt/ pdiff=all adjust=tukey LINES;
run;
Error: Only CLASS variables allowed in this effect.
Is it because we added cov, which is already LS means of covariances?
Thanks Steve!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.