p-values associated with the simple linear regression model, \(y = \beta_0 + \beta_1 X + \epsilon\). Focus is on the slope/intercept behavior of the model.
Usage
p_slr(
n,
beta,
sd_x,
sd_y,
beta0 = 0,
test = "x = 0",
gen_fun = gen_slr,
return_analysis = FALSE,
...
)
gen_slr(n, beta, sd_x, sd_y, ...)Arguments
- n
sample size
- beta
slope parameter
- sd_x
standard deviation of IV
- sd_y
standard deviation of DV
- beta0
null value to test against
- test
test to evaluate using
lht. Default evaluates the null hypothesis that the slope is equal to 0- gen_fun
function used to generate the required X-Y data. Object returned must be a
data.framewith the columns'y'and'x'. Default usesgen_slr. User defined version of this function must include the argument...- return_analysis
logical; return the analysis object for further extraction and customization?
- ...
additional arguments to be passed to
gen_fun. Not used unless a customizedgen_funis defined
Author
Phil Chalmers rphilip.chalmers@gmail.com
Examples
p_slr(n=100, beta = -0.0667, sd_x = 7.5, sd_y = 4)
#> [1] 0.04544346
if (FALSE) { # \dontrun{
p_slr(n=100, beta = -0.0667, sd_x = 7.5, sd_y = 4) |> Spower()
} # }