Description Usage Arguments Details Value Author(s) See Also Examples
Generates a parametric bootstrap for the median of scaled differences from each point in a data set to all other points..
1 2 3 4 5 6 7 8 9 10 |
x |
An R object. For the default method, a vector of observations. For the |
s |
Either a function returning an estimate of scale for |
B |
Scalar number of bootstrap replicates. |
probs |
Vector of probabilities at which to calculate upper quantiles. Passed to
|
method |
Character value describing the simulation method. |
keep |
If |
labels |
Character vector of labels for individual values. |
... |
Parameters passed to other methods. |
bootMSD
calculates a parametric bootstrap simulation (or Monte carlo simulation)
of the results of msd
applied to data. This allows individual case-specific
quantiles and p-values to be estimated that allow for different standard errors
(or standard uncertainties) s
.
The sampling method is currently either sampling from rnorm
or by latin hypercube sampling
using lhs
.
Individual upper quantiles for probabilities probs
and p-values are estimated
directly from the bootstrap replicates. Quantiles use quantile
. p-values
are estimated from the proportion of replicates that exceed the observed MSD calculated by
msd
. Note that the print
method for the summary
object does
not report zero proportions as identically zero.
An object of class "bootMSD", consisting of a vector of length length(x)
of median
scaled absolute deviations for each observation, with attributes:
msdvector of raw calculated MSD values calculated by msd
labelscharacter vector of labels, by default taken from x
probsvextor of probabilities supplied and used for quantiles
critical.valuesmatrix of quantiles. Each row corresponds to a probability
in probs
and each column to an individual data point.
pvalsp-values estimated as the observed proportion of
simulated values exceeding the MSD value calculated by msd
.
BNumber of bootstrap replicates used.
methodThe sampling method used by the parametric bootstrap.
tIf keep == TRUE
, the individual bootstrap replicates
generated by bootMSD
. Set to NA
if keep == FALSE
.
Summary, print and plot methods are provided for the class; see bootMSD-class
.
S. L. R. Ellison s.ellison@lgc.co.uk
msd
, bootMSD-class
, print.bootMSD
,
plot.bootMSD
, summary.bootMSD
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(Pb)
## Not run:
#Default method:
set.seed(1023)
boot.Pb.default <- bootMSD(Pb$value, Pb$u) # Uses individual standard uncertainties
summary(boot.Pb.default)
#Method for MSD object:
msd.Pb<-msd(Pb$value, Pb$u) # Uses individual standard uncertainties
boot.Pb <- bootMSD(msd.Pb, B=5000)
#Increased replication compared to default
summary(boot.Pb)
# NOTE: The default summary gives individual observation p-values.
# To correct for multiple comparisons, apply
# a suitable p-value adjustment:
summary(boot.Pb, p.adjust="holm")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.