pomps: Recode Numeric Data to Percentage of Maximum Possible (POMP)...

Description Usage Arguments Details Value See Also Examples

View source: R/quest_functions.R

Description

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).

Usage

1
2
3
4
5
6
7
8
9
pomps(
  data,
  vrb.nm,
  mini,
  maxi,
  relative = FALSE,
  unit = 1,
  suffix = paste0("_p", unit)
)

Arguments

data

data.frame of data.

vrb.nm

character vector of colnames from data specifying the variables.

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 mini and maxi arguments are ignored. See details for the distinction between absolute and relative POMP scores.

unit

numeric vector of length 1 specifying how many percentage points is desired for the units. Traditionally, POMP scores use unit = 1 (default) such that one unit is one percentage point. However, another option is to use unit = 100 such that one unit is all 100 percentage points (i.e., proportion of maximum possible). This argument also gives the flexibility of specifying units in between 1 and 100 percentage points. For example, unit = 50 would mean that one unit represents going from low (i.e., 25th percentile) to high (i.e., 75th percentile) on the variable.

suffix

character vector of length 1 specifying the string to add to the end of the column names in the return object.

Details

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.

Value

data.frame of variables recoded to percentage of maximum possible (pomp) with units specified by unit and names specified by paste0(vrb.nm, suffix).

See Also

pomp

Examples

1
2
3
4
5
6
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")

quest documentation built on Sept. 10, 2021, 5:07 p.m.

Related to pomps in quest...