Skip to contents

Given an existing partial eta squared for a term and a target partial eta squared, returns the multiplier k that must be applied to that term's additive contribution to the cell means in order to obtain the target effect size under the same residual structure.

Usage

compute_scale_factor(old_pes, new_pes)

Arguments

old_pes

Numeric scalar in (0, 1), or a numeric-looking character scalar such as ".310". The current partial eta squared for the term of interest.

new_pes

Numeric scalar in (0, 1), or a numeric-looking character scalar such as ".200". The target partial eta squared.

Value

A single positive numeric value k. k > 1 amplifies the effect, k < 1 shrinks it, and k == 1 leaves it unchanged.

Details

The derivation is straightforward: partial eta squared can be written as pes = SS_effect / (SS_effect + C), where C is the part of the denominator held fixed by this package's rescaling. Thus pes / (1 - pes) scales as the target effect's sum of squares. Scaling the term's deviations by k scales the target effect's sum of squares by k^2, so the required multiplier is $$k = \sqrt{\frac{p_{\mathrm{new}} / (1 - p_{\mathrm{new}})} {p_{\mathrm{old}} / (1 - p_{\mathrm{old}})}}.$$

Examples

compute_scale_factor(0.10, 0.05)   # shrink
#> [1] 0.6882472
compute_scale_factor(0.05, 0.10)   # amplify
#> [1] 1.452966