Page 1 of 1

Separate regression based on categorical variable

Posted: Wed Dec 09, 2015 4:53 am
by wsjUNMC
Hi,

I would like to ask if there is any command to run separate regressions based on a categorical variable.

For example, I have a categorical variable GENDER with 1 = male and 0 = female.
I would like to generate a regression only with male data and a separate one only with female data.

Is there a command to do this directly using the same dataset or do I have to manually separate them into two files and run them separately?

Thank you for your clarification.

Re: Separate regression based on categorical variable

Posted: Wed Dec 09, 2015 7:10 am
by startz
smpl if gender=1
ls whatever
smpl if gender=0
ls whatever

Re: Separate regression based on categorical variable

Posted: Wed Dec 09, 2015 10:27 pm
by wsjUNMC
Hi startz,

Thanks for the info. It is running well now :D