Saving bootstrapped series
Posted: Sun Feb 15, 2015 5:36 am
Hi Tom,
I have a basic data management problem I can't fix, which builds on your reply to a previous post. I have a residual series for 500 individuals, with each series named res(m), m=1,2,...,500, and each res(m) series has different number of observations which are also in the dataset as series nobs(m)=(35,36,....,110). I am bootstrapping the residual series (ndraws=1000) for each m and need to keep the results of each draw for later, such that I will have a number of series which are identified by resboot(m)_(ndraw). However I can't seem to declare the right number of vectors to store the output of each draw for every m. The first block of code below is what I had thought as being the right way to do it - but it doesn't run at all. The second block runs, but obviously only stores the results for the 500th individual - any help would be appreciated.
comp ndraws=1000
comp indivs=500
do m=1,indivs
do i=1,ndraws
stats nobs(m)
comp nobs_shock = %mean
dec vect[series] resboot(m)_(ndraws)
set resboot(m)_(i) = res(m)(fix(%uniform(1,nobs_shock)))
end do i
end do m
comp ndraws=1000
comp indivs=500
do m=1,indivs
do i=1,ndraws
stats nobs(m)
comp nobs_shock = %mean
dec vect[series] resboot_(ndraws)
set resboot_(i) = res(m)(fix(%uniform(1,nobs_shock)))
end do i
end do m
I have a basic data management problem I can't fix, which builds on your reply to a previous post. I have a residual series for 500 individuals, with each series named res(m), m=1,2,...,500, and each res(m) series has different number of observations which are also in the dataset as series nobs(m)=(35,36,....,110). I am bootstrapping the residual series (ndraws=1000) for each m and need to keep the results of each draw for later, such that I will have a number of series which are identified by resboot(m)_(ndraw). However I can't seem to declare the right number of vectors to store the output of each draw for every m. The first block of code below is what I had thought as being the right way to do it - but it doesn't run at all. The second block runs, but obviously only stores the results for the 500th individual - any help would be appreciated.
comp ndraws=1000
comp indivs=500
do m=1,indivs
do i=1,ndraws
stats nobs(m)
comp nobs_shock = %mean
dec vect[series] resboot(m)_(ndraws)
set resboot(m)_(i) = res(m)(fix(%uniform(1,nobs_shock)))
end do i
end do m
comp ndraws=1000
comp indivs=500
do m=1,indivs
do i=1,ndraws
stats nobs(m)
comp nobs_shock = %mean
dec vect[series] resboot_(ndraws)
set resboot_(i) = res(m)(fix(%uniform(1,nobs_shock)))
end do i
end do m