Package 'doex'

Title: The One-Way Heteroscedastic ANOVA Tests
Description: Contains the heteroscedastic ANOVA tests for normal and two-parameter exponential distributed populations. For normal distributions, Alexander-Govern test by Alexandern and Govern (1994) <doi:10.2307/1165140>, Alvandi et al. Generalized F test by Alvandi et al. (2012) <doi:10.1080/03610926.2011.573160>, Approximate F test by Asiribo and Gurland (1990) <doi:10.1080/03610929008830427>, Box F test by Box (1954) <doi:10.1214/aoms/1177728786>, Brown-Forsythe test by Brown and Forsythe (1974) <do:10.2307/1267501>, B2 test by Ozdemir and Kurt (2006) <http://sjam.selcuk.edu.tr/sjam/article/view/174>, Cochran F test by Cochran (1937) <https://www.jstor.org/stable/pdf/2984123.pdf>, Fiducial Approach test by Li et al. (2011) <doi:10.1016/j.csda.2010.12.009>, Generalized F test by Weerahandi (1995) <doi:10.2307/2532947>, Johansen F test by Johansen (1980) <doi:10.1093/biomet/67.1.85>, Modified Brown-Forsythe test by Mehrotra (1997) <doi:10.1080/03610919708813431>, Modified Welch test by Hartung et al.(2002) <doi:10.1007/s00362-002-0097-8>, One-Stage test by Chen and Chen (1998) <doi:10.1080/03610919808813501>, One-Stage Range test by Chen and Chen (2000) <doi:10.1080/01966324.2000.10737505>, Parametric Bootstrap test by Krishnamoorhty et al.(2007) <doi:10.1016/j.csda.2006.09.039>, Permutation F test by Berry and Mielke (2002) <doi:10.2466/pr0.2002.90.2.495>, Scott-Smith test by Scott and Smith (1971) <doi:10.2307/2346757>, Welch test by Welch(1951) <doi:10.2307/2332579>, and Welch-Aspin test by Aspin (1948) <doi:10.1093/biomet/35.1-2.88>. These tests are used to test the equality of group means under unequal variance. Also, a modified version of Generalized F-test is improved to test the equality of non-normal group means under unequal variances and a revised version of Generalized F-test is given to test the equality of non-normal group means caused by skewness. Furthermore, it consists some procedures for testing equality of several two-parameter exponentially distributed population means under unequal scale parameters such as generalized p-value, parametric bootstrap and fiducial approach test by Malekzadeh and Jafari (2019) <doi:10.1080/03610918.2018.1538452>. There is also Hsieh test by Hsieh (1986) <doi:10.2307/1270452> for testing equality of location parameters of two-parameter exponentially distributed populations under unequal scale parameters.
Authors: Mustafa CAVUS, Berna YAZICI
Maintainer: Mustafa CAVUS <[email protected]>
License: GPL (>= 2)
Version: 1.2
Built: 2025-01-27 05:40:12 UTC
Source: https://github.com/cran/doex

Help Index


Approximate F-test

Description

This function performs Approximate F-test.

Usage

