Statalist


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

AW: st: combine indicator values


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   AW: st: combine indicator values
Date   Mon, 23 Nov 2009 11:55:18 +0100

<> 

I am still baffled by the problem description - is this a data management
question or are you asking a question about -logistic-? Anyway, "child_123"
could be constructed as easily as


*************
gen byte child_123=child1+child2+child3
*************

-egen, rowtotal()-, as recommended earlier, is an obvious extension which
allows you to specify a -varlist-. Also see NJC`s
http://www.stata-journal.com/article.html?article=pr0046


HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Nikolaos Pandis
Gesendet: Montag, 23. November 2009 11:49
An: [email protected]
Betreff: Re: st: combine indicator values

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 <[email protected]> wrote:

> From: Maarten buis <[email protected]>
> Subject: Re: st: combine indicator values
> To: [email protected]
> 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/


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index