08-09-2017 06:16 AM
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?
08-09-2017 11:51 AM
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?
08-09-2017 11:57 AM
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 ;
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
08-09-2017 12:02 PM
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)
08-09-2017 05:47 PM
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:
1,2,3 = '1'
4,5,6 = '2'
7,8,9 = '3'
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".