convert_comp_to_log: Convert Compositional Points Data to Log-Ratios

View source: R/convert_comp_to_log.R

convert_comp_to_logR Documentation

Convert Compositional Points Data to Log-Ratios

Description

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!

Usage

convert_comp_to_log(data, n_blocks, block_size, delta = 0.5)

Arguments

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 0.5 is optimal).

Value

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.


autoFC documentation built on July 14, 2026, 5:07 p.m.