+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 16 to 19 of 19

Thread: Regression in STATA

  1. #16
    Points: 443, Level: 8
    Level completed: 86%, Points required for next Level: 7

    Posts
    55
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Regression in STATA



    I know how to do it. I am going to try, but this may take a while. I'll keep you posted.

  2. #17
    Points: 443, Level: 8
    Level completed: 86%, Points required for next Level: 7

    Posts
    55
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Regression in STATA

    Hi guys,

    I understand the way for creating this variable. So I tried it, but after 26 hours I broke the regression down.
    Could anybody explain me why this takes so much time? I have 1662 products which eacht have a time horizon of 8 years daily data.
    I know that this is a large dataset (3.6 million rows), but after 26 hours doing the -rolling-command STATA was by product 10. So could anyone explain me why this takes so long? And if there is a way of doing this more quickly? Because if I want it to do this, following this way, it may take a week to create that variable.
    I hope you have some answers guys.
    Regards,

  3. #18
    Points: 811, Level: 15
    Level completed: 11%, Points required for next Level: 89

    Posts
    78
    Thanks
    0
    Thanked 24 Times in 23 Posts

    Re: Regression in STATA

    It could be slow if you have a large data set and apply -rolling- to panel data set.
    You could use one panel each time and apply -rolling- to time-series but not panel data.

    You could also calculate your own rolling. The difference is that if you have a gap or a missing value in the windows, missing value is returned rather than that the remaining non-missing observations' mean is calculated. Here is an example with window 10:

    ***************************
    clear
    set obs 3
    set seed 12345
    generate product = _n
    expand 20
    bysort product: generate time = _n
    list

    generate inc = int(runiform()*3)
    tsset product time

    local exp L.inc
    forvalues i=2/10 {
    local exp `exp' + L`i'.inc
    }

    di "`exp'"
    generate rolmean = (`exp')/10

    list
    *******************

    Quote Originally Posted by Statahulk View Post
    Hi guys,

    I understand the way for creating this variable. So I tried it, but after 26 hours I broke the regression down.
    Could anybody explain me why this takes so much time? I have 1662 products which eacht have a time horizon of 8 years daily data.
    I know that this is a large dataset (3.6 million rows), but after 26 hours doing the -rolling-command STATA was by product 10. So could anyone explain me why this takes so long? And if there is a way of doing this more quickly? Because if I want it to do this, following this way, it may take a week to create that variable.
    I hope you have some answers guys.
    Regards,

  4. #19
    Points: 443, Level: 8
    Level completed: 86%, Points required for next Level: 7

    Posts
    55
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Regression in STATA


    I have split my dataset into multiple small datasets. I have 1662 products (panel data). But now I am running the -rolling-command over 25 products. This takes 40 minutes. So at the end i will have about 66 dataset which have to be merged. I don't see another opportunity.

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats