1-One-Mean: One Mean against a Constant (z or t Test)

pwrss.t.meanR Documentation

One Mean against a Constant (z or t Test)

Description

Calculates statistical power or minimum required sample size (only one can be NULL at a time) to test a mean against a constant.

Formulas are validated using http://powerandsamplesize.com/, and tables in PASS documentation.

Usage

pwrss.t.mean(mu, sd = 1, mu0 = 0, margin = 0, alpha = 0.05,
             alternative = c("not equal","greater","less",
                             "equivalent","non-inferior","superior"),
             n = NULL, power = NULL, verbose = TRUE)

pwrss.z.mean(mu, sd = 1, mu0 = 0, margin = 0, alpha = 0.05,
             alternative = c("not equal","greater","less",
                             "equivalent","non-inferior","superior"),
             n = NULL, power = NULL, verbose = TRUE)

Arguments

mu

expected mean

sd

expected standard devation

mu0

constant to be compared (a mean)

n

sample size

power

statistical power (1-\beta)

alpha

probability of type I error

margin

non-inferority, superiority, or equivalence margin (margin: boundry of mu - mu0 that is practically insignificant)

alternative

direction or type of the hypothesis test: "not equal", "greater", "less", "equivalent", "non-inferior", or "superior"

verbose

if FALSE no output is printed on the console

Value

parms

list of parameters used in calculation

test

type of the statistical test (z or t test)

ncp

non-centrality parameter

df

degrees of freedom

power

statistical power (1-\beta)

n

sample size

References

Bulus, M., & Polat, C. (in press). pwrss R paketi ile istatistiksel guc analizi [Statistical power analysis with pwrss R package]. Ahi Evran Universitesi Kirsehir Egitim Fakultesi Dergisi. https://osf.io/ua5fc/download/

Examples

# Example: A researcher is expecting a score of 23
# on Beck depression inventory (BDI) which is
# 0.50 standard devation above the threshold value 20
# (assume standard deviation of BDI scores is 6).

# to find that a score of 23 is greater than the threshold 20
pwrss.t.mean(mu = 23, mu0 = 20, sd = 6,
             alpha = 0.05, power = 0.80,
             alternative = "greater")
# standardized formulation
pwrss.t.mean(mu = 0.50, mu0 = 0, sd = 1,
             alpha = 0.05, power = 0.80,
             alternative = "greater")

pwrss documentation built on April 12, 2023, 12:34 p.m.