Learn R Programming

psychmeta (version 2.6.4)

sparsify_simdat_r: Create sparse artifact information in a "simdat_r_database" class object

Description

This function can be used to randomly delete artifact from databases produced by the simulate_r_database function. Deletion of artifacts can be performed in either a study-wise fashion for complete missingness within randomly selected studies or element-wise missingness for completely random deletion of artifacts in the database. Deletion can be applied to reliability estimates and/or u ratios.

Usage

sparsify_simdat_r(
  data_obj,
  prop_missing,
  sparify_arts = c("rel", "u"),
  study_wise = TRUE
)

Value

A sparsified database

Arguments

data_obj

Object created by the "simdat_r_database" function.

prop_missing

Proportion of studies in from which artifact information should be deleted.

sparify_arts

Vector of codes for the artifacts to be sparsified: "rel" for reliabilities, "u" for u ratios, or c("rel", "u") for both.

study_wise

Logical scalar argument determining whether artifact deletion should occur for all variables in a study (TRUE) or randomly across variables within studies (FALSE).