boot.nm: A function to calculate bootstrap standard errors

Description Usage Arguments Details Value Author(s) Examples

View source: R/boot.nm.R

Description

Calculates bootstrap standard errors for the parameter estimates obtained by lmenssp when Nelder-Mead algorithm is used

Usage

1
2
boot.nm(formula, data, id, timeVar, result, matern = TRUE, kappa.or.power, 
nboot = 100, tol.lmenssp = 1e-08, maxiter.lmenssp = 500)

Arguments

formula

a typical R formula for the fixed effects component of the model

data

a data frame from which the variables are to be extracted

id

a numerical vector for subject identification

timeVar

a numerical vector for the time variable

result

a matrix of results obtained by lmenssp, see the example below

matern

a logical variable, TRUE corresponds to Matern correlation function, FALSE corresponds to powered correlation function

kappa.or.power

a numerical value for the shape parameter, it corresponds to κ if matern = TRUE and φ if matern = FALSE

nboot

a numerical value for number of bootstrap sample

tol.lmenssp

a numerical value for the tolerance, to be passed to lmenssp

maxiter.lmenssp

a numerical value for the maximum number of iterations, to be passed to lmenssp

Details

This function consider parametric bootstrap based on the fitted model. The recommended number of bootstrap replications is at least 100. For the details of κ and φ in kappa.or.power, see the details section of lmenssp function.

Value

Returns a list of results

Author(s)

Ozgur Asar, Peter J. Diggle

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# loading the data set and subsetting it for the first 5 patients 
# for the sake illustration of the usage of the functions
data(data.sim.ibm)
data.sim.ibm.short <- data.sim.ibm[data.sim.ibm$id <= 5, ]

# model formula to be used below
formula <- log.egfr ~ sex + bage + fu + pwl

# fitting the mixed model with Matern, kappa = 0.5
fit.matern <- lmenssp(formula = formula, data = data.sim.ibm.short,
  id = data.sim.ibm.short$id, process = "sgp-matern-0.5", timeVar = data.sim.ibm.short$fu, 
  init = c(-13, 1, -1), silent = FALSE)
fit.matern

# bootstrapping the standard errors, nboot is set to 2 for illustration
# set nboot to at least 100 in your applications
fit.matern.boot <- boot.nm(formula = formula, data = data.sim.ibm.short, 
                           id = data.sim.ibm.short$id, timeVar = data.sim.ibm.short$fu, 
                           result = fit.matern$est, matern = TRUE, kappa.or.power = 0.5, 
                           nboot = 2)
fit.matern.boot


lmenssp documentation built on May 19, 2017, 9:05 p.m.
Search within the lmenssp package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.