To be more precise: Stata will derive the type of variable (categorical, ordinal, or continuous) for your dependent variable from the type of
estimation command (-logit- for binary, -regress- for continous,
-mlogit- for categorical with more than two categories, -ologit- for
ordered, etc.). You should _not_ add a -i.- to your dependent/explained
variable, if you do you will not get what you want! However, you can
add a -i.- to your independent/explanarory if you think it is a
categorical variable (alternatively, you can create the necesary dummies
manually).
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
--- On Mon, 11/1/10, Maarten buis wrote:
> From: Maarten buis <[email protected]>
> Subject: Re: st: how to adjust for covariates?
> To: [email protected]
> Date: Monday, 11 January, 2010, 13:14
> --- On Mon, 11/1/10, [email protected]
> wrote:
> > I'm doing a SNP analysis using the xi:logistic
> function.
> > To exclude possible confounder, I'm adjusting my
> calculations for
> > different variables, e.g. sex and ethnics.
> > My study population consists of 4 different
> ethnicities, coded as
> > 1 2 3 4. sex is coded 1 2. SNPs are coded 1 2 3 (e.g.
> CC/CT/TT).
> > I don't understand the following:
> >
> > When I calculate:
> >
> > xi:logistic i.snp sex ethnics
> >
> > i get different results to
> >
> > xi:logistic i.snp sex i.ethnics
> >
> > Why is that, and what is the correct way to adjust for
> ethnics, using
> > i.ethnics or just ethnics?
>
> Neither is correct. The problem is your dependent variable:
> it is
> a categorical varialbe with more than 2 categories, so
> -logistic- will
> not work the way you think it does. You should use -mlogit-
> instead.
> The default for Stata is that all variables are continuous
> unless you
> say otherwise, so if you add ethnic it treats that variable
> als a
> continuous variable, which is obviously not what you want,
> so use
> i.ethnic instead.
>
> --------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
>
> http://www.maartenbuis.nl
> --------------------------
>
>
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/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/statalist/faq
* http://www.ats.ucla.edu/stat/stata/