I have some sample data:
dat <- c(3, 3, 4, 0, 0, 1, 2, 2, 0, 0, 5, 1, 3, 0, 2, 6, 9, 2, 0, 0,
0, 5, 9, 1, 1, 0, 12, 2, 5, 3, 8, 10, 2, 5, 0, 0, 6, 1, 0, 10,
5, 0, 2, 0, 1, 1, 1, 9, 2, 4, 0, 5, 2, 0, 0, 0, 8, 1, 1, 7, 0,
0, 0, 4, 0, 6, 11, 5, 0, 4, 1, 1, 3, 1, 1, 5, 0, 0, 0, 0, 5,
0, 6, 2, 0, 0, 0, 5, 0, 0, 0, 1, 3, 1, 2, 5, 1, 1, 5, 0, 0, 4,
1, 10, 2, 0, 2, 5, 0, 0, 0, 2, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0,
2, 0, 0, 0, 0, 0, 0, 1, 0, 2, 1, 3, 2, 0, 0, 1, 0, 5, 4, 10,
1, 0, 1, 1, 1, 3, 3, 0, 1, 0, 0, 0, 1, 8, 0, 2, 1, 2, 2, 5, 1,
3, 2, 1, 0, 3, 3, 8, 0, 0, 2, 1, 2, 0, 0, 3, 5, 1, 0, 5, 0, 3,
0, 5, 0, 0, 4, 3, 1, 4, 0, 0, 2, 1, 4, 7, 0, 2, 3, 2, 1, 2, 5,
2, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1, 6, 5, 6, 0, 0, 3, 0, 0, 0,
0, 0, 3, 0, 7, 0, 1, 0, 1, 2, 0, 0, 1, 0, 2, 0, 0, 6, 0, 0)
The histogram looks like this:
The data correspond to some measure of disability and is capped at 12. I'm trying to simulate data for a treated sample (e.g. the above data) and a control sample (e.g. median of the distribution is shifted to the right by 1).
Question Is there a way to simulate the control sample non-parametrically? I want to preserve the zeros, so I cannot simply bootstrap and add 1 to the values. Another option is using some mixture - atom at zero and some distribution $F^+$ on the non-zero part, but it's hard to know what the proportion of zeros and non-zeros will be in the control sample.
dat
is 1. So if you want a simulation with a median of 2 and keeping the zeros, then your simulation should have 103 zeros, then about 41 samples from 1 and 2, then 102 data points sampled from 3-12, e.g. using the empirical distribution indat
. Is that what you are looking for? $\endgroup$