Learn R Programming

MF (version 4.3.2)

HLBoot: Bootstrap CI for MF, HL, and Qdif

Description

Estimates bootstrap confidence intervals for MF, HL, and Qdif.

Usage

HLBoot(formula, data, compare = c("con", "vac"), b = 100, B = 100, alpha = 0.05, hpd = TRUE, bca = FALSE, return.boot = FALSE, trace.it = FALSE, seed = NULL)

Arguments

formula
Formula of the form y ~ x + cluster(w), where y is a continuous response, x is a factor with two levels of treatment, and w is a factor indicating the clusters.
data
Data frame
compare
Text vector stating the factor levels - compare[1] is the control or reference group to which compare[2] is compared
b
Number of bootstrap samples to take with each cycle
B
Number of cycles, giving the total number of samples = B * b
alpha
Complement of the confidence level
hpd
Estimate highest density intervals for MF and HL? Default TRUE.
bca
Estimate BCa intervals for MF? Default FALSE.
return.boot
Save the bootstrap samples of the statistics? Default FALSE.
trace.it
Verbose tracking of the cycles? Default FALSE.
seed
initial seed value. Ignored.

Value

a mfhlboot-class data object

Details

Estimates bootstrap confidence intervals for the mitigated fraction (MF), Hodge-Lehmann estimator (HL), and the difference of medians and quartiles (Qdif). The Hodges-Lehmann estimator is the media difference; it assumes that the two distributions have the same shape and differ by a constant shift.

References

Hodges JL, Lehmann EL, (1963). Estimates of location based on rank tests. Annals of Mathematical Statistics. 34:598--611. Siev D, (2005). An estimator of intervention effect on disease severity. Journal of Modern Applied Statistical Methods. 4:500--508. Efron B, Tibshirani RJ. An Introduction to the Bootstrap. Chapman and Hall, New York, 1993.

See Also

mfhlboot-class

Examples

Run this code
HLBoot(lesion~group,calflung)

#  Bootstrapping . . . . . . . . . . . .
#
#  10000 bootstrap samples
#  95% confidence intervals
#  Comparing vac to con
#
#
#  Mitigated Fraction
#
#                  observed median  lower  upper
#  Equal Tailed        0.44 0.4464 0.1264 0.7056
#  Highest Density     0.44 0.4464 0.1392 0.7120
#
#
#  Hodges-Lehmann
#
#                  observed   median      lower    upper
#  Equal Tailed    -0.07335 -0.07125 -0.1720537 -0.01430
#  Highest Density -0.07335 -0.07125 -0.1563500 -0.00555
#
#
#  Quartile Differences (quartiles of vac - quartiles of con)
#
#       observed    median      lower     upper
#  Q25 -0.041500 -0.041300 -0.1034000 -0.000905
#  Q50 -0.112525 -0.111175 -0.2811688  0.023200
#  Q75 -0.168000 -0.168000 -0.3858500  0.023975

Run the code above in your browser using DataLab