hello sas community;
i am runing a mixed model and i need to add a variable"date of birth" as a regression effect because we dont need a single effect from date of birth but we need a trend effect for for genetic and phenotypic purpose.
So, if one of you have a same issue can help me.
Thank you
If I am understanding you properly, if you want a "trend" then you need to make date_of_birth to be a numeric variable and it should be added into the model. If it currently is not a numeric variable, you would have to create a new numeric variable via the INPUT function — but the exact details of how to do this depend on you providing an example or two of the values of date_of_birth.
Hello Paige Miller ,
Thank for your reply,
can you please , give me more detail how you understanding because , i dont get it , you just propose to change the format of variable to be incorporete in model as a regression effect (on effect).
find below an example of my data
Thank you
ANM_ID | Dam_Birth_date | Dam_Date_Calving | Dam_Days_in_Milk | Dam_Lact_No | Cow_Lact_NO |
9029067 | 16/06/2009 | 17/07/2011 | 48 | 1 | 5 |
9199675 | 25/05/2009 | 04/07/2011 | 188 | 1 | 5 |
9029069 | 16/07/2008 | 17/07/2011 | 49 | 2 | 5 |
9124686 | 13/09/2008 | 07/09/2011 | 72 | 2 | 5 |
9487877 | 14/06/2010 | 21/07/2012 | 69 | 1 | 5 |
9410042 | 19/05/2010 | 12/06/2012 | 45 | 1 | 5 |
9732404 | 08/01/2010 | 05/03/2013 | 91 | 2 | 5 |
I did not propose a change of format. I said you might need to change the variable type from character to numeric, if it is character right now. And I can't tell from your data if it is character or numeric. Can you please tell me what PROC CONTENTS says about the type of this variable?
oh, ok, it is a numeric variable
Thank you
DamRegistrationId | Char | 18 | $18. | ||
Dam_Birth_date | Num | 8 | YYMMDD10. | ||
Dam_CLV_Mo | Num | 8 | |||
Dam_Date_Calving | Num | 8 | YYMMDD10. | ||
Dam_Days_in_Milk | Num | 8 |
*
So you just add the date variable into your model.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.