Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Create a Dummy Based on Standard Deviation


From   Shan Ghimire <shanmire@hotmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Create a Dummy Based on Standard Deviation
Date   Mon, 10 Sep 2012 23:43:52 -0400

Dear Listers,
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. It sounds like it's not too difficult but I am really spending too much time trying to figure it out. Could somebody help me, please? 
Thank you. 
Shan 		 	   		  
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index