resid_boot: Obtain Residual Bootstrap

Description Usage Arguments Details Value Note See Also Examples

View source: R/resid_boot.r

Description

Generates bootstrap samples of the data vector.

Usage

1
2
3
resid_boot(formula, data, gfix = NULL, eps = NULL, xi = NULL,
  null.resids = TRUE, theta = NULL, ssq = NULL, tsq = NULL,
  cov.theta = NULL, seed = NULL, nsim = 1000, mySolver = "LS", ...)

Arguments

formula

a formula expression. The constrained effect(s) must come before any unconstrained covariates on the right-hand side of the expression. The first ncon terms will be assumed to be constrained.

data

data frame containing the variables in the model.

gfix

optional vector of group levels for residual variances. Data should be sorted by this value.

eps

estimates of residuals.

xi

estimates of random effects.

null.resids

logical indicating if residuals should be computed under the null hypothesis.

theta

estimates of fixed effects coefficients. Estimated if not submitted.

ssq

estimates of residual variance components. Estimated if not submitted.

tsq

estimates of random effects variance components. Estimated if not submitted.

cov.theta

covariance matrix of fixed effects coefficients. Estimated if not submitted.

seed

set the seed for the RNG.

nsim

number of bootstrap samples to use for significance testing.

mySolver

solver to use, passed to activeSet.

...

space for additional arguments.

ncon

the number of variables in formula that are constrained.

Details

If any of the parameters theta, ssq, tsq, eps, or xi are provided, the function will use those values in generating the bootstrap samples. They will be estimated if not submitted. Ifnull.resids=TRUE, then theta will be projected onto the space of the null hypothesis ( Ho: theta_1 = theta_2 = ... = theta_p1) regardless of whether it is provided or estimated. To generate bootstraps with a specific theta, set null.residuals=FALSE.

Value

Output is N x nsim matrix, where each column is a bootstrap sample of the response data Y.

Note

This function is primarily designed to be called by clme.

By default, homogeneous variances are assumed for the residuals and (if included) random effects. Heterogeneity can be induced using the arguments Nks and Qs, which refer to the vectors (n1, n2 ,... , nk) and (c1, c2 ,... , cq), respectively. See clme_em for further explanation of these values.

See Also

clme

Examples

1
2
3
data( rat.blood )
boot_sample <- resid_boot(mcv ~ time + temp + sex + (1|id), nsim = 10, 
                          data = rat.blood, null.resids = TRUE  )

jelsema/CLME documentation built on May 25, 2018, 4:43 a.m.