Statalist


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

R: st: combine indicator values


From   "Carlo Lazzaro" <carlo.lazzaro@tin.it>
To   <statalist@hsphsun2.harvard.edu>
Subject   R: st: combine indicator values
Date   Mon, 23 Nov 2009 12:18:15 +0100

Nick wrote:

<..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
..>

Nick is seemingly drifting away from his original query.
If Nick plugs in the model the child_123 var as he reported, he seems to
leave the logistic regression framework in favour of the Poisson one (that
is, he replaces binary response with count data).
Hence, if this is the case, I take the liberty to recommend Nick to spend
some time (re)thinking over the aim of his research and come back to the
Statalist.

Kind Regards,
Carlo
-----Messaggio originale-----
Da: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di Nikolaos Pandis
Inviato: lunedì 23 novembre 2009 11.49
A: statalist@hsphsun2.harvard.edu
Oggetto: 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 <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/



*
*   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