Package 'npordtests'

Title: Nonparametric Tests for Equality of Location Against Ordered Alternatives
Description: Performs nonparametric tests for equality of location against ordered alternatives.
Authors: Bulent Altunkaynak [aut, cre], Hamza Gamgam [aut]
Maintainer: Bulent Altunkaynak <[email protected]>
License: GPL (>= 2)
Version: 1.2
Built: 2024-11-01 11:45:51 UTC
Source: CRAN

Help Index


Adaptive Test (AT)

Description

AtTest performs the Adaptive Test.

Usage

AtTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the Adaptive test statistic.

mean

the mean of the Adaptive test statistic.

variance

the variance of the Adaptive test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "Adaptive test".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Beier, F., Buning, H.(1997). An adaptive test against ordered alternatives. Computational Statistics & Data Analysis, 25:4, 441-452.

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
AtTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
AtTest(Values~Group,lehmann)

Chicks' weight data

Description

This real data is reported by Chang and Yen (2011). Eighteen chicks were randomly assigned to three treatments with six chicks in each for balanced data.

Usage

data("chicks")

Format

A data frame with 18 observations on the following 2 variables.

diet

Diets of different protein content

weight

Chicks' weight (in grams)

Details

Treatment 1 (Diet 1) had the diet with the lowest level of protein; treatment 2 (Diet 2) had the diet with a medium level of protein; and treatment 3 (Diet 3) had the diet with the highest level of protein. Does the average weight of chicks increase with the amount of protein? Hypothesis is being investigated.

Source

Chang, C. H. and Yen, C.H. (2011). A Nonparametric Test for the Ordered Alternative Based on Fast Discrete Fourier Transform Coefficient. Journal of Testing and Evaluation, 39:6, 1131-1143.

Examples

library(npordtests)

data(chicks)
levels(chicks$diet) <- c("diet 1", "diet 2", "diet 3")
boxplot(weight~diet,data=chicks,xlab="Diet")

Ferdhiana, Terpstra and Magel (FTM) Test

Description

FtmTest performs FTM test.

Usage

FtmTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the FTM test statistic.

mean

the mean of the FTM test statistic.

variance

the variance of the FTM test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "FTM test".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Ferdhiane, R., Terpstra, J., Magel, R.C. (2008). A nonparametric test for the ordered alternative based on Kendall's correlation coefficient. Communications in Statistics-Simulation and Computation, 37:6, 1117-1128.

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
FtmTest(Y~X,jdata)

Gaur's Gc Test

Description

GcTest performs Gaur's Gc test.

Usage

GcTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE, c = 2)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

c

a integer value chosen from (1,..., min(n_i)) for subsample size. Default is set to c = 2.

Value

A list with class "owt" containing the following components:

statistic

the Gaur's Gc test statistic.

mean

the mean of the Gaur's Gc test statistic.

variance

the variance of the Gaur's Gc test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "Gaur's Gc test ".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Gaur, A., (2017). A class of k-sample distribution-free tests for location against ordered alternatives. Communications in Statistics-Theory and Methods, 46:5, 2343-2353.

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
GcTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
GcTest(Values~Group,lehmann)

Hepatic vein waveform index data

Description

This data collected by Pedersen et al. (2008) was taken from Terpstra et al. (2011). The data are calculated from doppler waveforms corresponding to 66 patients who were scheduled for a percutaneous liver needle biopsy.

Usage

data("hvwi")

Format

A data frame with 66 observations on the following 2 variables.

Group

Fibrosis groups: A:cirrhosis, B:severe, C:moderate, D:mild and E:none

Values

HVWI values for the five fibrosis groups

Source

Terpstra, J. T., Chang, C. H. and Magel, C. M. (2011). On the use of Sperman's correlation coefficient for testing ordered alternatives. Journal of Statistical Computation and Simulation, 81:11, 1381-1392.

References

Pedersen, J. F., Madsen, L. G., Vibeke, A. L. Hamberg, O., Horn, T., Federspiel, B. and Bytzer, P. (2008). A doppler waveform index to characterize hepatic vein velocity pattern and evaluate hepatic fibrosis. J. Clin. Ultrasound, 36:4, 208-211.

Examples

data(hvwi)
levels(hvwi$Group) <- c("cirrhosis", "severe", "moderate", "mild", "none")
boxplot(Values~Group,data=hvwi,xlab="Fibrosis group",ylab="HVWI value")

Hypertension data

Description

This data presented by Dmitrienko et al. (2006) is to examine the effect of different drug doses on diastolic blood pressure.

Usage

data("hypertension")

