BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
NaveenM
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

"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.

--
Paige Miller
NaveenM
Calcite | Level 5
Thanks for replying.
The data set I used is below:
TRTREPLOCLHC
1114.541
2114.341
3114.671
4113.971
5113.811
6114.313
1215.404
2214.129
3214.468
4214.115
5214.132
6214.047
1315.200
2313.747
3314.322
4313.837
5313.838
6314.395
1414.641
2414.202
3414.850
4414.176
5414.109
6414.299
1125.544
2124.655
3125.001
4124.577
5124.437
6125.162
1225.817
2224.543
3225.165
4224.859
5224.299
6224.952
1325.903
2324.904
3325.512
4324.367
5324.174
6325.009
1425.706
2424.903
3425.396
4424.643
5424.516
6425.150
 
I need to do Combined analyses of GLM mixed, where we calculate the effect of Location, Treatment, LocationxTreatment.
 
The SAS code I used is:  LHC = Pest count, TRT = Treatment, REP = Replication, LOC = Location,
 
PROC IMPORT DATAFILE=REFFILE
DBMS=XLSX
OUT=WORK.IMPORT;
GETNAMES=YES;
RUN;
 
PROC CONTENTS DATA=WORK.IMPORT; RUN;
%web_open_table(WORK.IMPORT);
 
proc print data=import;
run;
 
proc glimmix data=IMPORT;
   class TRT REP LOC;
   model LHC = TRT REP LOC / solution ddfm=kr;
   random LOC;
run;
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

SAS Innovate 2025: Register Now

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!

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
  • 3 replies
  • 578 views
  • 2 likes
  • 2 in conversation