BookmarkSubscribeRSS Feed
Ameurgen
Obsidian | Level 7

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

 

 

5 REPLIES 5
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Ameurgen
Obsidian | Level 7

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_IDDam_Birth_dateDam_Date_CalvingDam_Days_in_MilkDam_Lact_NoCow_Lact_NO
902906716/06/200917/07/20114815
919967525/05/200904/07/201118815
902906916/07/200817/07/20114925
912468613/09/200807/09/20117225
948787714/06/201021/07/20126915
941004219/05/201012/06/20124515
973240408/01/201005/03/20139125
PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
Ameurgen
Obsidian | Level 7

oh, ok,  it is a numeric variable 

Thank you

DamRegistrationIdChar18$18.  
Dam_Birth_dateNum8YYMMDD10.  
Dam_CLV_MoNum8   
Dam_Date_CalvingNum8YYMMDD10.  
Dam_Days_in_MilkNum8   

*

PaigeMiller
Diamond | Level 26

So you just add the date variable into your model.

--
Paige Miller
How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1280 views
  • 0 likes
  • 2 in conversation