Bookmark and Share

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: programming for coskewness and cokurtosis


From   Austin Nichols <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: programming for coskewness and cokurtosis
Date   Sat, 8 Mar 2014 09:28:48 -0500

In this case, with a very large dataset, it might make sense to create
59 new variables for each of the next 59 months, and construct the
regression coefs and residuals by hand along these lines:
http://www.stata.com/statalist/archive/2008-10/msg00136.html

On Sat, Mar 8, 2014 at 8:44 AM, Roberto Ferrer <[email protected]> wrote:
> You should probably read -help rolling-. The spelling is Stata,  not STATA.
>
> On March 8, 2014 12:07:33 AM GMT-04:30, [email protected] wrote:
>>Dear STATA experts
>>
>>Greeting all. I have data of stock return and market return in
>>following format
>>
>>month      A             B             C
>>.....................................       Market
>>1            7.2          10.4        3.6
>>...................................         4.5
>>2            6.5          8.9          4.4
>>...................................         5.6
>>.................        .......       .......       ......
>>...................................         ......
>>
>>I want to estimate coskewness and cokurtosis by:
>>
>>1. Start first data set with data record # 1-60 of stock A
>>2. Regress stock return with Market Return, with equation Rit = a + b
>>(Rmt) with 60 data records
>>3. Calculate residual "e" of month #1 by e = r(1) - a - b (Rmt(1)),
>>and repeat for month 2-60
>>4. Calculate "em" of month #1 by em(1) = the different between market
>>return of month 1 and average of market return of month 1-60, and
>>repeat for month 2-60
>>5. Calculate CSK of month 61 =
>>Average{(e)*em)^2}/{SQRT(Average(e^2))*Average(em)^2)} of month 1-60
>>6. Calculate CKT of month 61 =
>>Average{(e)*em)^3}/{SQRT(Average(e^2))*Average(em)^3)} of month 1-60
>>7. Save "month", "Stock Name", "r", "CSK", "CKT", "e", "em" of month 61
>>8. Move data time window to t+1 (data record # 2-61) and repeat step 2-
>>7
>>9. Keep doing until all data of stock A and start for stock B until all
>>stock
>>
>>If STATA can do this, could you please give me some hint on how to?
>>Thank you very much in advance for your kind help.
>>*
>>*   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/
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
> *
> *   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/
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index