Programming the statistical procedures from SAS

Degrees of freedom in proc Mixed

Accepted Solution Solved
Reply
Contributor
Posts: 67
Accepted Solution

Degrees of freedom in proc Mixed

[ Edited ]

 Hi All 

I'm using proc mixed for my dataset today, and everything was fine except degrees of freedom of tow variables were wrong, I don't know where was my mistake, and I got this error. 

 

WARNING: Class levels for herd are not printed because of excessive size.
WARNING: Class levels for COW_ID are not printed because of excessive size.
ERROR: Integer overflow on computing amount of memory required. A request to allocate the memory
cannot be honored.
ERROR: The SAS System stopped processing this step because of insufficient memory.
NOTE: PROCEDURE MIXED used (Total process time):
real time 41.95 seconds
cpu time 12.93 seconds

 

 this error caused by code 2. Code 1 was good but degrees of freedoms were 1 for both (herd and cow_id) variables. but infact the number of cow_id and herd are more than a thousand!!! 

 

 

and this is my codes 

code 1 

proc sort data = fatd;
by time; run;
PROC MIXED DATA = fatd;
class pr CAMONTH CALVING_EASE ;
model A = HERD COW_ID PR CALVING_EASE CAMONTH CAYEAR / S ;
LSMEANS PR CAMONTH ;
RUN;


code 2 
proc sort data = fatd;
by time; run;
PROC MIXED DATA = fatd;
class pr CAMONTH CALVING_EASE  HERD COW_ID ;
model A = HERD COW_ID PR CALVING_EASE CAMONTH CAYEAR / S ;
LSMEANS PR CAMONTH  HERD COW_ID ;
RUN;

 thses results pf degrees of freedom from code 1, code 2 gaving error !!

 

 

1  for herd   and suppose to be more than 1 

1    for cow_id also suppose to be more than 1 

3  for camonth

2  for calving_ease

3 for pr 

1 for cayear  

these are the fd of my data 

kind regards 

 


Accepted Solutions
Solution
4 weeks ago
PROC Star
PROC Star
Posts: 401

Re: Degrees of freedom in proc Mixed

[ Edited ]

I imagine that cows are nested within herds, and I also imagine that herds and cows might be random effects factors rather than fixed effects factors. If you would like more input from the Community, please provide a more detailed description of your study, including the definitions of your factors and your research questions. An example of your data set would also be helpful; if you don't want to share the actual data, you can replace A values with something nonsensical.

 

How many different HERDs do you have? How many different COW_IDs?

 

I notice that you are sorting by time, but time is not included in your model. Is that your intent?

 

You may also have repeated measures on each cow, but again we would need more detail.

 

I recommend that you study SAS® for Mixed Models, Second Edition, it is an excellent resource.

 

 

View solution in original post


All Replies
Solution
4 weeks ago
PROC Star
PROC Star
Posts: 401

Re: Degrees of freedom in proc Mixed

[ Edited ]

I imagine that cows are nested within herds, and I also imagine that herds and cows might be random effects factors rather than fixed effects factors. If you would like more input from the Community, please provide a more detailed description of your study, including the definitions of your factors and your research questions. An example of your data set would also be helpful; if you don't want to share the actual data, you can replace A values with something nonsensical.

 

How many different HERDs do you have? How many different COW_IDs?

 

I notice that you are sorting by time, but time is not included in your model. Is that your intent?

 

You may also have repeated measures on each cow, but again we would need more detail.

 

I recommend that you study SAS® for Mixed Models, Second Edition, it is an excellent resource.

 

 

Contributor
Posts: 67

Re: Degrees of freedom in proc Mixed

Thanks Sld 

 

Yes I changed that herd variable from fixed effect to the random effect and the cow_id removed from the model, the reason was because of the memory not enough to figure that out  and it giving a warning with error.  

 

 

in my data I have more than 5000 herds and more than one million cows. 

 

Thank you so much for these information

 

best regards  

PROC Star
PROC Star
Posts: 401

Re: Degrees of freedom in proc Mixed

You might be able to use the HPMIXED procedure

 

The HPMIXED Procedure

 

It's designed for large linear mixed model problems.

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 94 views
  • 2 likes
  • 2 in conversation