Hi, I am using the bsample command and struggling with the error "singleton cluster detected".
The following code illustrates the issue.
I think, the problem is that, as you can see in the following result, a stratum 5.0 includes just one cluster.
That is, Stata has only one option to draw within the stratum 5.0.
What I wanted to do is just to draw the only cluster if a stratum contains just one cluster.
But, I am not sure how to let Stata do this.
How to solve this?
The following code illustrates the issue.
Code:
. sysuse auto, replace (1978 automobile data) . bsample, strata(headroom) cluster(make) singleton cluster detected r(460); end of do-file r(460);
That is, Stata has only one option to draw within the stratum 5.0.
Code:
. tab headroom Headroom | (in.) | Freq. Percent Cum. ------------+----------------------------------- 1.5 | 4 5.41 5.41 2.0 | 13 17.57 22.97 2.5 | 14 18.92 41.89 3.0 | 13 17.57 59.46 3.5 | 15 20.27 79.73 4.0 | 10 13.51 93.24 4.5 | 4 5.41 98.65 5.0 | 1 1.35 100.00 ------------+----------------------------------- Total | 74 100.00
But, I am not sure how to let Stata do this.
How to solve this?
Comment