score_dusi | R Documentation |
Score the Short Version of the Revised Drug Use Screening Inventory (DUSI-R) (Tarter, 1990)
score_dusi(
df,
item_prefix = "DUSI_",
max_impute = 0.2,
drop_items = FALSE,
input_codes = c(0, 1),
false_value = 0,
true_value = 1,
bad_items = NULL,
add_alphas = TRUE
)
df |
a data.frame containing the 15 DUSI-R SF items to be scored |
item_prefix |
a character prefix of the items names in |
max_impute |
the proportion of missingness [0..1) or number [1..n] of missing values per scale. Default: 0.2 Below this threshold, the person subscale mean will be imputed for missing items. |
drop_items |
whether to remove the item-level data from the |
input_codes |
the original T/F coding scheme of the input data.frame in the form c(False Code, True Code). These are converted to the specified false and true value. |
false_value |
the 'False' value for the item anchors, used in score validation. Default: 0 |
true_value |
the 'True' value for the item anchors, used in score validation. Default: 1 |
bad_items |
numeric value or vector of the items that need to be dropped before imputation or calculation of subscales |
add_alphas |
whether to compute coefficient alpha for the total scale and return a column attribute. Default: TRUE |
Adds two columns, DUSI_total
and DUSI_density
, to df
containing the sum of scores and
mean of the items for the scales (i.e., the "absolute problem density"), respectively.
Note: the code assumes that pasting together the item_prefix
and the numbers 1:15
will yield the 15 items from the test.
Michael Hallquist, Zach Vig
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.