Hi everyone,
I am using stcox to study the impact of election on the probability of reaching peaks or troughs in the US stock market. Due to the relatively small number of stock market cycles I have that makes inference based upon standard asymptotic suspect. Therefore I would like to use boot-strap techniques to generate the standard error. Following a similar study, I resample "clusters" of observations from the original data set choosing the set of observations corresponding to an entire market cycle as one "draw. Each resample therefore has the same number of market cycles as the original sample." The covariate used in my regression is a binary variable that represents the period within 24 months after election.
My code is
However, Stata generates following error message
and my data set
I am seeking for help how to over come the problem. Any suggestion and advice is highly appreciated. Thank you
I am using stcox to study the impact of election on the probability of reaching peaks or troughs in the US stock market. Due to the relatively small number of stock market cycles I have that makes inference based upon standard asymptotic suspect. Therefore I would like to use boot-strap techniques to generate the standard error. Following a similar study, I resample "clusters" of observations from the original data set choosing the set of observations corresponding to an entire market cycle as one "draw. Each resample therefore has the same number of market cycles as the original sample." The covariate used in my regression is a binary variable that represents the period within 24 months after election.
My code is
Code:
stset time, fail(event) id(phaseid) bootstrap _b[a24], cluster(cycleid) idcluster(newcycleid): stcox a24 if phase==1 & pww2==1
Code:
Note: One or more parameters could not be estimated in 2 bootstrap replicates; standard-error estimates include only complete replications.
Code:
input byte cycleid int(phaseid time) byte(a9 a12 a24 event a9_d a12_d a24_d a9_r a12_r a24_r pww1 pww2 phase _st _d) int(_t _t0) float newcycleid 1 101 23 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 23 0 1 1 101 32 1 1 1 0 1 1 1 0 0 0 0 0 1 1 0 32 23 1 1 101 35 0 1 1 0 0 1 1 0 0 0 0 0 1 1 0 35 32 1 1 101 44 0 0 1 1 0 0 1 0 0 0 0 0 1 1 1 44 35 1 1 102 3 0 0 1 0 0 0 1 0 0 0 0 0 2 1 0 3 0 1 1 102 7 0 0 0 1 0 0 0 0 0 0 0 0 2 1 1 7 3 1 2 201 10 0 0 0 1 0 0 0 0 0 0 1 0 1 1 1 10 0 2 2 202 10 0 0 0 0 0 0 0 0 0 0 1 0 2 1 0 10 0 2 2 202 18 1 1 1 1 0 0 0 1 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