
Check Cross-Price Data for Unsystematic Responding
Source:R/systematic-wrappers.R
check_systematic_cp.RdModern interface for screening cross-price data with standardized output
vocabulary aligned with check_systematic_demand().
Usage
check_systematic_cp(
data,
trend_threshold = 0.025,
bounce_threshold_down = 0.1,
bounce_threshold_up = 0.1,
bounce_threshold_none = 0.1,
consecutive_zeros = 2,
consecutive_nonzeros = 2,
expected_down = FALSE,
x_var = "x",
y_var = "y",
id_var = "id"
)Arguments
- data
Data frame with columns:
id(optional),x(price),y(consumption).- trend_threshold
Numeric. Threshold for trend detection. Default
0.025.- bounce_threshold_down
Numeric. Bounce threshold for upward trends. Default
0.1.- bounce_threshold_up
Numeric. Bounce threshold for downward trends. Default
0.1.- bounce_threshold_none
Numeric. Bounce threshold when no trend. Default
0.1.- consecutive_zeros
Integer. Zeros for reversal detection. Default
2.- consecutive_nonzeros
Integer. Non-zeros for return detection. Default
2.- expected_down
Logical. Suppress reversal detection if TRUE. Default
FALSE.- x_var
Character. Name of the price column. Default
"x".- y_var
Character. Name of the consumption column. Default
"y".- id_var
Character. Name of the subject identifier column. Default
"id".
Value
An object of class beezdemand_systematicity with the same structure
as check_systematic_demand(), with type = "cp".
Details
If the data contains an id column (or column specified by id_var), each
unique ID is checked separately. Otherwise, the entire dataset is treated
as a single pattern.
For cross-price data, the wrapper preserves the legacy meaning of
check_unsystematic_cp():
trend_directionandbounce_directionare taken directly from the legacy function outputs.trend_passis set toNAbecause cross-price systematicity does not use a separate trend “pass/fail” criterion in the same way as purchase-task screening; instead, trend classification determines which bounce rule applies.bounce_statis reported as the proportion relevant to the legacy bounce rule for the detectedtrend_direction(orexpected_downcase), computed from the legacy bounce counts and the number of price steps.
Examples
data(etm)
check <- check_systematic_cp(etm)