Statalist


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

Re: st: dealing with states of knowledge


From   "William Bishop" <[email protected]>
To   [email protected]
Subject   Re: st: dealing with states of knowledge
Date   Wed, 26 Nov 2008 09:14:34 -0800

Thanks, Maarten - so if data looked like the following with the
05jan2001 price thought to be $12 on Jan 5-7, then learned to be $10
on Jan 8, can rolling be used to calculate the ma5day (uses previous 5
days)?

date		price	ma5day	acquired	expired
28dec2000	10	-	28dec2000	-
29dec2000	10	-	29dec2000	-
30dec2000	10	-	30dec2000	-
31dec2000	10	-	31dec2000	-
01jan2001	10	-	01jan2001	-
02jan2001	10	10	02jan2001	-
03jan2001	10	10	03jan2001	-
04jan2001	10	10	04jan2001	-
05jan2001	12	10	05jan2001	07jan2001
05jan2001	10	10	08jan2001	-
06jan2001	10	10.4	06jan2001	-
07jan2001	10	10.4	07jan2001	-
08jan2001	10	10	08jan2001	-




On Tue, Nov 25, 2008 at 11:15 PM, Maarten buis <[email protected]> wrote:
> --- William Bishop <[email protected]> wrote:
>
>> I have data that get updated and need to make calculations based on
>> the state of knowledge on certain dates.
>>
>> For examples, say I am doing a moving average based on stock closing
>> prices.  If my state of knowledge on Wednesday is that Tuesday's
>> closing price was $10 - but then on Friday I learn (new information)
>> that Tuesday's closing price was actually $12.  For calculations on
>> Wednesday  and Thursday I want to use $10 as Tuesday's closing price,
>> Friday and all following days I want to use the corrected price of
>> $12.
>>
>> What is the best way to arrange the data in Stata to accomplish this?
>
> It appears to me that a basic representation of that problem can be
> handled using -rolling-, so in that case you'd have time points as
> observations (rows) and price as a variable (column).
>
> -- Maarten
>
> -----------------------------------------
> Maarten L. Buis
> Department of Social Research Methodology
> Vrije Universiteit Amsterdam
> Boelelaan 1081
> 1081 HV Amsterdam
> The Netherlands
>
> visiting address:
> Buitenveldertselaan 3 (Metropolitan), room N515
>
> +31 20 5986715
>
> http://home.fsw.vu.nl/m.buis/
> -----------------------------------------
>
>
>
> *
> *   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/
>
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index