This function preprocesses data for use in Bayesian Aldrich-McKelvey (BAM) scaling. It handles missing values, centers the data, and separates the self-placement from the stimuli placements.
Arguments
- x
A numeric matrix or dataframe containing the data to be preprocessed.
- nmin
Integer, the minimum number of non-missing values required per row (default is 1).
- missing
A vector of values that should be treated as missing (e.g.,
c(77, 88, 99)
).- self
Integer, the column number representing self-placement (default is 1).
- midpt
Numeric, the midpoint used for centering the data. If NULL, the midpoint is calculated as the mean of the minimum and maximum values.