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]

RE: st: Replace with missing value


From   André Gyllenram <a_gyllenram@hotmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Replace with missing value
Date   Fri, 12 Apr 2013 14:10:28 +0200

Hello,

Thank you for your answer. But i realized that i was not very clear in my first post. Sorry about that.

What i want to do is that i want to compute the variance for different periods and stocks. The problem I have is that stata does not consider missing values when computing the variance.

If i write the code:

by isin: egen variance20001230=var(price) if datum>=20000101 & datum< 2000123
0

this gives me the 1-year variance for every stock between 200010101 and 20001230. However it does not consider missing values. If i have any missing values in the price -data for any stock in the time period  20000101-20001230 i want to set the variace for that stock equal to missing.

Maybe this problem is easier to solve?

Regards 
André 		 	   		  
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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