# Re: st: how to adjust for covariates?

 From Maarten buis <[email protected]> To [email protected] Subject Re: st: how to adjust for covariates? Date Mon, 11 Jan 2010 14:29:12 +0000 (GMT)

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