View source: R/systematic-wrappers.R
| check_systematic_demand | R Documentation |
Modern interface for screening purchase task data using Stein et al. (2015)
criteria. Returns a structured object with standardized output vocabulary
that is consistent with check_systematic_cp().
check_systematic_demand(
data,
trend_threshold = 0.025,
bounce_threshold = 0.1,
max_reversals = 0,
consecutive_zeros = 2,
x_var = "x",
y_var = "y",
id_var = "id"
)
data |
Data frame in long format with columns: |
trend_threshold |
Numeric. Threshold for trend detection (log-log slope).
Default |
bounce_threshold |
Numeric. Threshold for bounce proportion. Default |
max_reversals |
Integer. Maximum allowed reversals from zero. Default |
consecutive_zeros |
Integer. Consecutive zeros required for reversal detection.
Default |
x_var |
Character. Name of the price column. Default |
y_var |
Character. Name of the consumption column. Default |
id_var |
Character. Name of the subject identifier column. Default |
The results tibble contains standardized columns for both demand and
cross-price systematicity checks:
Subject identifier
"demand" for this function
DeltaQ statistic (log-log slope)
Threshold used
"down", "up", or "none"
Logical: passed trend criterion
Bounce proportion
Threshold used
"significant" or "none"
Logical: passed bounce criterion
Count of reversals from zero
Logical: passed reversals criterion
NA for demand (CP-specific)
Count of positive values
Logical: passed all criteria
An object of class beezdemand_systematicity with components:
Tibble with one row per subject containing systematicity metrics
"demand"
The original function call
Total number of subjects
Number of subjects passing all criteria
Number of subjects failing at least one criterion
data(apt)
check <- check_systematic_demand(apt)
print(check)
summary(check)
tidy(check)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.