Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Stata drops the wrong level from regression using factor variables


From   Nichole Szembrot <[email protected]>
To   [email protected]
Subject   st: Stata drops the wrong level from regression using factor variables
Date   Tue, 20 Aug 2013 14:33:13 -0400

I am having trouble getting Stata to omit the base level when I
include a factor variable with 2 levels in a regression. Instead of
dropping the base level, which I set using fvset, it includes the base
level then has to drop the level that I want to include due to
collinearity.

Here is the part of the code that creates the factor variable causing
the problem:

gen byte risk_averse = 1;
replace risk_averse = 2 if risk_preference == 5 | risk_preference == 6;
fvset base 1 risk_averse;

This is the code that I use:

reg voteVague_binary ibn.Treatment#ibn.RoundTypebyte
i.risk_averse#ibn.Treatment copy_indicator if contaminated==0
    & practice==0, noconstant vce(cluster id);

The first set of interactions, with all levels of Treatment interacted
with all levels of RoundTypebyte, works as it is supposed to. However,
instead of including a dummy for risk_averse=2 interacted with each
level of the Treatment variable, it includes a dummy for risk_averse=1
(the base level) and does not include the interactions that I actually
want.

I have even tried this, in an effort to force it to include the dummy
for level 2:

reg voteVague_binary  ibn.Treatment#ibn.RoundTypebyte
2.risk_averse#1.Treatment 2.risk_averse#2.Treatment
2.risk_averse#3.Treatment copy_indicator if contaminated==0 &
practice==0, noconstant vce(cluster id);

This generates the same result as the first one. Any ideas?
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index