estimate2: Satterthwaite Correction and Small Sample Correction

estimate2R Documentation

Satterthwaite Correction and Small Sample Correction

Description

Correct the bias of the ML estimate of the variance and compute the first derivative of the information matrix.

Compute bias corrected residuals variance covariance matrix and information matrix. Also provides the leverage values and corrected sample size when adjust.n is set to TRUE.

Usage

estimate2(
  object,
  param,
  data,
  ssc,
  df,
  derivative,
  hessian,
  dVcov.robust,
  iter.max,
  tol.max,
  trace,
  ...
)

## S3 method for class 'lvm'
estimate2(
  object,
  param = NULL,
  data = NULL,
  ssc = lava.options()$ssc,
  df = lava.options()$df,
  derivative = "analytic",
  hessian = FALSE,
  dVcov.robust = FALSE,
  iter.max = 100,
  tol.max = 1e-06,
  trace = 0,
  ...
)

## S3 method for class 'lvmfit'
estimate2(
  object,
  param = NULL,
  data = NULL,
  ssc = lava.options()$ssc,
  df = lava.options()$df,
  derivative = "analytic",
  hessian = FALSE,
  dVcov.robust = FALSE,
  iter.max = 100,
  tol.max = 1e-06,
  trace = 0,
  ...
)

## S3 method for class 'list'
estimate2(object, ...)

## S3 method for class 'mmm'
estimate2(object, ...)

.sscResiduals(object, ssc, algorithm = "2")

Arguments

object

a lvm object.

param

[numeric vector, optional] the values of the parameters at which to perform the correction.

data

[data.frame, optional] the dataset relative to which the correction should be performed.

ssc

[character] method used to correct the small sample bias of the variance coefficients: no correction (code"none"/FALSE/NA), correct the first order bias in the residual variance ("residual"), or correct the first order bias in the estimated coefficients "cox"). Only relevant when using a lvmfit object.

df

[character] method used to estimate the degree of freedoms of the Wald statistic: Satterthwaite "satterthwaite". Otherwise ("none"/codeFALSE/codeNA) the degree of freedoms are set to Inf. Only relevant when using a lvmfit object.

derivative

[character] should the first derivative of the information matrix be computed using a formula ("analytic") or numerical derivative ("numeric")?

hessian

[logical] should the hessian be stored? Can be NULL to indicate only if computed during the small sample correction.

dVcov.robust

[logical] should the first derivative of robust variance-covariance matrix be stored?

iter.max

[integer >0] the maximum number of iterations used to estimate the bias correction.

tol.max

[numeric >0] the largest acceptable absolute difference between two succesive estimates of the bias correction.

trace

[logical] should the execution of the function be traced.

...

arguments passed to lava::estimate when using a lvm object.

Details

The argument value is equivalent to the argument bias.correct of the function summary2.

Examples

#### simulate data ####
set.seed(10)
dW <- sampleRepeated(10, format = "wide")

#### latent variable model ####
m.lvm <- lvm(Y1~X1+X2+Z1)

e2.lvm <- estimate2(m.lvm, data = dW)
summary2(e2.lvm)


lavaSearch2 documentation built on April 12, 2023, 12:33 p.m.