BookmarkSubscribeRSS Feed
farag
Calcite | Level 5

Hi there,

I have categorical variable (month)  and I am using proc mixed and I got the output for the parameter estimates for the 12 months in the year.

 

12 estimates are many and there are some similar positave and negative estimates that I want to combine or merge them in smalle number of estimates . My questions is how can I combine these similar estimates please?

 

there are 3 groups of similar estimates in the proc mixed outputs .

 

 

any help please?

 

regards,

Farg.

4 REPLIES 4
ballardw
Super User

As a minimum show the proc code. That way we at least have the varaible names and what role they play in the model.

 

Do you want to combine the estimates post model or create groups of values in the input to reduce the number of output estimates?

farag
Calcite | Level 5

Hi Ballardw,

 

this is my code

 

proc mixed data=corrected_2014 noinfo noclprint noitprint METHOD=MIVQUE0;
           class TEST_DATE PARITY CALVING_EASE CALVING_DATE County COW_ID herd_id camonth season ;
           model TEST_DAY_PROT_PERCENT= TEST_DAY_MILK_KG TEST_DAY_FAT_PERCENT PARITY CALVING_EASE County              camonth season log_scc TEST_DAY_LACTOSE_PERCENT/ddfm=bw s ;
          random INT /SUB=herd_id ;
       
run;

 

and also I am interested in the nested effect for cow_id nested in herd_id ,however when I use random statement

 random int/sub=COW_ID(herd_id) ;

I will have insufficient memory problem. any help to get outputs for nested effect without memory problem or a way of creating output data.?

I have big data around 6000 herds and 550000 cows

regards,

Farg

farag
Calcite | Level 5

Hi Barraldw,

 

my target is  to reduce the number of output estimates . for example 4 estimate for season variable instead of 12 estimates (season here is month in my data)

 

regards,

Farg

ballardw
Super User

A format is one way to create groups without having to add variables to data set. Assuming your "season" variable has values of 1 to 12 and is numeric since you say season is month valued something like this:

 

proc format;

value season_4grp

1,2,3 = '1'

4,5,6 = '2'

7,8,9 = '3'

10,11,12='4'

;

run;

 

and then add the statement to use the format:

Format season season_4grp. ;

to the model code. The season variable will then be grouped with results on the format. If the months are 1=January to 12=December you might want to group them such as 12,1,2 = 'Winter' 3,4,5='Spring' etc. One nice thing about the format approach is you can create a number of formats and only change the applied format to get different grouping. You decide that 3 groups of 4 makes more sense, or even having different numbers of months in the groups. You could even have a group of month = 9,10, 3,4 for "cool weather" compared to month 5,6,7,8 for "hot".

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
  • 4 replies
  • 1253 views
  • 0 likes
  • 2 in conversation