View source: R/convert_comp_to_log.R
| convert_comp_to_log | R Documentation |
Converts raw "proportion-of-total" or points-allocation data (where respondents distribute a fixed sum of points within blocks) into continuous log-ratios suitable for continuous Thurstonian factor modeling. Implements Aitchison's geometry and handles zero-responses securely.
Note that because both n_blocks and block_size are required,
only the first n_blocks * block_size columns in data will be
extracted. Make sure the input data does not contain additional irrelevant columns!
convert_comp_to_log(data, n_blocks, block_size, delta = 0.5)
data |
A compositional data frame or matrix where rows are respondents and columns are items ordered by block (e.g., Block 1 Item 1, Block 1 Item 2, etc.). |
n_blocks |
Integer. Number of blocks in the questionnaire. |
block_size |
Integer. Number of items per block. |
delta |
Numeric. The value used to impute zero responses. Must be smaller than
the smallest possible positive score (e.g., if users can allocate integers
starting at 1, the default |
A data frame of continuous log-ratios. Column names will be formatted as "y1y3", "y2y3" representing the log-ratio of Item 1 to the referent Item 3.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.