I am trying to replicate Micheal W. Klein (1996) paper, Timing is all: Elections and the Duration of United Stated Business Cycles, published in Journal of Money, Credit and Banking, Vol.28, No.1 (Feb., 1996), pp.84-101. In the paper, the author mentioned that
I am wondering how I can do such boot-strap in Rats. Following is my code for the original cox modelThe relatively small number of business cycles, especially in the subsamples,makes inference based upon standard asymptotics suspect. Therefore we use boot-strap techniques. The point estimates presented in Tables 4 through 8 represent the mean value of the respective estimates for five hundred resamples from the originaldata. We resample "clusters" of observations from the original data set choosing theset of observations corresponding to an entire business cycle as one "draw." Each resample therefore has the same number of business cycles as the original sample.
Code: Select all
compute nobs=9
dec vect[vect] riskset(nobs)
dec vect hazards(nobs)
do i=1,nobs
dim riskset(i)(nobs)
ewise riskset(i)(j)=duration(j)>=duration(i)
end do i
*
* The function HazardCalc gets computed at the start of each function evaluation to
* recalculate the relative hazard rates. These are put into the vector HAZARDS. The
* probability that an individual is the one to exit at her exit time is the ratio of her
* relative hazard to the sum of those hazards across the risk set for her exit time.
*
nonlin b1
compute b1=0.0
frml hazard = exp(b1*twentyfourmonth)
*
function HazardCalc
do i=1,nobs
compute hazards(i)=hazard(i)
end do i
end
*
frml logl = log(hazards(t))-log(%dot(riskset(t),hazards))
maximize(method=bfgs,start=HazardCalc()) logl