pool.R2: Compute R^2 in multiple imputed and nested multiple imputed...

pool.R2R Documentation

Compute R^2 in multiple imputed and nested multiple imputed data

Description

With (nested) multiple imputations, the determination coefficient R^2 has to be computed for each imputed data set and pooled afterwards. pool.R2 provide pooling routines according to Harel (2009). The function requires that the R^2 coefficients from the multiple imputed analyses are already available.

Usage

pool.R2 ( r2, N, verbose = TRUE )

Arguments

r2

For multiple imputed data, a numeric vector of R^2 values. For nested multiple imputed data, a list of numeric vectors of R^2 values. The number of list elements must correspond to the number of nests. The number of R^2 values within each list element must be equal and must correspond to the number of imputations within each nest.

N

Optional: the sample size of each imputed data set. Only necessary if the standard error for the pooled R^2 should be computed. The structure of the N object must correspond to the structure of the r2 object. See examples for further details.

verbose

Optional: Print additional messages to console?

Value

Returns a data.frame with one or two columns which contains the pooled R^2 value and optionally it's standard error.

References

Harel, O. (2009): The estimation of R^2 and adjusted R^2 in incomplete data sets using multiple imputation. Journal of Applied Statistics. 36, 10, 1109–1118.

Examples

# multiple imputation, assume that the regression analysis was fitted for five imputed data sets,
# resulting in five R^2 values. Assume sample sizes of 340
r2 <- c(0.12395, 0.15261, 0.16125, 0.11029, 0.1871)
Ns <- rep(340,5)
pool.R2 ( r2=r2, N=Ns)
# without standard error
pool.R2 ( r2=r2)
# nested multiple imputation
r2 <- list(nest1 = c(0.12395, 0.15261, 0.16125, 0.11029, 0.1871),
           nest2 = c(0.10603, 0.08876, 0.09248, 0.13331, 0.1114),
           nest3 = c(0.17228, 0.25203, 0.13132, 0.23331, 0.10069))
Ns <- lapply(1:3, FUN = function (x) {rep(290, 5)})
pool.R2 ( r2=r2, N=Ns)
# without standard error
pool.R2 ( r2=r2)

weirichs/eatRep documentation built on June 11, 2025, 11:43 a.m.