Learn R Programming

lavaSearch2 (version 1.4)

summary2: Summary with Small Sample Correction

Description

Summary with small sample correction.

Usage

summary2(object, ...)

# S3 method for lm summary2(object, df = TRUE, bias.correct = TRUE, ...)

# S3 method for gls summary2(object, df = TRUE, bias.correct = TRUE, cluster = NULL, ...)

# S3 method for lme summary2(object, df = TRUE, bias.correct = TRUE, ...)

# S3 method for lvmfit summary2(object, df = TRUE, bias.correct = TRUE, ...)

# S3 method for lm2 summary2(object, digit = max(3, getOption("digit")), robust = FALSE, df = TRUE, ...)

# S3 method for gls2 summary2(object, digit = max(3, getOption("digit")), robust = FALSE, df = TRUE, ...)

# S3 method for lme2 summary2(object, digit = max(3, getOption("digit")), robust = FALSE, df = TRUE, ...)

# S3 method for lvmfit2 summary2(object, cluster = NULL, robust = FALSE, df = TRUE, ...)

Arguments

object

a gls, lme or lvm object.

...

arguments passed to the summary method of the object.

df

[logical] should the degree of freedoms of the Wald statistic be computed using the Satterthwaite correction? Otherwise the degree of freedoms are set to Inf, i.e. a normal distribution is used instead of a Student's t distribution when computing the p-values.

bias.correct

[logical] should the standard errors of the coefficients be corrected for small sample bias? See sCorrect for more details.

cluster

[integer vector] the grouping variable relative to which the observations are iid.

digit

[integer > 0] the number of decimal places to use when displaying the summary.

robust

[logical] should the robust standard errors be used instead of the model based standard errors?

Details

summary2 is the same as summary except that it first computes the small sample correction (but does not store it). So if summary2 is to be called several times, it is more efficient to pre-compute the quantities for the small sample correction using sCorrect and then call summary2.

See Also

sCorrect for more detail about the small sample correction.

Examples

Run this code
# NOT RUN {
m <- lvm(Y~X1+X2)
set.seed(10)
d <- lava::sim(m, 2e1)

## Gold standard
summary(lm(Y~X1+X2, d))$coef

## gls models
library(nlme)
e.gls <- gls(Y~X1+X2, data = d, method = "ML")
summary(e.gls)$tTable
sCorrect(e.gls, cluster = 1:NROW(d)) <- FALSE ## no small sample correction
summary2(e.gls)$tTable

sCorrect(e.gls, cluster = 1:NROW(d)) <- TRUE ## small sample correction
summary2(e.gls)$tTable

## lvm models
e.lvm <- estimate(m, data = d)
summary(e.lvm)$coef

sCorrect(e.lvm) <- FALSE ## no small sample correction
summary2(e.lvm)$coef

sCorrect(e.lvm) <- TRUE ## small sample correction
summary2(e.lvm)$coef

# }

Run the code above in your browser using DataLab