Format

A data frame with 68 observations on the following 2 variables.

doseLevel

Dose levels: A: Placebo, B: Dose 10 mg/day, C: Dose 20 mg/day, D: Dose 40 mg/day

rdbp

Mean reduction in diastolic blood pressure

Details

Patients with hypertension were randomized into four groups with different dose levels, 0, 10, 20, and 40 mg/day, where the group with 0 mg/day was the placebo group. The number of patients in each group were 17, 17, 18, and 16, respectively. The complete data can be found at the Dmitrienko et al.(2006) or Shan et al. (2014).

Source

Dmitrienko, A., Chuang-Stein, C. and D’Agostino, R. (2006). Pharmaceutical Statistics Using SAS: A Practical Guide (SAS Press). SAS Institute, 1 edition.

References

Shan, G., Young, D. and Kang, L. (2014). A New Powerful Nonparametric Rank Test for Ordered Alternative Problem. PLoS ONE, 9:11, doi:10.1371/journal.pone.0112924.

Examples

data(hypertension)
levels(hypertension$doseLevel) <- c("placebo", "10", "20", "40")
boxplot(rdbp~doseLevel,data=hypertension,xlab="Dose level",ylab="Mean reduction in dbp")

Jonckheere's data

Description

This synthetic data is reported by Jonckheere (1954). The data consists of 4 groups with 4 observations in each.

Usage

jdata

Format

A data frame with 16 observations on the following 2 variables.

X

Number of samples

Y

Value

Source

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Examples

library(npordtests)

data(jdata)
levels(jdata$X) <- c("I", "II", "III", "IV")
boxplot(Y~X,data=jdata,xlab="Groups")

Jonckheere-Terpstra (JT) Test

Description

JtTest performs JT test.

Usage

JtTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the JT test statistic.

mean

the mean of the JT test statistic.

variance

the variance of the JT test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "JT test".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
JtTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
JtTest(Values~Group,lehmann)

Terpstra, Chang and Magel's KTP Test

Description

KtpTest performs KTP test.

Usage

KtpTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the KTP test statistic.

mean

the mean of the KTP test statistic.

variance

the variance of the KTP test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "KTP".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Terpstra, J., Chang, C.H., Magel, R.C. (2011). On the use of Spearman's correlation coefficient for testing ordered alternatives. Journal of Statistical Computation and Simulation, 81:11, 1381-1392.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
KtpTest(Y~X,jdata)

Lehmann's data

Description

This synthetic data is reported by Lehmann (1975). The data consists of 3 groups with 28, 23 and 21 observations respectively.

Usage

lehmann

Format

A data frame with 72 observations on the following 2 variables.

Group

Number of samples

Values

Value

Source

Lehmann, E. (1975). Nonparametrics: Statistical Methods based on Ranks, Holden-Day, San Francisco, 1st edition, p.12.

Examples

library(npordtests)

data(lehmann)
levels(lehmann$Group) <- c("Undergraduates", "Trainees", "Staff")
boxplot(Values~Group,data=lehmann,xlab="Groups")

Hogg, Fisher and Randles' LS Test

Description

LsTest performs LS test.

Usage

LsTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the LS test statistic.

mean

the mean of the LS test statistic.

variance

the variance of the LS test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "LS test ".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Beier, F., Buning, H.(1997). An adaptive test against ordered alternatives. Computational Statistics & Data Analysis, 25:4, 441-452.

Hogg, R.V., Fisher, D.M., Randles, R.H. (1975). A Two-Sample Adaptive Distribution-Free Test. Journal of the American Statistical Association, 70:351, 656-661.

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
LsTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
LsTest(Values~Group,lehmann)

Buning's LT Test

Description

LtTest performs LT test.

Usage

LtTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the LT test statistic.

mean

the mean of the LT test statistic.

variance

the variance of the LT test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "LT test ".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Buning, H.(1996). Adaptive tests for the c-sample location problem - the case of two-sided alternatives. Communications in Statistics-Theory and Methods, 25, 1569-1582.

Beier, F., Buning, H.(1997). An adaptive test against ordered alternatives. Computational Statistics & Data Analysis, 25:4, 441-452.

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
LtTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
LtTest(Values~Group,lehmann)

Modified Jonckheere-Terpstra (MJT) Test

Description

MjtTest performs MJT test.

Usage

MjtTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Details

information.gain is

H(Class)+H(Attribute)H(Class,Attribute)H(Class) + H(Attribute) - H(Class, Attribute)

.

gain.ratio is

