wp.mc.t: Power analysis for t-test based on Monte Carlo simulation

View source: R/webpower.R

wp.mc.tR Documentation

Power analysis for t-test based on Monte Carlo simulation

Description

Power analysis for t-test based on Monte Carlo simulation

Usage

wp.mc.t(n = NULL, R0 = 1e+05, R1 = 1000, mu0 = 0, mu1 = 0, 
sd = 1, skewness = 0, kurtosis = 3, alpha = 0.05, 
type = c("two.sample", "one.sample", "paired"), 
alternative = c("two.sided", "less", "greater"))

Arguments

n

Sample size

R0

Number of replications under the null

R1

Number of replications

mu0

Population mean under the null

mu1

Population mean under the alternative

sd

Standard deviation

skewness

Skewness

kurtosis

kurtosis

alpha

Significance level

type

Type of anlaysis

alternative

alternative hypothesis

References

Zhang, Z., & Yuan, K.-H. (2018). Practical Statistical Power Analysis Using Webpower and R (Eds). Granger, IN: ISDSA Press.

Examples


set.seed(20220722)
########## Chapter 16. Monte Carlo t-test #############
wp.mc.t(n=20 , mu0=0, mu1=0.5, sd=1, skewness=0, 
kurtosis=3, type = c("one.sample"), alternative = c("two.sided"))

wp.mc.t(n=40 , mu0=0, mu1=0.3, sd=1, skewness=1, 
kurtosis=6, type = c("paired"), alternative = c("greater"))

wp.mc.t(n=c(15, 15), mu1=c(0.2, 0.5), sd=c(0.2, 0.5), 
skewness=c(1, 2), kurtosis=c(4, 6), type = c("two.sample"), alternative = c("less"))



WebPower documentation built on Oct. 14, 2023, 1:06 a.m.