Statalist


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

Re: st: event history analysis for multiple response and repeated events


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   Re: st: event history analysis for multiple response and repeated events
Date   Fri, 6 Mar 2009 22:22:07 +0100

<>

Attach the "if cnt==484" to the other conditions. The way it is set up now it checks for the first observation only...

HTH
Martin
_______________________
----- Original Message ----- From: "fernando andrade" <[email protected]>
To: <[email protected]>
Sent: Friday, March 06, 2009 10:19 PM
Subject: Re: st: event history analysis for multiple response and repeated events


Hi
i am new using stata, i am having problems with this simple loop uisng if.

gen grade=.

if cnt==484{
replace grade = 1 if SC04Q01 == 1 & SC04Q02 == 1 & SC04Q03 == 1 &
SC04Q04 == 1 & SC04Q05 == 1 & SC04Q06 == 1 & SC04Q07 == 0 & SC04Q08 ==
0 & SC04Q09 == 0 & SC04Q10 == 0 &/// SC04Q11 == 0 & SC04Q12 == 0
 replace grade = 2 if SC04Q01 == 0 & SC04Q02 == 0 & SC04Q03 == 0 &
SC04Q04 == 0 & SC04Q05 == 0 & SC04Q06 == 0 & SC04Q07 == 1 & SC04Q08 ==
1 & SC04Q09 == 1 & SC04Q10 == 0 &///  SC04Q11 == 0 & SC04Q12 == 0
replace grade = 3 if SC04Q01 == 0 & SC04Q02 == 0 & SC04Q03 == 0 &
SC04Q04 == 0 & SC04Q05 == 0 & SC04Q06 == 0 & SC04Q07 == 0 & SC04Q08 ==
0 & SC04Q09 == 0 & SC04Q10 == 1 &/// SC04Q11 == 1 & SC04Q12 == 1
}

the replace commands work well without the loop, it makes the
transformations in all the data set.
but i want to restrict the transformations to only those who have a
value of 484 in cnt.

any ideas why the loop is not working

thank you very much
fernando
*
*   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