Programming the statistical procedures from SAS

Create dummy variable for group

New Contributor
Posts: 3

Create dummy variable for group



I am looking at the interaction between age (dichotomized as above OR below 65 years) and sex (men versus women) on the functional outcomes of therapy. In my model, I would like to insert 3 independent variables: age sex agexsex


While creating the interaction variable, I just created a column of data representing agexsex. Following this, I conducted regression analysis using SAS code:


Proc reg data = Knee_gender_interaction2;
model IADL_6months = age sex agexsex/stb clb;
model functions_6months = age sex agexsex/stb clb;



The problem I run into is that SAS is not allowing me to get the beta estimate for the interaction term agexsex, by suggesting that the age-sex is the linear product of age and sex which are also present in the model. 


I read somewhere that I should create a summy variables to test the effect of all 3 independent variables: age, sex, and agexsex.


Can somebody suggest teh SAS coding for creating the dummay variable and subsequent regression model?


Thank you much.



Super User
Posts: 20,731

Re: Create dummy variable for group

Have you tried proc GLM with CLASS variables?
Regular Learner
Posts: 1

Re: Create dummy variable for group

Did you create your sex indicator as a {0 ,1 } indicator? If not, do so-- and use this new sex indicator to also create your interaction product. Then retry in proc reg.

Valued Guide
Valued Guide
Posts: 684

Re: Create dummy variable for group

Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation