BookmarkSubscribeRSS Feed
Education
Obsidian | Level 7

Hi

 

I am facing some difficulties running a PROC GLIMMIX with my output. The LSMEANS of some of my levels of my fixed effects are giving me a Non-est results. From what i understand it is due to the missing cells from my data set since my experiment was repeated over different seasons and some animals did not work while some did. I read some old posts here where it was indicated that it can be solved by running the mean model (that is the model y= higher interaction of my fixed effects) then run the LSMESTIMATE comparing between levels of each factor. I am struggling with the LSMESTIMATE statement, i am not so familiar with it. Anyone who can help please.

 

Below is the model i am trying to run but without the LSMESTIMATE (Since i do not know how to go about it)

 

PROC GLIMMIX DATA=dataa;
CLASS SEASON DAYS AGE ANIMAL_ID;
MODEL RESPONSE= SEASON*DAYS*AGE/ SOLUTION DDFM=RES;
RANDOM ANIMAL_ID;
RUN; QUIT;

 

I have attached the data set. 

 

I will appreciate your help!

Thank you in advance.

10 REPLIES 10
PaigeMiller
Diamond | Level 26

I'm sorry, but nothing in SAS (or any other statistics software) that will allow you to estimate where there is no data. LSMESTIMATE can't make up data for the cells that have no data.

--
Paige Miller
Education
Obsidian | Level 7

Hi PaigeMiller

 

What model would you suggest for such kind of data that i have, provided i cannot run it the way i thought? Is it a better idea to run main factors without interactions?

 

Thank you

PaigeMiller
Diamond | Level 26

I don't know if it is "better", but you could remove the interactions and fit the model.

 

Or, you can remove from the analysis the levels that have a cell with no data, and then run it with the interaction still in the model. But of course, you lose the information for that level, because you no longer have that level of the variable in the analysis.

 

 

If you want to fit the MEANS model, then you can estimate effects of each cell that has data, and you lose no data, but there is no overall test for interaction now, the overall tests for the main effects are also not present, and of course you still can't estimate anything for the cells that have no data. Maybe this is where the LSMESTIMATE statement comes in.

 

I guess it is your choice which is preferable.

--
Paige Miller
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

At the bottom of this response, I have pasted a table that illustrates the allocation of your observations among factors. The allocation is very uneven, and I suggest that you reconsider how to approach your analysis.

 

Some suggestions and ideas:

 

1. Fix your MODEL statement to include lower-order terms. You should use age|season|days rather than age*season*days. (But this new specification will not fix your problem with missing factor combinations.)

 

2. Fix your RANDOM statement. Animal_ID appears to be nested within levels of Age. Season appears to be a repeated measures on each level of Animal_ID, and Days appears to be repeated measures on each Animal_ID in each Season. Your study design probably is more complex than a simple randomized block design.

 

3. To address your problem with missing factor combinations, think about regressing on Days (and maybe Age):

 

Create a numeric version of the Days factor, numbered 1 to 11. Plot response versus numeric_Days for each Animal_ID within each Season. Is there a systematic pattern that might be addressed with some form of regression model?

 

The advantage of regression is that you don't necessarily need a value for each day, and you don't necessarily need the same set of days for each subject. The disadvantage is that you need a sensible regression form (e.g., linear) either with or without transformation. If a curvilinear (e.g., linear, quadratic) model is not plausible, then it is possible to fit smoothed curves using splines; see https://blogs.sas.com/content/iml/2017/04/19/restricted-cubic-splines-sas.html. But to do this in a mixed model is a complex task.

 

4. The analysis of this study is not straightforward. If there is anyone with statistical expertise at your institution/company with whom you can consult, I would certainly encourage you to do so. 

 

I hope this provides you with some useful directions.

 

Age

3

4

6

10

Animal_ID

Animal_ID

Animal_ID

Animal_ID

A1

A2

A5

A6

A9

A1

A7

A3

A4

A8

N

N

N

N

N

N

N

N

N

N

Season

Days

.

.

1

.

1

1

1

.

1

.

Autumn

D1

D10

.

1

1

.

1

1

1

.

1

.

D11

1

1

1

.

1

1

1

.

1

.

D2

.

.

1

.

1

1

1

.

1

.

D3

.

1

1

.

.

1

1

.

1

.

D4

1

.

1

.

1

1

1

.

1

.

D5

1

1

1

.

1

1

1

.

1

.

D6

.

1

1

.

1

1

1

.

1

.

D7

.

1

1

.

1

1

1

.

1

.

D8

.

.

1

.

1

1

1

.

1

.

D9

.

1

1

.

1

.

1

.

.

.

Spring

D1

.

1

1

1

1

1

.

1

1

1

D10

1

1

1

1

1

1

1

1

1

1

D11

.

.

1

1

1

1

1

1

1

1

D2

1

1

