Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: combine indicator values


From   Nikolaos Pandis <npandis@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: combine indicator values
Date   Mon, 23 Nov 2009 02:48:51 -0800 (PST)

I would like to thank everybody for the postings.

Marten,
If I only enter child2 and child3 (independent variables) in the model how would child1 be used as a reference for child2 and child3? Perhaps, I am not understanding correctly how this works. Would the following command:

logistic depvar child2 child3 otherindepvar

use child1 as the reference?

If I combine the dummy vars (child 1, child2, child3) I would like the new var child_123   to look like:

id     child_123
1        1
2        1
3        1 
4        3
5        2 
6        1
7        3
8        2 
9        1
10       3

In other words, I would like to have one variable that specifies for each id the corresponding level for the var child123. Reference category would be child123==1.


Many thanks,
Nick  


--- On Mon, 11/23/09, Maarten buis <maartenbuis@yahoo.co.uk> wrote:

> From: Maarten buis <maartenbuis@yahoo.co.uk>
> Subject: Re: st: combine indicator values
> To: statalist@hsphsun2.harvard.edu
> Date: Monday, November 23, 2009, 11:56 AM
> --- On Mon, 23/11/09, Nikolaos Pandis
> wrote:
> > I have the following binary (0,1) variables:
> > 
> > child1, child2 child3
> > 
> > They indicate if the family has or not 1, 2, 3+
> children
> > respectively.
> > 
> > I would like to enter them in a logistic model using
> the xi
> > commnad and child1 as reference, after I combined them
> into
> > 1 variable.
> 
> -xi- is fine as a convenience command, but the convenience
> is
> that you don't have to create the binary variables. In
> this
> case you already have the binary variables, and -xi- is
> actually
> an "inconvenience command". I would just forget about -xi-
> and 
> add the variables child2 and child3 to your logistic model,
> this 
> will do exactly what -xi- would otherwise do.
> 
> Hope this helps,
> Maarten 
> 
> --------------------------
> 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/



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