reshape_incremental_design_into_unique_exposure_test_combinations: Prepare long data from incremental exposure-test design for...

reshape_incremental_design_into_unique_exposure_test_combinationsR Documentation

Prepare long data from incremental exposure-test design for input to Stan

Description

Takes data.frame or tibble that contains the exposure and test data from an incremental exposure-test design in long format, and prepares it for input to the ideal_adaptor_stanfit Stan programs. This is done by pretending that each incremental test block (and its preceding exposure) constitute a separate between-participant condition. Note that this does not capture the dependency between test responses of participants in the same between-participant conditions, but such dependencies are not modeled by current 'MVBeliefUpdatr' Stan programs anyway (which do not include random effects by participants).

Usage

reshape_incremental_design_into_unique_exposure_test_combinations(
  data,
  group = "Group",
  phase = "Phase",
  block = "Block",
  join_adjacent_test_blocks = FALSE,
  verbose = FALSE
)

Arguments

data

Data frame or tibble to be sliced. Each row should be a single exposure or test observation.

group

Character string indicating the name of the column that contains the information about the between-participant condition. (default: "Group")

phase

Character string indicating the name of the column that contains the information about whether an observation is part of "exposure" or "test". This column must contain the values "exposure" and "test". Observation with other values will be ignored. (default: "Phase")

block

Character string indicating the name of the column that contains the information about the incremental exposure and test blocks. Must be a factor with the levels indicating the order of the blocks. (default: "Block")

join_adjacent_test_blocks

Logical indicating whether adjacent test blocks without intervening exposure blocks should be joined into a single test block. This will speed up fit_ideal_adapor since there will be fewer conditions to iterate over but also means that the default plotting functions won't be able to plot the results of the different test blocks separately. (default: 'FALSE')

verbose

Should verbose output be provided? (default: 'FALSE')

Value

A data frame or tibble in long format with a new column "ExposureGroup" that contains a unique label for each unique combination of 'group' and 'block'.


hlplab/MVBeliefUpdatr documentation built on July 5, 2025, 6:42 a.m.