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,
  return_analysis = FALSE,
  ...
)

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

return_analysis

logical; return the analysis object for further extraction and customization?

...

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)

# return analysis model
p_lm.R2(n=95, R2=.1, k=5, return_analysis=TRUE)


Spower documentation built on Nov. 28, 2025, 1:06 a.m.