H(Class)+H(Attribute)H(Class,Attribute)H(Attribute)\frac{H(Class) + H(Attribute) - H(Class, Attribute)}{H(Attribute)}

symmetrical.uncertainty is

2H(Class)+H(Attribute)H(Class,Attribute)H(Attribute)+H(Class)2\frac{H(Class) + H(Attribute) - H(Class, Attribute)}{H(Attribute) + H(Class)}

Value

A list with class "owt" containing the following components:

statistic

the MJT test statistic.

mean

the mean of the MJT test statistic.

variance

the variance of the MJT test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "MJT test ".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Neuhauser, M., Liu, P.Y., Hothorn, L.A.(1998). Nonparametric Tests for Trend: Jonckheere's Test, a Modification and a Maximum Test. Biometrical Journal, 40:8, 899-909.

Tryon, V. P., Hettmansperger, T. P. (1973). A class of nonparametric tests for homogeneity against ordered alternatives. Annals of Statistics, 1, 1061-1070.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
MjtTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
MjtTest(Values~Group,lehmann)

Neuhauser's data

Description

This synthetic data is reported by Neuhauser et al. (1998). The data consists of 4 groups with 10 observations per group.

Usage

neuhauser

Format

A data frame with 72 observations on the following 2 variables.

group

Group number

value

Value

Source

Neuhauser M, Liu PY, Hothorn LA (1998), Nonparametric Tests for Trend: Jonckheere's Test, a Modification and a Maximum Test. Biom J, 40, 899-909.

Examples

library(npordtests)

data(neuhauser)
boxplot(value~group,data=neuhauser,xlab="Groups")

Hogg, Fisher and Randles' RS Test

Description

RsTest performs RS test.

Usage

RsTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the RS test statistic.

mean

the mean of the RS test statistic.

variance

the variance of the RS test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "RS test ".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Beier, F., Buning, H.(1997). An adaptive test against ordered alternatives. Computational Statistics & Data Analysis, 25:4, 441-452.

Hogg, R.V., Fisher, D.M., Randles, R.H. (1975). A Two-Sample Adaptive Distribution-Free Test. Journal of the American Statistical Association, 70:351, 656-661.

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
RsTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
RsTest(Values~Group,lehmann)

Shan, Young and Kang's S Test

Description

SsTest performs S test.

Usage

SsTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the S test statistic.

mean

the mean of the S test statistic.

variance

the variance of the S test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "S test".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Shan, G., Young, D., Kang, L.(2014). A New Powerful Nonparametric Rank Test for Ordered Alternative Problem. Plos One, 9:11, 1-10.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
SsTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
SsTest(Values~Group,lehmann)

Gastwirth's ST Test

Description

StTest performs ST test.

Usage

StTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the ST test statistic.

mean

the mean of the ST test statistic.

variance

the variance of the ST test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "ST test ".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Beier, F., Buning, H.(1997). An adaptive test against ordered alternatives. Computational Statistics & Data Analysis, 25:4, 441-452.

Gastwirth, J.L.(1965). Percentile modifications of two sample rank tests. Journal of the American Statistical Association, 60, 1127-1141.

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
StTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
StTest(Values~Group,lehmann)

Terpstra and Magel (TM) Test

Description

TmTest performs TM test.

Usage

TmTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the TM test statistic.

mean

the mean of the TM test statistic.

variance

the variance of the TM test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "TM test".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Terpstra, J., Magel, R.C. (2003). A new nonparametric test for the ordered alternative problem. Journal of Nonparametric Statistics, 15:3, 289-301.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
TmTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
TmTest(Values~Group,lehmann)

Beier and Buning's WS Test

Description

WsTest performs WS test.

Usage

WsTest(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a data frame containing the variables in the formula formula

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

verbose

a logical for printing output to R console.

Value

A list with class "owt" containing the following components:

statistic

the WS test statistic.

mean

the mean of the WS test statistic.

variance

the variance of the WS test statistic.

Z

the standardized test statistic.

p.value

the p-value of the test.

alpha

the level of significance.

method

the character string "WS test ".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Author(s)

Bulent Altunkaynak

References

Beier, F., Buning, H.(1997). An adaptive test against ordered alternatives. Computational Statistics & Data Analysis, 25:4, 441-452.

Jonckheere, A. R. (1954). A Distribution-Free k-Sample Test Against Ordered Alternatives. Biometrika, 41, 133-145.

Examples

library(npordtests)

## Data from Jonckheere (1954)
data(jdata)
WsTest(Y~X,jdata)

## Data from Lehmann (1975)
data(lehmann)
WsTest(Values~Group,lehmann)