# st: dummy trapped but not sure why

 From bdeaton@uoguelph.ca To statalist@hsphsun2.harvard.edu Subject st: dummy trapped but not sure why Date Wed, 23 May 2007 17:16:48 -0400

Greetings,

I am dummy trapped but I'm not sure why.

I am generating state dummy variables (13) for each of 1,000 counties in my data set. In addition, I am generating a variable: intest2 that assigns a unique number to counties within a group of states. (For example, each observation within three states might receive the # 100, the observations within another three states might receive the number 50, etc.) The unit of observation is a county. Each state has well over 20 observations.

When I regress the dependent variable (which is continuous) on n-1 (i.e.,12) state dummy variables and the intest2 variable, I fall into the dummy variable trap. Empirically, I am fairly confident that this is what the program is telling me. Conceptually, however, I'm not sure why this is the case.

Any thoughts? I've included some of my commands in the hope that they may be useful to a potential problem solver:

gen STAL = (state == "AL")
gen STGA = (state == "GA")
gen STKY = (state == "KY")
gen STMD = (state == "MD")
gen STMS = (state == "MISS")
gen STNC = (state == "NC")
gen STOH = (state == "OH")
gen STPA = (state == "PA")
gen STTN = (state == "TN")
gen STVA = (state == "VA")
gen STWV = (state == "WV")
gen STNY = (state == "NY")
gen STSC = (state == "SC")

gen intest2 = 100 if state == "OH" | state == "VA" | state == "WV"
replace intest2 = 50 if state == "AL"| state == "KY" | state == "MD" | state == "NY"| state == "PA" | state == "SC"
replace intest2 = 33 if state == "GA" | state == "NC" | state == "TN"
replace intest2 = 25 if state == "MISS"

regress Y intest2 STAL STGA STKY STMD STNC STOH STPA STTN STVA STNY STSC STWV

<<<this regression exhibits perfect collinearity but I'm not sure why>>>

Many thanks,

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/