p_lm.R2: p-value from global linear regression model simulation

View source: R/p_lm.R2.R

p_lm.R2R Documentation

p-value from global linear regression model simulation

Description

p-values associated with linear regression model using fixed/random independent variables. Focus is on the omnibus behavior of the R^2 statistic.

Usage

p_lm.R2(n, R2, k, R2_0 = 0, k.R2_0 = 0, R2.resid = 1 - R2, fixed = TRUE, ...)

Arguments

n

sample size

R2

R-squared effect size

k

number of IVs

R2_0

null hypothesis for R-squared

k.R2_0

number of IVs associated with the null hypothesis model

R2.resid

residual R-squared value, typically used when comparing nested models when fit sequentially (e.g., comparing model A vs B when model involves the structure A -> B -> C)

fixed

logical; if FALSE then the data are random generated according to a joint multivariate normal distribution

...

additional arguments to be passed to gen_fun. Not used unless a customized gen_fun is defined

Value

a single p-value

Author(s)

Phil Chalmers rphilip.chalmers@gmail.com

See Also

p_glm

Examples


# 5 fixed IVs, R^2 = .1, sample size of 95
p_lm.R2(n=95, R2=.1, k=5)

# random model
p_lm.R2(n=95, R2=.1, k=5, fixed=FALSE)


Spower documentation built on April 4, 2025, 5:11 a.m.