Learn R Programming

balance (version 0.2.4)

ssWithin: Calculate Within-Group Log-ratio Sums of Squares

Description

This function calculates the within-group sums of squares for all variables or all log-ratios. This function only supports binary outcomes.

Usage

ssWithin(x, group, pairwise = FALSE, ...)

Arguments

x

A matrix with rows as samples (N) and columns as components (D).

group

A character vector. Group or sub-group membership. Argument passed to propr::propd.

pairwise

A logical. Toggles whether to decompose sums of squares for each log-ratio.

...

Other arguments passed to propr::propd.

Value

If pairwise = FALSE, this function returns a vector of the sums of squares for each variable. If pairwise = TRUE, this function returns a matrix of the sums of squares for each log-ratio.