boot.mtr.pairwise {metRology} | R Documentation |
Parametric bootstrap for pairwise comparison statistics.
Description
Generates a parametric bootstrap for the pair-difference chi-squared statistic or MSD.
boot.mtr.pairwise
is primarily intended to be called from other functions,
notably bootPDchisq
.
Usage
boot.mtr.pairwise(x, s=mad , B=3000, probs=c(0.95, 0.99),
cov=NULL, cor = NULL, stat=c("MSD", "PDchisq"),
method=c("rnorm", "lhs"), keep=FALSE, labels=names(x), ...)
Arguments
x |
Vector of observations |
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
|
cov , cor |
Covariance or correlation matrix, respectively, describing the covariance structure
across |
stat |
The statistic to be bootstrapped. Either |
method |
Character value describing the simulation method. |
keep |
If |
labels |
Character vector of labels for individual values. |
... |
Parameters passed to other methods. |
Details
boot.mtr.pairwise
calculates a parametric bootstrap simulation
(or Monte carlo simulation) of the results of msd
or pdchisq
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 sampling from rnorm
.
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 values calculated by
msd
or pdchisq
. Note that the print
method for the summary
object does not report zero proportions
as identically zero.
Value
An object of class “bootMtrPairs”, consisting of a list containing:
of length length(x)
of median scaled absolute deviations for each
observation, with attributes:
t0 |
|
labels |
character vector of labels, by default taken from |
probs |
vector of probabilities supplied and used for quantiles |
critical.values |
matrix of quantiles. Each row corresponds to a probability
in |
pvals |
p-values estimated as the observed proportion of
simulated values exceeding the calculated values |
B |
Number of bootstrap replicates used. |
method |
The sampling method used by the parametric bootstrap. |
stat |
The statistic bootstrapped. Either |
t |
If |
.
Summary, print and plot methods are provided for the class; see bootMtrPairs-class
.
Author(s)
S. L. R. Ellison s.ellison@lgcgroup.com
See Also
msd
, bootMSD-class
,
pdchisq
, PDchisq-class
,
Examples
data(Pb)
## Not run:
#Default method:
set.seed(1023)
boot.Pb.default <- boot.mtr.pairwise(Pb$value, Pb$u) # Uses individual standard uncertainties
summary(boot.Pb.default)
#Method for pair-difference chi-squared object:
pwch.Pb<-pdchisq(Pb$value, Pb$u) # Uses individual standard uncertainties
boot.Pb <- boot.mtr.pairwise(pwch.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; for example:
summary(boot.Pb, p.adjust="holm")
## End(Not run)