View source: R/impute_artifacts.R
impute_artifacts | R Documentation |
Impute missing and impossible artifact values
impute_artifacts( sample_id = NULL, construct_id = NULL, measure_id = NULL, art_vec, cat_moderator_matrix, impute_method = "bootstrap_mod", art_type = "rel", n_vec = rep(1, length(art_vec)) )
sample_id |
Study ID value. |
construct_id |
Construct name or other designator. |
measure_id |
Measure name or other designator. |
art_vec |
Vector of artifact values |
cat_moderator_matrix |
Matrix of categorical moderators |
impute_method |
Method to use for imputing artifacts. Choices are:
|
art_type |
Type of artifacts to be imputed: "rel" for reliabilities and "u" for u ratios. |
n_vec |
Vector of sample sizes associated with the elements of art_vec. |
A vector of artifacts that includes imputed values.
# art_vec <- c(.6, .7, NA, .8, .9, NA) # cat_moderator_matrix <- matrix(c(rep(1, 3), rep(2, 3))) # art_type <- "rel" # n_vec <- c(50, 200, 100, 50, 200, 100) # # ## Compute unweighted means # impute_artifacts(art_vec = art_vec, cat_moderator_matrix = cat_moderator_matrix, # impute_method = "unwt_mean_full", art_type = art_type, n_vec = n_vec) # impute_artifacts(art_vec = art_vec, cat_moderator_matrix = cat_moderator_matrix, # impute_method = "unwt_mean_mod", art_type = art_type, n_vec = n_vec) # # ## Compute weighted means # impute_artifacts(art_vec = art_vec, cat_moderator_matrix = cat_moderator_matrix, # impute_method = "wt_mean_full", art_type = art_type, n_vec = n_vec) # impute_artifacts(art_vec = art_vec, cat_moderator_matrix = cat_moderator_matrix, # impute_method = "wt_mean_mod", art_type = art_type, n_vec = n_vec) # # ## Simulate from distribution with the mean and variance of the observed artifacts # impute_artifacts(art_vec = art_vec, cat_moderator_matrix = cat_moderator_matrix, # impute_method = "simulate_full", art_type = art_type, n_vec = n_vec) # impute_artifacts(art_vec = art_vec, cat_moderator_matrix = cat_moderator_matrix, # impute_method = "simulate_mod", art_type = art_type, n_vec = n_vec) # # ## Sample random values from the observed distribution of artifacts # impute_artifacts(art_vec = art_vec, cat_moderator_matrix = cat_moderator_matrix, # impute_method = "bootstrap_mod", art_type = art_type, n_vec = n_vec) # impute_artifacts(art_vec = art_vec, cat_moderator_matrix = cat_moderator_matrix, # impute_method = "bootstrap_full", art_type = art_type, n_vec = n_vec) # # ## If all values are missing from a moderator category, the program will run # ## full-data imputation on the remaining missing values: # impute_artifacts(art_vec = c(NA, NA, NA, .7, .8, .9), cat_moderator_matrix = cat_moderator_matrix, # impute_method = "bootstrap_mod", art_type = art_type, n_vec = n_vec)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.