powered_lm: Compute lm's post-hoc power

View source: R/powered_lm.R

powered_lmR Documentation

Compute lm's post-hoc power

Description

Compute lm's post-hoc power

Usage

powered_lm(PRE = 0.04, PC = 1L, PA = 2L, n = 200L, sig_level = 0.05)

Arguments

PRE

Proportional Reduction in Error. PRE = The square of partial correlation. Cohen (1988) suggested >=0.02, >=0.13, and >=0.26 as cut-off values of PRE for small, medium, and large effect sizes, respectively.

PC

Number of parameters of model C (compact model) without focal predictors of interest. Non-integer PC would be converted to be an integer using as.integer().

PA

Number of parameters of model A (augmented model) with focal predictors of interest. Non-integer PA would be converted to be an integer using as.integer(). as.integer(PA) should be larger than as.integer(PC).

n

The current sample size. Integer n should be at least PA + 1L.

sig_level

Expected significance level for effects of focal predictors.

Value

Integer n, the F_test of PRE at the sample size n with df_A_C, df_A (the df of the model A at the sample size n), F (the F-test of PRE at the sample size n), p (the p-value of F-test at the sample size n), and the post-hoc power analysis with lambda (the non-centrality parameter of F at the sample size n), and power (the post-hoc power at the sample size n).

Examples

powered_lm()

Keng documentation built on Sept. 1, 2026, 5:07 p.m.