1

.

1

1

1

1

1

1

D3

1

1

1

.

1

1

.

1

1

1

D4

1

1

1

.

1

1

1

1

1

1

D5

1

1

1

.

1

1

1

1

1

1

D6

.

1

1

1

1

1

1

.

1

1

D7

1

.

1

1

1

1

1

1

1

1

D8

.

.

1

1

1

1

1

1

1

1

D9

1

.

1

1

1

1

1

1

1

1

Summer

D1

.

.

1

.

1

1

1

.

1

1

D10

.

.

1

1

1

1

1

.

1

1

D11

1

.

1

1

1

1

1

.

1

1

D2

1

.

1

1

1

1

1

.

1

1

D3

.

1

1

1

1

1

1

.

1

1

D4

1

.

1

1

1

1

1

.

.

1

D5

.

1

1

1

1

1

1

.

1

1

D6

.

1

.

.

1

1

1

.

1

1

D7

.

1

1

1

1

1

1

.

1

1

D8

.

.

1

1

1

1

1

.

1

1

D9

.

1

1

1

1

1

1

.

1

1

Winter

D1

1

1

1

1

.

1

.

1

1

1

D10

.

1

1

.

1

1

1

.

1

1

D11

1

.

1

.

1

1

1

.

1

1

D2

1

1

1

1

1

1

1

.

1

1

D3

1

.

1

1

1

1

1

.

1

1

D4

1

.

1

1

1

1

1

.

1

1

D5

.

.

1

.

1

1

1

1

1

1

D6

1

.

1

.

1

1

1

.

1

1

D7

1

1

1

.

1

1

1

.

1

1

D8

1

1

1

.

1

1

1

.

1

1

D9

1

1

1

1

1

1

1

1

1

1

PaigeMiller
Diamond | Level 26

@sld wrote:

At the bottom of this response, I have pasted a table that illustrates the allocation of your observations among factors. The allocation is very uneven, and I suggest that you reconsider how to approach your analysis.

 

Some suggestions and ideas:

 

1. Fix your MODEL statement to include lower-order terms. You should use age|season|days rather than age*season*days. (But this new specification will not fix your problem with missing factor combinations.)

 


I think somewhere along the way, the original poster was advised to use the means model rather than the effects model, hence the analysis of age*season*days.

 

4. The analysis of this study is not straightforward. If there is anyone with statistical expertise at your institution/company with whom you can consult, I would certainly encourage you to do so. 

 

Yes, good advice. There was a whole book written on situations like this, but unless you sit down and start reading the book and doing the exercises, it still might be a few weeks before the right analysis is determined (it there is such a thing as a "right analysis"). By the time you get to the later chapters, the book covers this specific situation where cells have no data, but I don't think you can just jump right in and start at the chapter on missing cells.

--
Paige Miller
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

@PaigeMiller wrote:


Yes, good advice. There was a whole book written on situations like this, but unless you sit down and start reading the book and doing the exercises, it still might be a few weeks before the right analysis is determined (it there is such a thing as a "right analysis"). By the time you get to the later chapters, the book covers this specific situation where cells have no data, but I don't think you can just jump right in and start at the chapter on missing cells.


 

Good book! Also Milliken and Johnson's Vol III which addresses regression in mixed models. 

 

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

I'll add that the means model (using age*season*days) makes using ESTIMATE and CONTRAST statements easier, but LSMESTIMATE statements work equally well for age*season*days and age|season|days. However, in this study, it is not at all clear to me what hypotheses you would attempt to test with contrasts, regardless of how you went about estimating them (e.g., ESTIMATE or LSMESTIMATE). 

 

 

PaigeMiller
Diamond | Level 26

I agree that I don't really see a need to form contrasts of least squares means in this situation, other than comparing the LSM of level A to the LSM of level B, which can be done easily without resorting to the LSMESTIMATE statement. Typically, a contrast that might be of interest in some studies, which is not simply comparing level A to level B, is, for example LSM Level A = avg (LSM Level B, LSM Level C) and that doesn't seem to apply in this study.

--
Paige Miller
Education
Obsidian | Level 7

Thank you for you assistance and suggestions @PaigeMiller and @sld. I think the best idea is to grab a book and do some reading first. Although it might take time, it might as well be worth it. Then if facing more challenges then i can set an appointment with a statistician for assistance.

 

@sld I will try to run the regression model today. It is important to mention that if i categorize animal age as younger than 5 years old and above 5 years old, the analyses run just fine.

 

Regards,

Education.

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

I like your study philosophy! Feel free to follow up as needed as you go along, and good luck.

 

For mixed models in SAS, SAS for Mixed Models, 2nd ed is a valuable resource; an updated version (SAS® for Mixed Models: An Introduction) may be released soon. 

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 10 replies
  • 3447 views
  • 3 likes
  • 3 in conversation