Parametric Bootstrap Tests

DESCRIPTION:

Perform parametric bootstrap test by sampling from a parametric model, with at least one parameter constrained by the null hypothesis.

USAGE:

parametricBootstrapTest(data, statistic, rsampler,  
      B=999, args.stat = NULL, args.rsampler = NULL, 
      null.value, alternative="two.sided", ...) 
 

REQUIRED ARGUMENTS:

data
May be a vector, matrix, or data frame.
statistic
the test statistic to be bootstrapped; a function or expression that returns a vector or matrix. It may be a function which accepts data as the first argument; other arguments may be passed using args.stat.
Or it may be an expression such as mean(x, trim=.2). If data is given by name (e.g. data=x) then use that name in the expression, otherwise (e.g. data=air[,4]) use the name data in the expression. If data is a data frame, the expression may involve variables in the data frame.
rsampler
parametric function which generates the simulated data. The first argument to this function should be the sample size (and called n). Other arguments, including those necessary to ensure sampling under the null distribution, should be provided in a list ( args.rsampler).

OPTIONAL ARGUMENTS:

B
number of bootstrap resamples to be drawn. The default value of B=999 causes p-values to be multiples of 1/1000.
args.stat
list of other arguments, if any, passed to statistic when calculating the statistic on the resamples.
args.rsampler
list of arguments (besides n) passed to rsampler when performing the parametric sampling. If elements of the list have names, the names must match the argument names of rsampler. The arguments giving parameter values should be consistent with the null hypothesis, so that sampling is from the null distribution.
null.value
character labels, to be used when printing, e.g. c("mean(x) = 0", "sd(x) = 3"). This should be the same length as the observed statistic. These values may be used in the print and other methods, but otherwise have no effect: the null distribution is specified parametrically by rsampler and args.rsampler.
alternative
alternative hypothesis: one of two.sided, greater, or less. This may be a vector the same length as the statistic.
...
additional arguments, which are passed to parametricBootstrap. See for details.

VALUE:

an object of class parametricBootstrapTest which inherits from resamp.

DETAILS:

This function is implemented as a front end to parametricBootstrap.

If statistic returns a vector-valued result, then p-values are calculated (independently) for each dimension of the result. In this case, alternative may be a vector of the same length as the statistic, indicating which kind of test should be used for each dimension of the result.

REFERENCES:

Davison, A.C. and Hinkley, D.V. (1997), Bootstrap Methods and Their Application, Cambridge University Press.

SEE ALSO:

. More details on some arguments, see .

Print, summarize, plot: , , , ,

Description of a "parametricBootstrapTest" object, extract parts: , .

Modify a "parametricBootstrapTest" object: , .

For an annotated list of functions in the package, including other high-level resampling functions, see: .

EXAMPLES:

dd <- data.frame(x=1:30, y=rnorm(30)) 
plot(dd$x,dd$y); abline(lm(y ~ x, data=dd)) 
obj <- parametricBootstrapTest(dd, cor(dd$x, dd$y), 
                 rsampler=function(n) data.frame(x=1:n, y=rnorm(30)), 
                 null.value = 0.0, alternative="greater")