View source: R/systematic-wrappers.R
| check_systematic_cp | R Documentation |
Modern interface for screening cross-price data with standardized output
vocabulary aligned with check_systematic_demand().
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"
)
data |
Data frame with columns: |
trend_threshold |
Numeric. Threshold for trend detection. Default |
bounce_threshold_down |
Numeric. Bounce threshold for upward trends. Default |
bounce_threshold_up |
Numeric. Bounce threshold for downward trends. Default |
bounce_threshold_none |
Numeric. Bounce threshold when no trend. Default |
consecutive_zeros |
Integer. Zeros for reversal detection. Default |
consecutive_nonzeros |
Integer. Non-zeros for return detection. Default |
expected_down |
Logical. Suppress reversal detection if TRUE. 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 |
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_direction and bounce_direction are taken directly from the legacy
function outputs.
trend_pass is set to NA because 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_stat is reported as the proportion relevant to the legacy bounce
rule for the detected trend_direction (or expected_down case), computed
from the legacy bounce counts and the number of price steps.
An object of class beezdemand_systematicity with the same structure
as check_systematic_demand(), with type = "cp".
data(etm)
check <- check_systematic_cp(etm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.