View source: R/quest_functions.R
pomps | R Documentation |
pomps
recodes numeric data to percentage of maximum possible (POMP)
units. This can be useful when data is measured with arbitrary units (e.g.,
Likert scale).
pomps(
data,
vrb.nm,
mini,
maxi,
relative = FALSE,
unit = 1,
suffix = paste0("_p", unit)
)
data |
data.frame of data. |
vrb.nm |
character vector of colnames from |
mini |
numeric vector of length 1 specifying the minimum numeric value possible. Note, this is assumed to be the same for each variable. |
maxi |
numeric vector of length 1 specifying the maximum numeric value possible. Note, this is assumed to be the same for each variable. |
relative |
logical vector of length 1 specifying whether relative POMP
scores (rather than absolute POMP scores) should be created. If TRUE, then
the |
unit |
numeric vector of length 1 specifying how many percentage points
is desired for the units. Traditionally, POMP scores use |
suffix |
character vector of length 1 specifying the string to add to the end of the column names in the return object. |
There are too common approaches to POMP scores: 1) absolute POMP units where the minimum and maximum are the smallest/largest values possible from the measurement instrument (e.g., 1 to 7 on a Likert scale) and 2) relative POMP units where the minimum and maximum are the smallest/largest values observed in the data (e.g., 1.3 to 6.8 on a Likert scale). Both will be correlated perfectly with the original units as they are each linear transformations.
data.frame of variables recoded to percentage of maximum possible
(pomp) with units specified by unit
and names specified by
paste0(vrb.nm, suffix)
.
pomp
vrb_nm <- names(psych::bfi)[grepl(pattern = "A", x = names(psych::bfi))]
pomps(data = psych::bfi, vrb.nm = vrb_nm, min = 1, max = 6) # absolute POMP units
pomps(data = psych::bfi, vrb.nm = vrb_nm, relative = TRUE) # relative POMP units
pomps(data = psych::bfi, vrb.nm = vrb_nm, min = 1, max = 6, unit = 100) # unit = 100
pomps(data = psych::bfi, vrb.nm = vrb_nm, min = 1, max = 6, unit = 50) # unit = 50
pomps(data = psych::bfi, vrb.nm = vrb_nm, min = 1, max = 6, suffix = "_pomp")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.