Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re: st: binary indicator for differing subsets of variables [SEC=UNCLASSIFIED]
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: Re: st: binary indicator for differing subsets of variables [SEC=UNCLASSIFIED]
Date
Fri, 9 Sep 2011 00:55:46 +0100
I didn't read your previous carefully enough. With just start and end
date variables you could do this
gen myindicator = 0
unab LFS : LFS*
local LFS : subinstr local LFS "LFS" "", all
qui foreach v of local LFS {
replace myindicator = myindicator + LFS`v' if inrange("`v'", date1, date2)
}
replace myindicator = myindicator == 6
On Fri, Sep 9, 2011 at 12:35 AM, Fry, Jane <[email protected]> wrote:
> Thanks Nick -- after I set up the intervening date variables (as I only had
> the start and end set up before) this worked a treat!!!
>
> Very grateful for your help.
>
> Cheers,
> Jane.
>
>
>
> Important Notice
>
> This e-mail and attachments (if any) is intended for the original addressee only.
> If you are not the intended recipient, any use or dissemination of this communication is prohibited.
> Please advise the sender by return e-mail and delete this e-mail.
>
> *
> * 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/