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: st: Create a Dummy Based on Standard Deviation
From 
 
Nick Cox <[email protected]> 
To 
 
[email protected] 
Subject 
 
Re: st: Create a Dummy Based on Standard Deviation 
Date 
 
Tue, 11 Sep 2012 07:47:10 +0100 
This sounds like a strange idea: you have precise information on a
variable, so why not use it?
But the Stata syntax could be something like
gen within = inrange(X, 14, 22)
See also
SJ-6-4  dm0026  . . . . . . Stata tip 39: In a list or out? In a range or out?
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
        Q4/06   SJ 6(4):593--595                                 (no commands)
        tip for use of inlist() and inrange()
Nick
On Tue, Sep 11, 2012 at 4:43 AM, Shan Ghimire <[email protected]> wrote:
> I have a panel data on 'X', say i=100 and t=5, giving N = 500, with mean=18 and sd = 4. Now, I want to create a dummy variable 'Y' for each observation where Y =1 {if the observation 'X' is within 1 standard deviation from the mean of X}, otherwise give it a value 0.
*
*   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/