Thanx all, I found my answer. I prefer Peter's second solution.


On Tue, Feb 26, 2013 at 11:59 PM, Berend Hasselman <bhh@xs4all.nl> wrote:

>
> On 26-02-2013, at 18:45, Tasnuva Tabassum <t.tasnuva@gmail.com> wrote:
>
> > I have a vaiable named NAM having value : 1,2,3,4,5,6,7,8,9.  I want to
> > make an indicator variable that will take value 1 if NAM=7 or NAM=8 or
> > NAM=9. How can I do that?
> > I usually do: Var001<- ifelse(NAM==7,1,0) for the simplest case.
>
>
> How about
>
> Var001<- ifelse(NAM>=7 &  NAM<=9,1,0)
>
>
> Berend
>

	[[alternative HTML version deleted]]

