Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mxParametricBootstrap

Assess whether potential parameters should be freed using parametric bootstrap


Description

Data is simulated from ‘nullModel’. The parameters named by ‘labels’ are freed to obtain the alternative model. The alternative model is fit against each simulated data set.

Usage

mxParametricBootstrap(nullModel, labels,
   alternative=c("two.sided", "greater", "less"),
   ..., alpha=0.05, correction=p.adjust.methods,
   previousRun=NULL, replications=400, checkHess=FALSE,
   signif.stars = getOption("show.signif.stars"))

Arguments

nullModel

The model specifying the null distribution

labels

A character vector of parameters to free to obtain the alternative model

alternative

a character string specifying the alternative hypothesis

...

Not used. Forces remaining arguments to be specified by name.

alpha

The false positive rate

correction

How to adjust the p values for multiple tests.

replications

The number of resampling replications. If available, replications from prior invocation will be reused.

previousRun

Results to re-use from a previous bootstrap.

checkHess

Whether to approximate the Hessian in each replication

signif.stars

logical. If TRUE, ‘significance stars’ are printed for each coefficient.

Details

When the model has a default compute plan and ‘checkHess’ is kept at FALSE then the Hessian will not be approximated or checked. On the other hand, ‘checkHess’ is TRUE then the Hessian will be approximated by finite differences. This procedure is of some value because it can be informative to check whether the Hessian is positive definite (see mxComputeHessianQuality). However, approximating the Hessian is often costly in terms of CPU time. For bootstrapping, the parameter estimates derived from the resampled data are typically of primary interest.

Value

A data frame is returned containing the test results. Details of the bootstrap replications are stored in the ‘bootData’ attribute on the data frame.

Examples

library(OpenMx)

data(demoOneFactor)
manifests <- names(demoOneFactor)
latents <- c("G")

base <- mxModel(
  "OneFactorCov", type="RAM",
  manifestVars = manifests,
  latentVars = latents,
  mxPath(from=latents, to=manifests, values=0,  free=FALSE, labels=paste0('l',1:length(manifests))),
  mxPath(from=manifests, arrows=2, values=rlnorm(length(manifests)), lbound=.01),
  mxPath(from=latents, arrows=2, free=FALSE, values=1.0),
  mxPath(from = 'one', to = manifests, values=0, free=TRUE, labels=paste0('m',1:length(manifests))),
  mxData(demoOneFactor, type="raw"))

base <- mxRun(base)

# use more replications, 8 is for demonstration purpose only
mxParametricBootstrap(base, paste0('l', 1:length(manifests)),
                      "two.sided", replications=8)

OpenMx

Extended Structural Equation Modelling

v2.19.5
Apache License (== 2.0)
Authors
Steven M. Boker [aut], Michael C. Neale [aut], Hermine H. Maes [aut], Michael J. Wilde [ctb], Michael Spiegel [aut], Timothy R. Brick [aut], Ryne Estabrook [aut], Timothy C. Bates [aut], Paras Mehta [ctb], Timo von Oertzen [ctb], Ross J. Gore [aut], Michael D. Hunter [aut], Daniel C. Hackett [ctb], Julian Karch [ctb], Andreas M. Brandmaier [ctb], Joshua N. Pritikin [aut, cre], Mahsa Zahery [aut], Robert M. Kirkpatrick [aut], Yang Wang [ctb], Ben Goodrich [ctb], Charles Driver [ctb], Massachusetts Institute of Technology [cph], S. G. Johnson [cph], Association for Computing Machinery [cph], Dieter Kraft [cph], Stefan Wilhelm [cph], Sarah Medland [cph], Carl F. Falk [cph], Matt Keller [cph], Manjunath B G [cph], The Regents of the University of California [cph], Lester Ingber [cph], Wong Shao Voon [cph], Juan Palacios [cph], Jiang Yang [cph], Gael Guennebaud [cph], Jitse Niesen [cph]
Initial release
2021-03-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.