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]

From |
Sarah Elizabeth Edgington <sedging@ucla.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Strange Behaviour When Selecting Levels For Factor Variables In Regression With i# |

Date |
Fri, 18 Jan 2013 22:12:53 -0800 |

-Sarah At 08:32 PM 1/18/2013, you wrote:

Daniel, The definition of a coefficient in a multiple regression model includes the list of all the other predictors in the model. Thus, using a different predictor for sex changes the definitions of the coefficients for patient and the categories of when. If the other predictors were orthogonal to sex, the numerical values of their coefficients would not differ among the models, even though the definitions were not the same. Your models may be equivalent, in the sense that they have the same predicted values and the same residuals, but they are not all the same model. I hope this discussion helps. David Hoaglin On Fri, Jan 18, 2013 at 6:45 PM, <daniel56061-stata@yahoo.de> wrote: > Hello, >> when i use indicator i with selecting level of a factor variablelike 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 shouldestimate the same model and should give same results except forvariable sex cause all I do is demand an indicator for a differentlevel of a 2-level variable sex.> But if I run these lines I get three regressions with threedifferent coefficients for the variable "when" and "patient" even Ididnt 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/

* * 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/

**Follow-Ups**:**Re: st: Strange Behaviour When Selecting Levels For Factor Variables In Regression With i#***From:*David Hoaglin <dchoaglin@gmail.com>

**Re: st: Strange Behaviour When Selecting Levels For Factor Variables In Regression With i#***From:*Richard Williams <richardwilliams.ndu@gmail.com>

**References**:**st: Strange Behaviour When Selecting Levels For Factor Variables In Regression With i#***From:*daniel56061-stata@yahoo.de

**Re: st: Strange Behaviour When Selecting Levels For Factor Variables In Regression With i#***From:*David Hoaglin <dchoaglin@gmail.com>

- Prev by Date:
**st: FGNLS estimator** - Next by Date:
**Re: st: Strange Behaviour When Selecting Levels For Factor Variables In Regression With i#** - Previous by thread:
**Re: st: Strange Behaviour When Selecting Levels For Factor Variables In Regression With i#** - Next by thread:
**Re: st: Strange Behaviour When Selecting Levels For Factor Variables In Regression With i#** - Index(es):