Description Usage Arguments Value See Also Examples
Softly DEPRECATED. Use impute.boot instead.
For one chemical, this function creates an imputed dataset using a bootstrap procedure as described in Lubin et al. 2004.
1 | impute.Lubin(chemcol, dlcol, Z = NULL, K = 5L, verbose = FALSE)
|
chemcol |
A numeric vector, the chemical concentration levels of length C. Censored values are indicated by NA. On original scale. |
dlcol |
The detection limit of the chemical. A value or a numeric vector of length C. Must be complete; a missing detection limit is ignored. |
Z |
Any covariates used in imputing the chemical concentrations. Ideally, a numeric matrix; however, Z can be a factor, vector, or data-frame. Assumed to be complete; observations with missing covariate variables are ignored in the imputation, with a warning printed. If none, enter NULL. |
K |
A natural number of imputed datasets to generate. Default: 5L. |
verbose |
Logical; if TRUE, prints more information. Useful to check for any errors in the code. Default: FALSE. |
A list of:
A matrix with n subjects and K imputed datasets is returned.
A n x K matrix of bootstrap indices selected for the imputation. Each column is saved as a factor.
A check; the sum of imputed missing values above detection limit, which should be 0.
Other imputation:
impute.boot()
,
impute.multivariate.bayesian()
,
impute.sub()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # ###Example 2: Simulation
# Apply to an example simulated dataset.
# A seed of 202 is executed before each run for reproducibility.
data(simdata87)
# No Covariates
set.seed(202)
results_Lubin <- impute.Lubin(chemcol = simdata87$X.bdl[, 1], dlcol = simdata87$DL[1],
K = 5, verbose = TRUE)
str(results_Lubin)
summary(results_Lubin$imputed_values)
# 1 Covariate
set.seed(202)
sim.z1 <- impute.Lubin(simdata87$X.bdl[, 1], simdata87$DL[1],
K = 5, Z = simdata87$Z.sim[, 1], verbose = TRUE)
summary(sim.z1$imputed_values)
# 2 Covariates
set.seed(202)
sim.z2 <- impute.Lubin(simdata87$X.bdl[, 1], simdata87$DL[1],
K = 5, Z = simdata87$Z.sim[, -2])
summary(sim.z2$imputed_values)
summary(sim.z2$bootstrap_index)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.