- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
532 ;
533 run;
534 Proc glimmix Data =Waterford;
535 class frt ph week;
536 model ph = frt week frt*week;
537 random week/subject=frt type=ar(1) residual;
538 lsmeans frt*week / Adjust = Tukey lines slicediff= week;
539 output out=second predicted=pred residual=resid residual(noblup)=mresid student=studentresid student(noblup)=smresid;
540 run;
ERROR: Least-squares means are not available for the multinomial distribution.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.SECOND may be incomplete. When this step was stopped there were 0 observations and 0 variables.
NOTE: PROCEDURE GLIMMIX used (Total process time)
Does that mean the data is not normally distributed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
WARNING: Mixed model has saturated mean and profiled variance. Fit does not proceed.
It the data being interpolated? It seems like I have high-variance data, and it's not a good fit... ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!