Dirk,
See -cond()- function
Regards,
Artur.
Mensaje citado por Dirk Nachbar <[email protected]>:
> I have a syntax question and help would be appreciated. I want to generate a
> dummy if certain conditions apply, but it does not seem to work as the early
> dummy is always 0.
>
> -----------------
> gen early=0
> if sex==1 & (anypen1==1 | anypen2==1 | anypen3==1 | anypen4==1 | anypen5==1)
> &
> age < 65 {
> early=1
> }
> if sex==2 & (anypen1==1 | anypen2==1 | anypen3==1 | anypen4==1 | anypen5==1)
> &
> age < 60 {
> early=1
> }
> ------------------------------
>
> Dirk Nachbar
> Assistant Economist
> Pensim2
> Department for Work and Pensions
> Level 4, The Adelphi
> 1-11 John Adam St
> WC2N 6HT London
> 020 796 22705
> **********************************************************************
> This document is strictly confidential and is intended only for use by the
> addressee.
> If you are not the intended recipient, any disclosure, copying, distribution
> or other
> action taken in reliance of the information contained in this e-mail is
> strictly prohibited.
> Any views expressed by the sender of this message are not necessarily those
> of the Department
> for Work and Pensions.
> If you have received this transmission in error, please use the reply
> function to tell us
> and then permanently delete what you have received.
> Please note: Incoming and outgoing e-mail messages are routinely monitored
> for compliance
> with our policy on the use of electronic communications.
> **********************************************************************
>
>
>
> The original of this email was scanned for viruses by the Government Secure
> Intranet (GSi) virus scanning service supplied exclusively by Energis in
> partnership with MessageLabs.
>
> On leaving the GSi this email was certified virus-free
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/