meank.anova: Analysis of Variance for Equality of Means

View source: R/meank_anova.R

meank.anovaR Documentation

Analysis of Variance for Equality of Means

Description

Given univariate samples X_1~,…,~X_k, it tests

H_0 : μ_1^2 = \cdots μ_k^2\quad vs\quad H_1 : \textrm{at least one equality does not hold.}

Usage

meank.anova(dlist)

Arguments

dlist

a list of length k where each element is a sample vector.

Value

a (list) object of S3 class htest containing:

statistic

a test statistic.

p.value

p-value under H_0.

alternative

alternative hypothesis.

method

name of the test.

data.name

name(s) of provided sample data.

Examples


## test when k=5 (samples)
## empirical Type 1 error 
niter   = 1000
counter = rep(0,niter)  # record p-values
for (i in 1:niter){
  mylist = list()
  for (j in 1:5){
     mylist[[j]] = rnorm(50)   
  }
  
  counter[i] = ifelse(meank.anova(mylist)$p.value < 0.05, 1, 0)
}

## print the result
cat(paste("\n* Example for 'meank.anova'\n","*\n",
"* number of rejections   : ", sum(counter),"\n",
"* total number of trials : ", niter,"\n",
"* empirical Type 1 error : ",round(sum(counter/niter),5),"\n",sep=""))



SHT documentation built on Nov. 3, 2022, 9:06 a.m.

Related to meank.anova in SHT...