processFit: Process Fitted Objects

View source: R/processFit.R

processFitR Documentation

Process Fitted Objects

Description

Methods to process fitted objects and convert into a data structure that is useful in post-processing.

Usage

processFit(
  obj,
  all = FALSE,
  coefs = TRUE,
  stdErrors = all,
  tValues = all,
  sigma = TRUE,
  thetas = TRUE,
  b = all,
  meanB = all,
  meanAbsB = all,
  residuals = all,
  converged = TRUE,
  numWarnings = all,
  procTime = all,
  ...
)

## S3 method for class 'lmerMod'
processFit(
  obj,
  all = FALSE,
  coefs = TRUE,
  stdErrors = all,
  tValues = all,
  sigma = TRUE,
  thetas = TRUE,
  b = all,
  meanB = all,
  meanAbsB = all,
  residuals = all,
  converged = TRUE,
  numWarnings = all,
  procTime = all,
  ...
)

## S3 method for class 'rlmerMod'
processFit(
  obj,
  all = FALSE,
  coefs = TRUE,
  stdErrors = all,
  tValues = all,
  sigma = TRUE,
  thetas = TRUE,
  b = all,
  meanB = all,
  meanAbsB = all,
  residuals = all,
  converged = TRUE,
  numWarnings = all,
  procTime = all,
  ...
)

## S3 method for class 'heavyLme'
processFit(
  obj,
  all = FALSE,
  coefs = TRUE,
  stdErrors = all,
  tValues = all,
  sigma = TRUE,
  thetas = TRUE,
  b = all,
  meanB = all,
  meanAbsB = all,
  residuals = all,
  converged = TRUE,
  numWarnings = all,
  procTime = all,
  ...
)

## S3 method for class 'lqmm'
processFit(
  obj,
  all = FALSE,
  coefs = TRUE,
  stdErrors = all,
  tValues = all,
  sigma = TRUE,
  thetas = TRUE,
  b = all,
  meanB = all,
  meanAbsB = all,
  residuals = all,
  converged = TRUE,
  numWarnings = all,
  procTime = all,
  ...
)

## S3 method for class 'rlme'
processFit(
  obj,
  all = FALSE,
  coefs = TRUE,
  stdErrors = all,
  tValues = all,
  sigma = TRUE,
  thetas = TRUE,
  b = all,
  meanB = all,
  meanAbsB = all,
  residuals = all,
  converged = TRUE,
  numWarnings = all,
  procTime = all,
  ...
)

## S3 method for class 'varComprob'
processFit(
  obj,
  all = FALSE,
  coefs = TRUE,
  stdErrors = all,
  tValues = all,
  sigma = TRUE,
  thetas = TRUE,
  b = all,
  meanB = all,
  meanAbsB = all,
  residuals = all,
  converged = TRUE,
  numWarnings = all,
  procTime = all,
  isInterceptCorrelationSlopeModel,
  ...
)

Arguments

obj

object returned by the fitting method.

all

logical, shorthand to enable all exports.

coefs

logical, if true coefficients are added to export.

stdErrors

logical, if true, standard errors are added to export.

tValues

logical, if true, t-values are added to export.

sigma

logical, if true, sigma is added to export.

thetas

logical, if true, thetas are added to export.

b

scalar logical or index vector, if true, all random effects are added to export. If an index vector is given, then only the corresponding random effects are added to the export. The same order as in lmer is used for all methods.

meanB

logical, if true, the mean of the random effects is added to the export.

meanAbsB

logical, if true, the mean of the absolute value of the random effects is added to the export.

residuals

scalar logical or index vector, similar to argument b, just returning the residuals.

converged

logical, if true, convergence code is added to export.

numWarnings

logical, if true, the number of warnings generated during the fitting process is added to export.

procTime

logical, if true, time needed to fit object is added to export.

...

optional parameters used for some implementations.

isInterceptCorrelationSlopeModel

optional logical, can be used to override the assumption that a model with three variance components can be interpreted as having intercept, correlation and slope.

Details

Warning. processFit.varComprob uses simplistic logic to convert from the parameterisation used in the robustvarComp package to theta as used in lmer and rlmer. If there are three variance components, the code assumes that they are intercept, correlation and slope. Otherwise the code assumes that the variance components are independent. Exports b and residuals are not supported.

Value

List with extracted values, most items can be suppressed to save disk space.

label:

Name of fitting method used to create the fit

datasetIndex:

Index of the dataset in the dataset list

coefficients:

Vector of estimated fixed-effects coefficients of the fitted model

standardErrors:

Vector of estimated standard errors of the fixed-effects coefficients

tValues:

Vector of t-Values (or z-Values depending on fitting method) of the fixed-effects coefficients

sigma:

Estimated residual standard error

thetas:

Vector of random-effects parameter estimates. As parameterized as by lmer and rlmer.

b:

Vector of requested predicted random-effects.

meanB:

Vector of means of the predicted random-effects.

meanAbsB:

Vector of means of the absolute values of the predicted random-effects.

residuals:

Vector of requested residuals.

converged:

Convergence status as reported by the fitting method. 0 means converged. If not available, NA is used. Other values are to be interpreted carefully as codes vary from method to method.

numberOfWarnings:

the number of warnings generated during the fitting process.

proc.time:

Vector of times (user, system, elapsed) as reported by proc.time required to fit the model.

Examples

  set.seed(1)
  oneWay <- generateAnovaDatasets(1, 1, 10, 4,
                                  lmeFormula = y ~ 1,
                                  heavyLmeRandom = ~ 1,
                                  heavyLmeGroups = ~ Var2,
                                  lqmmRandom = ~ 1,
                                  lqmmGroup = "Var2",
                                  groups = cbind(rep(1:4, each = 10), rep(1:10, 4)),
                                  varcov = matrix(1, 4, 4),
                                  lower = 0)
  processFit(fitDatasets_lmer(oneWay)[[1]], all = TRUE)
  processFit(fitDatasets_rlmer_DASvar(oneWay)[[1]], all = TRUE)
  ## Not run: 
    processFit(fitDatasets_heavyLme(oneWay)[[1]], all = TRUE)
  
## End(Not run)
  if (require(lqmm)) {
    processFit(fitDatasets_lqmm(oneWay)[[1]], all = TRUE)
  }
  ## Not run: 
    processFit(fitDatasets_varComprob_compositeTau(oneWay)[[1]], all = TRUE)
  
## End(Not run)

kollerma/robustlmm documentation built on Jan. 14, 2024, 2:18 a.m.