Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Degrees of freedom in proc Mixed

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

a month ago - last edited a month ago

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Barkamih

4 weeks ago - last edited 4 weeks ago

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.

All Replies

Solution

4 weeks ago

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Barkamih

4 weeks ago - last edited 4 weeks ago

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

4 weeks ago

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Barkamih

4 weeks ago

You might be able to use the HPMIXED procedure

It's designed for large linear mixed model problems.