Statalist


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

st: R: combine indicator values


From   "Carlo Lazzaro" <[email protected]>
To   <[email protected]>
Subject   st: R: combine indicator values
Date   Mon, 23 Nov 2009 09:51:14 +0100

Nick wrote:

<... after I combined them into 1 variable...>

I'm not very clear with the aim of Nick's research, but, as far as the above
reported sentence in concerned, Nick might want to try: 
--------------------------------------------------------------------
set obs 10
g id=_n
g child_1=1 in 2/6
replace  child_1=0 if  child_1==.
g child_2=1 in 7/8
replace   child_2=0 if   child_2==.
g child_3=1 in 9/10
replace   child_3=0 if   child_3==.
egen grand_child=rowtotal( child_1 child_2 child_3)
-------------------------------------------------------------------

Kind Regards,
Carlo
-----Messaggio originale-----
Da: [email protected]
[mailto:[email protected]] Per conto di Nikolaos Pandis
Inviato: lunedì 23 novembre 2009 9.13
A: [email protected]
Oggetto: st: combine indicator values

Hi to all.

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.

Any advise would be appreciated.

Many thanks,

Nick


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