Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

SV: st: treating a categorial variable as a set of dummies in a "glm


From   "Lassen, Peter, pla" <PLA@kl.dk>
To   <statalist@hsphsun2.harvard.edu>
Subject   SV: st: treating a categorial variable as a set of dummies in a "glm
Date   Fri, 21 Feb 2003 08:45:35 +0100

Hello Joseph

I think it's the -xi: glm...
How does it work?

Peter

-----Oprindelig meddelelse-----
Fra: Joseph Coveney [mailto:jcoveney@bigplanet.com]
Sendt: 20. februar 2003 16:40
Til: Statalist
Emne: Re: st: treating a categorial variable as a set of dummies in a
"glm


Peter Lassen posted:

> I believe there is an easy way to treat a nominal variable as a set of
> dummies in a glm-command.

> Let's say i have the following: glm Y X1 X2 X3, family(binom) link(logit)

> and the X3-variable is a numeric categorical variable, which have to be
> treaten as a set of dummies.

> Off cause I  can create 4 new dummies, and use those instead of the X3,
> but ithink there is an easier way of doing that?

Do you mean something like -xi: glm Y X1 X2 i.X3, family(binomial) link(logit)-?

Or did you want the linearly dependent complete set, as produced by -tabulate X3, 
generate(dummy)-?

Joseph Coveney

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index