Categorical Dummy Variable Help
Posted: Wed Nov 04, 2009 7:05 pm
Hi,
I am trying to create categorical dummy variables for a variable called "region" in order to see the probability of being poor in these specific regions(such as dum1, dum2, dum3...etc) by using the probit model. Nevertheless, although I tried several different ways, I couldn't find out where I was doing wrong. I would highly appreciate if anyone tells me what my mistake is and how I can fix it. Here is the code;
open poverty.wf1
output(t) poverty.txt
pon
include subs.prg
smpl 1 1937
genr dum1=1 if region=1 else dum1=0
genr dum2=1 if region=2 else dum2=0
genr dum3=1 if region=3 else dum3=0
genr dum4=1 if region=4 else dum4=0
genr dum5=1 if region=5 else dum5=0
genr dum6=1 if region=6 else dum6=0
genr dum7=1 if region=7 else dum7=0
probit poor3e c dum1 dum2 dum3 dum4 dum6 dum7
output off
close poverty.wf1
open poverty.txt
PS:I intentionally left dum5 out in order not to have near singular matrix.
I am trying to create categorical dummy variables for a variable called "region" in order to see the probability of being poor in these specific regions(such as dum1, dum2, dum3...etc) by using the probit model. Nevertheless, although I tried several different ways, I couldn't find out where I was doing wrong. I would highly appreciate if anyone tells me what my mistake is and how I can fix it. Here is the code;
open poverty.wf1
output(t) poverty.txt
pon
include subs.prg
smpl 1 1937
genr dum1=1 if region=1 else dum1=0
genr dum2=1 if region=2 else dum2=0
genr dum3=1 if region=3 else dum3=0
genr dum4=1 if region=4 else dum4=0
genr dum5=1 if region=5 else dum5=0
genr dum6=1 if region=6 else dum6=0
genr dum7=1 if region=7 else dum7=0
probit poor3e c dum1 dum2 dum3 dum4 dum6 dum7
output off
close poverty.wf1
open poverty.txt
PS:I intentionally left dum5 out in order not to have near singular matrix.