AF(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

pvalue

the p-value of the Approximate F-test

Author(s)

Mustafa CAVUS

References

Asiribo, O. and Gurland, J. (1990) Coping with variance heterogeneity, Communications in Statistics: Theory and Methods, 19(11), 4029-4048.

Examples

library(doex)
AF(hybrid$data,hybrid$species)

Alexandern-Govern test

Description

This function performs Alexander-Govern test.

Usage

AG(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

test.statistic

the test statistic of the Alexander-Govern test

p.value

the p-value of the Alexander-Govern test

Author(s)

Mustafa CAVUS

References

Alexander, R.A., Govern, D.M. (1994) A new and simplier approximation for ANOVA under variance heterogeneity, Journal of Educational Statistics, 19(2), 91-101.

Examples

library(doex)
AG(hybrid$data,hybrid$species)

Alvandi et al. Generalized F-test

Description

This function performs Alvandi et al. Generalized F-test.

Usage

AGF(data,group,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

rept

The loop size to perform the test.

Value

pvalue

the p-value of the Alvandi et al. Generalized F-test

Author(s)

Mustafa CAVUS

References

Sadooghi-Alvandi, S.M., Jafari, A.A., Mardani-Fard, H.A. (2012) One-way ANOVA with unequal variances, Communications in Statistics: Theory and Methods, 41, 4200-4221.

Examples

library(doex)
AGF(hybrid$data,hybrid$species,10000)

B-square test

Description

This function performs B-square test.

Usage

B2(alpha,data,group)

Arguments

alpha

significance level of the test.

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

p.value

the p-value of the B-square test

Author(s)

Mustafa CAVUS

References

Özdemir, A.F. and Kurt, S. (2006) One way fixed effect analysis of variance under variance heterogeneity and a solution proposal, Selçuk Journal of Applied Mathematics, 7(2), 81-90.

Examples

library(doex)
B2(0.05,hybrid$data,hybrid$species)

Brown-Forsythe test

Description

This function performs Brown-Forsythe test.

Usage

BF(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

pvalue

the p-value of the Brown-Forsythe test

Author(s)

Mustafa CAVUS

References

Brown, M.B. and Forsythe, A.B. (1974) The small sample behavior of some statistics which test the equality of several means, Technometrics, 16, 129–132.

Examples

library(doex)
BF(hybrid$data,hybrid$species)

Box F-test

Description

This function performs Box F-test.

Usage

BX(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

pvalue

the p-value of the Box F-test

Author(s)

Mustafa CAVUS

References

Box, G.E.P. (1954) Some theorems on quadratic forms applied in the study of analysis of variance problems, Annals of Mathematical Statistics, 25, 290-302.

Examples

library(doex)
BX(hybrid$data,hybrid$species)

Cochran F-test

Description

This function performs Cochran F-test.

Usage

CF(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

pvalue

the p-value of the Cochran F-test

Author(s)

Mustafa CAVUS

References

Cochran, W.G. (1937) Problems arising in the analysis of a series of similar experiments, Journal of the Royal Statistical Society, 4, 102-118.

Examples

library(doex)
CF(hybrid$data,hybrid$species)

Component data

Description

Component data is a complete dataset consists lifetimes of a component which is produced by four different suppliers. The lifetimes of the component distribute as the two-parameter exponential distribution.

Usage

component

Value

lifetime

A set of data on lifetimes of the components obtained from the different suppliers.

supplier

A set of suppliers produce the components.

Author(s)

Mustafa CAVUS

Examples

library(doex)
component$supplier;
component$lifetime;

Fiducial Approach test

Description

This function performs Fiducial Approach test.

Usage

FA(data,group,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

rept

The loop size to perform the test.

Value

pvalue

the p-value of the Fiducial Approach test

Author(s)

Mustafa CAVUS

References

Li, X., Wang, J. and Liang, H. (2011) Comparison of several means: a fiducial based approach, Computational Statistics and Data Analysis, 55, 1993-2002.

Examples

library(doex)
FA(hybrid$data,hybrid$species)

Fiducial Approach test for Two Parameter Exponential Distributions

Description

This function performs Fiducial Approach test for two-parameter exponential distributed populations.

Usage

fa_exp(data,group,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

rept

The loop size to perform the test.

Value

pvalue

the p-value of the Fiducial Approach test for two-parameter exponential distributed populations

Author(s)

Mustafa CAVUS

References

Malekzadeh, A. and Jafari, A. A. (2019) Inference on the equality means of several two-parameter exponential distributions under progressively Type II censoring, Communications in Statistics - Simulation and Computation.

Examples

library(doex)
fa_exp(component$lifetime,component$supplier)

Generalized F-test

Description

This function performs Generalized F-test.

Usage

GF(data,group,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

rept

The loop size to perform the test.

Value

pvalue

the p-value of the Generalized F-test

Author(s)

Mustafa CAVUS

References

Weerahandi, S.(1994) ANOVA under unequal error variances, Biometrics, 51, 589-599.

Examples

library(doex)
GF(hybrid$data,hybrid$species)

Generalized p-value test for Two-Parameter Exponential Distributions

Description

This function performs Generalized p-value test for two-parameter exponential distributed populations.

Usage

gpv_exp(data,group,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

rept

The loop size to perform the test.

Value

pvalue

the p-value of the Generalized p-value test for two-parameter exponential distributed populations

Author(s)

Mustafa CAVUS

References

Malekzadeh, A. and Jafari, A. A. (2019) Inference on the equality means of several two-parameter exponential distributions under progressively Type II censoring, Communications in Statistics - Simulation and Computation.

Examples

library(doex)
gpv_exp(component$lifetime,component$supplier)

Hsieh test for Two Parameter Exponential Distributions

Description

This function performs Hsieh test for two-parameter exponential distributed populations.

Usage

HS(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

pvalue

the p-value of the Hsieh test

Author(s)

Mustafa CAVUS

References

Hsieh, H.K. (1986) An exact test for comparing location parameters of k exponential distributions with unequal scales based on type II censored data, Technometrics, 28, 157-164.

Examples

library(doex)
HS(component$lifetime,component$supplier)

Hybrid data

Description

Hybrid data is taken from Weerahandi (1995) where the goal is to compare four means of corn yields by four hybrids: A, B, C, D.

An agricultural research scientist is interested in comparing four hybrids of corn. The four corn hybrids were planted in a random order in 22 plots of equal size and fairly homogeneous soil conditions. A set of data on yield from corn hybrids obtained from the experiment.

The usual P-value based on the assumption of equal population within hybrid variances (F statistic 1.841) is 0.176, thus leading to acceptance of the null hypothesis of equal means. It is however clear from the values of the sample standard deviations that the assumption of equal population variances may not be tenable for this data set.

Usage

hybrid

Value

data

A set of data on yield from corn hybrids obtained from the experiment.

species

A set of corn hybrids.

Author(s)

Mustafa CAVUS

References

Weerahandi, S. (1995) Exact Statistical Methods for Data Analysis. New York: Springer.

Examples

library(doex)
hybrid$data;
hybrid$species;

Johansen F-test

Description

This function performs Johansen F-test.

Usage

JF(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

pvalue

the p-value of the Johansen F-test

Author(s)

Mustafa CAVUS

References

Johansen, S. (1980) Whe Welch-James approximation to the distribution of the residual sum of squares in a weighted linear regression, Biometrika, 67(1), 58-92.

Examples

library(doex)
JF(hybrid$data,hybrid$species)

Modified Brown-Forsythe test

Description

This function performs modified Brown-Forsythe test.

Usage

MBF(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

pvalue

the p-value of the modified Brown-Forsythe test

Author(s)

Mustafa CAVUS

References

Mehrotra, D.V. (1997) Improving the Brown-Forsythe solution to the generalized Behrens-Fisher problem, 26(3), 1139-1145.

Examples

library(doex)
MBF(hybrid$data,hybrid$species)

Modified generalized F-test

Description

This function performs the modified generalized F-test.

Usage

MGF(data,group,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

rept

The loop size to perform the test.

Value

pvalue

the p-value of the modified generalized F-test

Author(s)

Mustafa CAVUS

References

Cavus, M., Yazici, B. and Sezer, A. (2017) Modified tests for comparison of group means under heteroskedasticity and non-normality caused by outlier(s), Hacettepe Journal of Mathematics and Statistics, 46 (3), 492-510.

Examples

library(doex)
MGF(hybrid$data,hybrid$species)

Modified Welch Test

Description

This function performs adjusted Welch test.

Usage

MW(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

tstat

the test statistic of the adjusted Welch test

pvalue

the p-value of the adjusted Welch test

Author(s)

Mustafa CAVUS

References

Hartung, J., Argaç, D. and Makambi, K. (2002) Small sample properties of tests on homogeneity in one-way ANOVA and meta-analysis, Statistical Papers, 41, 197-235.

Examples

library(doex)
MW(hybrid$data,hybrid$species)

One Stage test

Description

This function performs Chen's one stage test.

Usage

OS(data,group,nout,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

nout

an integer

rept

The loop size to perform the test.

Value

pvalue

the p-value of Chen's one stage test

Author(s)

Mustafa CAVUS

References

Chen, S.Y. and Chen, H.J. (1998) Single-stage analysis of variance under heteroscedasticity, Communications in Statistics - Simulation and Computation, 27(3), 641-666.

Examples

library(doex)
OS(hybrid$data,hybrid$species,1,10000)

One Stage Range test

Description

This function performs One Stage Range test.

Usage

OSR(data,group,nout,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

nout

an integer

rept

The loop size to perform the test.

Value

pvalue

the p-value of the One Stage Range test

Author(s)

Mustafa CAVUS

References

Chen, S.Y. and Chen, H.J. (2000) A Range Test for the Equality of Means when Variances are Unequal, American Journal of Mathematical and Management Sciences, 20:1-2, 145-170.

Examples

library(doex)
OSR(hybrid$data,hybrid$species,1,10000)

Outlier generation function

Description

This function generates the outlier(s) by Interquantile range approach.

Usage

outly(ndata,noutlier,meand,vard,dif,alpha,normality.status,skewn.status)

Arguments

ndata

sample size of the data without outlier(s).

noutlier

number of outlier(s) in data.

meand

mean of the data.

vard

variance of the data.

dif

distance level of outlier(s) from the whiskers.

alpha

significance level for the normality test.

normality.status

a logical operator controls the normality of data with outlier. "TRUE" for normal and "FALSE" for non-normal

skewn.status

a logical operator controls the skewness of the data with outlier. "0" for symmetric, "1" for right-skewed and "-1" for left-skewed.

Value

data

the vector contains the generated data with outlier(s)

outlier

the vector contains the generated outlier(s)

normality.test

the result of the Shapiro-Wilk normality test for the generated data

Author(s)

Mustafa CAVUS

References

Alexander, R.A., Govern, D.M. (1994) A new and simplier approximation for ANOVA under variance heterogeneity, Journal of Educational Statistics, 19(2), 91-101.

Examples

library(doex)
outly(8,2,2,0.05,FALSE)

Parametric Bootstrap test

Description

This function performs Parametric Bootstrap test.

Usage

PB(data,group,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

rept

The loop size to perform the test.

Value

pvalue

the p-value of the Parametric Bootstrap test

Author(s)

Mustafa CAVUS

References

Krishnamoorthy, K., Lu, F., Mathew, T. (2007) A parametric bootstrap approach for anova with unequal variances: Fixed and random models, Computational Statistics and Data Analysis, 51, 5731-5742.

Examples

library(doex)
PB(hybrid$data,hybrid$species)

Parametric Bootstrap test for Two Parameter Exponential Distributions

Description

This function performs Parametric Bootstrap test for two-parameter exponential distributed populations.

Usage

pb_exp(data,group,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

rept

The loop size to perform the test.

Value

pvalue

the p-value of the Parametric Bootstrap test for two-parameter exponential distributed populations

Author(s)

Mustafa CAVUS

References

Malekzadeh, A. and Jafari, A. A. (2019) Inference on the equality means of several two-parameter exponential distributions under progressively Type II censoring, Communications in Statistics - Simulation and Computation.

Examples

library(doex)
pb_exp(component$lifetime,component$supplier)

Permutation F-test

Description

This function performs Permutation F-test.

Usage

PF(data,group,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

rept

The loop size to perform the test.

Value

pvalue

the p-value of the Permutation F-test

Author(s)

Mustafa CAVUS

References

Berry, K.J. and Mielke, P.W. (2002) The Fisher-Pitman permutation test: an attractive alternative to the f test, Psychological Reports, 90, 495-502.

Examples

library(doex)
PF(hybrid$data,hybrid$species,1000)

Revised generalized F-test

Description

This function performs the revised generalized F-test.

Usage

RGF(data,group,rept)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

rept

The loop size to perform the test.

Value

pvalue

the p-value of the revised generalized F-test

Author(s)

Mustafa CAVUS

References

Cavus, M., Yazici, B. and Sezer, A. (2019) A revised generalized F-test for testing equality of group means under non-normality caused by skewness (under review).

Examples

library(doex)
RGF(hybrid$data,hybrid$species)

Scott-Smith Test

Description

This function performs adjusted Scott-Smith test.

Usage

SS(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

pvalue

the p-value of the Scott-Smith test

Author(s)

Mustafa CAVUS

References

Scott, A. and Smith, T. (1971) Interval estimates for linear combinations of means, Applied Statistics, 20, 276–285.

Examples

library(doex)
SS(hybrid$data,hybrid$species)

Welch-Aspin test

Description

This function performs the Welch-Aspin test.

Usage

WA(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

pvalue

the p-value of the Welch-Aspin test

Author(s)

Mustafa CAVUS

References

Aspin, A.A. (1948) An examination and further development of a formula arising in the problem of comparing two means, Biometrika, 35, 88-96.

Examples

library(doex)
WA(hybrid$data,hybrid$species)

Welch F-test

Description

This function performs Welch F-test.

Usage

WE(data,group)

Arguments

data

A vector containing the observations to which the treatments are randomly assigned.

group

A numerical or character vector indicating the treatment/control groups.

Value

pvalue

the p-value of the Welch F-test

Author(s)

Mustafa CAVUS

References

Welch, B.L. (1951) On the comparison of several mean values, Biometrika, 38, 330-336.

Examples

library(doex)
WE(hybrid$data,hybrid$species)