I have field data of observations like pest count and yield for six treatments and four replications; each at four locations. I need to analyze the data by using the procedure GLM mixed of SAS, where each location/experimental site is considered as a particular environment for the combined analysis. Kindly help me with the code for analysis.
I need to do Combined analyses of GLM mixed, where we calculate the effect of Location, Treatment, LocationxTreatment.
Thanks. I see you have switched to PROC GLIMMIX, you might want to update your original post to reflect this.
proc glimmix data=IMPORT;
class TRT REP LOC;
model LHC = TRT REP LOC LOC*TRT / solution ddfm=kr;
random LOC;
run;
Your words (quoted above) do not indicate that REP is in the model, and perhaps it should not be there anyway. But that depends on what REP really means and how you want it to be used in the model. If it indicates a replicate observation under identical conditions, I would not put REP in the model. But that's a decision you have to make, I can't make that decision, as you have not explained what REP is or how it should be used.
"Analyze data using PROC GLM"
Honestly, that's not specific enough, GLM can perform many different analyses, what analysis do you want to perform? What hypotheses do you want to test? Show us what SAS code you have tried so far.
Also, no one here will analyze data in a PDF file. Data must be in SAS data sets (following these instructions), provided as text. We don't need the entire data set, a representative portion is fine.
TRT | REP | LOC | LHC |
1 | 1 | 1 | 4.541 |
2 | 1 | 1 | 4.341 |
3 | 1 | 1 | 4.671 |
4 | 1 | 1 | 3.971 |
5 | 1 | 1 | 3.811 |
6 | 1 | 1 | 4.313 |
1 | 2 | 1 | 5.404 |
2 | 2 | 1 | 4.129 |
3 | 2 | 1 | 4.468 |
4 | 2 | 1 | 4.115 |
5 | 2 | 1 | 4.132 |
6 | 2 | 1 | 4.047 |
1 | 3 | 1 | 5.200 |
2 | 3 | 1 | 3.747 |
3 | 3 | 1 | 4.322 |
4 | 3 | 1 | 3.837 |
5 | 3 | 1 | 3.838 |
6 | 3 | 1 | 4.395 |
1 | 4 | 1 | 4.641 |
2 | 4 | 1 | 4.202 |
3 | 4 | 1 | 4.850 |
4 | 4 | 1 | 4.176 |
5 | 4 | 1 | 4.109 |
6 | 4 | 1 | 4.299 |
1 | 1 | 2 | 5.544 |
2 | 1 | 2 | 4.655 |
3 | 1 | 2 | 5.001 |
4 | 1 | 2 | 4.577 |
5 | 1 | 2 | 4.437 |
6 | 1 | 2 | 5.162 |
1 | 2 | 2 | 5.817 |
2 | 2 | 2 | 4.543 |
3 | 2 | 2 | 5.165 |
4 | 2 | 2 | 4.859 |
5 | 2 | 2 | 4.299 |
6 | 2 | 2 | 4.952 |
1 | 3 | 2 | 5.903 |
2 | 3 | 2 | 4.904 |
3 | 3 | 2 | 5.512 |
4 | 3 | 2 | 4.367 |
5 | 3 | 2 | 4.174 |
6 | 3 | 2 | 5.009 |
1 | 4 | 2 | 5.706 |
2 | 4 | 2 | 4.903 |
3 | 4 | 2 | 5.396 |
4 | 4 | 2 | 4.643 |
5 | 4 | 2 | 4.516 |
6 | 4 | 2 | 5.150 |
I need to do Combined analyses of GLM mixed, where we calculate the effect of Location, Treatment, LocationxTreatment.
Thanks. I see you have switched to PROC GLIMMIX, you might want to update your original post to reflect this.
proc glimmix data=IMPORT;
class TRT REP LOC;
model LHC = TRT REP LOC LOC*TRT / solution ddfm=kr;
random LOC;
run;
Your words (quoted above) do not indicate that REP is in the model, and perhaps it should not be there anyway. But that depends on what REP really means and how you want it to be used in the model. If it indicates a replicate observation under identical conditions, I would not put REP in the model. But that's a decision you have to make, I can't make that decision, as you have not explained what REP is or how it should be used.
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!
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.