I wrote the following code to generate confidence intervals for bootstraps
of ratios between two variables.
BAFp <- rlnorm(100, meanlog=0, sdlog=1)
BAFm <- rlnorm(100, meanlog=0, sdlog=1)
BAFdat <- data.frame(BAFp, BAFm)
# Bootstraps the distribution of ratios between two group means
ratios <- bootstrap(BAFdat, mean(BAFdat[,1])/mean(BAFdat[,2]))
ratios.ci <- limits.tilt(ratios)
plot(ratios)
qqnorm(ratios)
summary(ratios)
The script ran ok, but the output of plot(ratios) was unexpected. It was a
histogram of the frequency distribution of bootstrapped mean(BAFdat[,1])
values. How can I get a plot of the frequency distribution of bootstrapped
ratios?
As I am interested in examining changes in the confidence interval of
bootstrapped ratios along a series of increasing sample sizes, I attempted
to add a vector of block.sizes
ratios <- bootstrap(BAFdat, mean(BAFdat[,1]) / mean(BAFdat[,2]),
block.size = c(5, 10, 20, 40, 80))
All I got was a huge error message. Do I have to create a loop for such
analysis?
Thanks,
Manolo
PS S+ Version 6.2, Windows 2000
|