Skip to contents

This function allows to calculate the critical beta.

Usage

critical_coef(
  seb,
  n = NULL,
  p = NULL,
  df = NULL,
  conf.level = 0.95,
  hypothesis = c("two.sided", "greater", "less"),
  test = c("t", "z")
)

Arguments

seb

a numeric vector of standard error of the regression coefficients.

n

a number corresponding to the sample size.

p

number of parameters.

df

degrees of freedom.

conf.level

the confidence level to set the confidence interval, default is set to 0.95.

hypothesis

a character string indicating the alternative hypothesis ("less", "greater" or "two.tailed").

test

a parameter to specify which test to apply, either "t" for a t-test or "z" for a z-test.

Value

the output returns the critical beta and the test used (either t or z).

Examples

# critical value from sample size and standard errors of the parameters
n <- 170
p = 3
seb <- c(25,.25,.10)
critical_coef(seb = seb,n = n, p = p)
#> $bc
#> [1] 49.3589441  0.4935894  0.1974358
#> 
#> $test
#> [1] "t"
#>