Presumably here the test should be !inlist(`l', 1, 2, 3, 4, 5)
as !inrange(`l',1,5) allows non-integers through.
Nick
[email protected]
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of
> Scott Merryman
> Sent: 09 February 2006 16:39
> To: [email protected]
> Subject: st: RE: RE: RE: Scoring the SF-12v2
>
>
> Nick,
>
> Thanks a lot. I had looked at -inrange()- (I had tried
> -replace `l' = . if
> != inlist(`l', 1, 2, 3, 4, 5) ) but I did not know about -!inrange()-
>
> Thanks again,
> Scott
>
> > -----Original Message-----
> > From: [email protected] [mailto:owner-
> > [email protected]] On Behalf Of Nick Cox
> > Sent: Thursday, February 09, 2006 10:09 AM
> > To: [email protected]
> > Subject: st: RE: RE: Scoring the SF-12v2
> >
> > I just love the way that the means and
> > SDs of scores based on 1-5 ratings can
> > be quoted to up to 7 significant figures.
> >
> > More seriously, a small point of style
> > that applies to other problems too. A line like
> >
> > replace `l' = . if `l' != 1 & `l' != 2 &`l' != 3 &`l' != 4
> > &`l' != 5
> >
> > can also be written
> >
> > replace `l' = . if !inlist(`l', 1, 2, 3, 4, 5)
> >
> > It's quite easy to miss new Stata functions, which
> > tend to be added without fanfare and documented without
> > detailed examples. -inlist()- and its sibling
> > -inrange()- have been around for a few versions now.
> >
> > Nick
> > [email protected]
> >
>
>
> *
> * 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/
>
*
* 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/