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: Strange Behaviour When Selecting Levels For Factor Variables In Regression With i#
From
[email protected]
To
[email protected]
Subject
st: Strange Behaviour When Selecting Levels For Factor Variables In Regression With i#
Date
Fri, 18 Jan 2013 23:45:16 +0000 (GMT)
Hello,
when i use indicator i with selecting level of a factor variable like i1.varname to run a regression I get strange results.
For example:
sysuse blong,clear
regress bp i.sex i.when c.patient i.when#c.patient
regress bp i1.sex i.when c.patient i.when#c.patient
regress bp i0.sex i.when c.patient i.when#c.patient
This regression is wihout sense but theoretically it should estimate the same model and should give same results except for variable sex cause all I do is demand an indicator for a different level of a 2-level variable sex.
But if I run these lines I get three regressions with three different coefficients for the variable "when" and "patient" even I didnt change anything that should be related to these variables.
Whats wrong here?
regards
Daniel
*
* 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/