I have a population of sales that might be won or lost. I know the rate that they are won from historical data. This case 30% of them historically win. To figure out how much money I will be making off of these sales I need to weight them. I could just add up all the values of the sales then take 30% of that number, but there is high variance in what the value of single sales are.
> describe(Dataset$V1) var n mean sd median trimmed mad min max range skew 1 1 2314 185090.7 1129744 32000 52077.27 37065 1000 3.5e+07 34999000 19.26 kurtosis se 1 478.5 23485.42 > sum(Dataset$V1)*.3  128489970
So I figured that if you win 30% of them then let's try sampling the population at a win rate of 30%. I ran the following code
#Put the Percentage Value you want to use here P <- .30 X <- round(nrow(Dataset)*P) #Figured out how many wins will be based on different sample sizes. boot <- data.frame( boot = replicate(10000, sum(sample(Dataset$V1, size=X))) ) write.csv(boot, file=ThePath, row.names=FALSE)
I have replacement as False because a single sale can't be won more than once. I do know that only the very first sale is picked at a 30% rate and the rest are picked at a slightly lower rate due to no replacement.
So it randomly takes 30% of the data and then adds it up because I only care about the total expected value. I have it do this 10,000 times then I turned it into a histogram to see the distribution. Then have it set up to calculate what % of the 10,000 runs each bin has. Then look for about 8000 or 80% of the values in sequential bins.
Can I then say that 80% of the time in a simulation of 10,000 the expected total value of the sales is expected to be within X and X? Or should I be using a normal bootstrap confidence interval calculation? Does the fact that the original data is skewed create issues and in some of the datasets when I run this code the Bootstrapped data comes out almost bimodal, does that lead to problems also?