pt_qc | R Documentation |
This function helps users to conduct quality control on purchase task data to remove non-systematic data. See details for specific QC criteria.
pt_qc(
pt,
id_var,
type = NULL,
delta_q = 0.025,
bounce_g = 0.05,
bounce_l = 0.1,
jump = 0.25,
rev_n = 0,
cons_0 = 1
)
pt |
A data frame consisting of the 'id_var' and purchase task variables. |
id_var |
The name of the unique identifier (ID) as identified in the data frame. |
type |
The type of quality control (QC) to apply, one of c("full","partial"). The "full" type of QC processing is used to process purchase task data which administers all price points, regardless of consumption responses. The "partial" type of QC processing is used to process purchase task data which uses consumption responses to determine when to end administration, either at the first instance when consumption reaches zero, or at the end of a price array when zero consumption is reached. Additionally, for type "partial", zero responses will be added to items not administered. |
delta_q |
The log reduction in consumption from the first to last price. The default is set to 0.025 (suggested by Stein et al., 2015), with values lower than 0.025 deemed non-systematic. If there is zero consumption across all price points, participants are not excluded, and instead will be given a delta-Q value of NA. |
bounce_g |
Expressed as a proportion, the global bounce value is used as a threshold to identify excessive inconsistencies in consumption at all subsequent prices following the first price point (P1). The default global bounce value is 0.05, and IDs exceeding this global bounce value are deemed non-systematic. |
bounce_l |
Expressed as a proportion, the local bounce value is used as a threshold to identify excessive inconsistencies in consumption at price P relative to price P - 1. A local bounce threshold is defined as instances where consumption at price P is > consumption at price P - 1. The default local bounce value is 0.1, and IDs exceeding this local bounce value are deemed non-systematic. |
jump |
Expressed as a proportion, the jump value is the percent increase in consumption used to define a global bounce. The default is 0.25 (25% as suggested by Stein et al., 2015), with consumption 25% higher than consumption at first price considered an excessive jump in consumption. |
rev_n |
The number of acceptable reversals from zero, one of c(0,1). The default number is 0, meaning any reversals from zero are deemed non-systematic. |
cons_0 |
The number of consecutive zeroes to signify a reversal from zero, one of c(1,2). The default is 1. |
Quality control options follow the proposed 4-criterion method which is based on the Stein et al. (2015) 3-criterion method, and removes IDs with:
i) trend violations;
ii) excessive global bounce ratios;
iii) excessive local bounce ratios; and
iv) excessive reversals in responses.
However, these criteria can also be customized, accommodating differences of purchase tasks or sub-populations. Additionally, quality control can be applied to partially-administered purchase tasks, such as in the case that administration of the purchase task ceased after breakpoint, or after zero consumption was reached within a price array.
Trend violations are identified by delta-Q values lower than the set threshold. Delta-Q is defined as the log-unit reduction in consumption from the first to last price. However, if it is decided (in the 'pt_prep()' step) that those with zero consumption across the purchase task are acceptable, then these participants would have a delta-Q of NA.
In general, bounces in consumption refer to the proportion of responses in which estimated consumption at a higher price exceeds the estimated consumption at a lower price. However, there are two methods of identifying excessive bounce ratios, each of which serve a different purpose in identifying systematic data: a) global increases in consumption at any price compared to consumption at the first price (intensity); and b) local increases in consumption at price P relative to the consumption at the price point preceding price P (i.e. P - 1). As consumption values exceeding the global bounce threshold impact both empirical and derived demand indicators, consumption exceeding the set global bounce value (defined by the 'jump' argument) are re-assigned to this maximum allowed value.
Excessive reversals in consumption are defined by whether 0 or 1 reversals in consumption are allowed, and whether a reversal consists of 1 or 2 consecutive responses of 0 consumption. Outside of this definition, any additional zero values followed by non-zero consumption are considered non-systematic. For example, in instances of 2 consecutive zero responses defined as a reversal, an additional single zero value elsewhere would not pass the reversals portion of quality control.
Stein, J. S., Koffarnus, M. N., Snider, S. E., Quisenberry, A. J., & Bickel, W. K. (2015). Identification and management of nonsystematic purchase task data: Toward best practice. Experimental and clinical psychopharmacology, 23(5), 377.
A list consisting of two data frames: "data" which consists of the 'id_var' and purchase task variables, and "qc_data" which provides details on the results of quality control for all IDs.
### --- Load Data
data("cpt_data")
### --- Prep Data
pt <- price_prep(cpt_data, id_var = "ID", vars = c(paste0("cpt",1:15)),
prices = c("0","0.05","0.10","0.20","0.30","0.40","0.50", "0.75","1","2","3","4","5","7.5","10"))
pt2 <- pt_prep(pt, id_var = "ID", type = "partial", remove0 = TRUE, max_val = 99)
### --- Function Example
pt3 <- pt_qc(pt2, id_var = "ID", type = "partial")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.