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

I've just starting to dig into GLIMMIX for the first time, but I'm have a little trouble figuring out how to specify within what is considered a subsample. For instance, in GLM I could use this example with two subsamples per plot:

DATA test;

   INPUT plot trt $ response;

   DATALINES;

1    Control    0

1    Control    1

2    Control    1

2    Control    2

3    Control    0

3    Control    1

4    Control    1

4    Control    2

5    Treated    3

5    Treated    4

6    Treated    4

6    Treated    5

7    Treated    4

7    Treated    5

8    Treated    2

8    Treated    3

;

proc glm data=test;

class plot trt;

model response=trt plot(trt);

test h=trt  e=plot(trt);

title 'One way CRD w/subsample';

quit;

Without specifying that subsampling occurred here, the F-value for trt = 60.50. The output from the test statement accounting for the subsampling results in an adjusted F-value of 24.20 for the trt effect. How would I replicate this in PROC GLIMMIX though? The following statement:

proc glimmix data=test;

class plot trt;

model response=trt plot(trt);

title 'GLIMMIX one-way CRD w/subsample';

run;

gives an F-value of 60.50 again for the trt effect. I realize I could just average the subsamples manually in this example, but I'd like to be able to specify this explicitly in the procedure so I'm forced to learn a bit for future more complex analyses. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

In GLIMMIX, you do not put random effects in the model statement. You use one or several random statements. To get started, try:

proc glimmix;

class plot trt;

model response = trt;

random plot(trt);

run;

The beauty of MIXED and GLIMMIX is that one does not have to set up any explicit tests because the procedures figure things out if the random effects are specified correctly. I highly recommend you get a copy of SAS for Mixed Models, 2nd edition (2006). This will make things clearer.

View solution in original post

1 REPLY 1
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

In GLIMMIX, you do not put random effects in the model statement. You use one or several random statements. To get started, try:

proc glimmix;

class plot trt;

model response = trt;

random plot(trt);

run;

The beauty of MIXED and GLIMMIX is that one does not have to set up any explicit tests because the procedures figure things out if the random effects are specified correctly. I highly recommend you get a copy of SAS for Mixed Models, 2nd edition (2006). This will make things clearer.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 1 reply
  • 1914 views
  • 0 likes
  • 2 in conversation