test2mu {svplots}R Documentation

Tests the hypothesis over two population means based on two samples by Sv-plot2.

Description

Decision on hypothesis testing over two means is made by graphing two sample Sv-plot2s along with the threshold line. If the intersection point of two Sv-plot2s locates on or above the threshold line, the null hypothesis is rejected at specified significance level, otherwise, failed to reject.

Usage

test2mu(X1,X2,paired=FALSE,eqlvar=FALSE,unkwnsigmas=TRUE,
               sigma1=NULL,sigma2=NULL,alpha=0.05,xlab="x",
               title="Two means: Hypothesis testing by Sv-plot2",
               sam1col="grey5",sam2col="grey45",thrcol="black",...)

Arguments

X1

an n1 by 1 matrix, equivalently, a column vector of length n1, where n1 is number of observations.

X2

an n2 by 1 matrix, equivalently, a column vector of length n2, where n2 is number of observations.

paired

for dependent samples TRUE, FALSE by default.

eqlvar

population variances are equal, FALSE by default.

unkwnsigmas

population standard deviations are unknown, TRUE by default.

sigma1

population1 standard deviation, NULL by default.

sigma2

population2 standard deviation, NULL by default.

alpha

significance level, alpha=0.05 by default.

xlab

x-axis label, x by default.

title

title of the plot, Two means: Hypothesis testing by Sv-plot2 by default.

sam1col

sample1 Sv-plot2 color, grey5 by default.

sam2col

sample2 Sv-plot2 color, grey45 by default.

thrcol

threshold color, black by default.

...

other graphical parameters.

Value

Decision on testing hypotheses over two population means by Sv-plot2.

References

Wijesuriya, U. A. (2020). Sv-plots for identifying characteristics of the distribution and testing hypotheses. Communications in Statistics-Simulation and Computation, doi: 10.1080/03610918.2020.1851716.

Examples

set.seed(5)
test2mu(X1=matrix(rnorm(10,mean=3,sd=2)),X2=matrix(rnorm(20,mean=4,sd=2.5)),
       paired=FALSE,eqlvar=FALSE,unkwnsigmas=TRUE,
       sigma1=NULL,sigma2=NULL,alpha=0.05,
       sam1col="grey5",sam2col="grey45",thrcol="black")

test2mu(X1=matrix(rnorm(10,mean=3,sd=2)),X2=matrix(rnorm(20,mean=4,sd=2.5)),
       paired=FALSE,eqlvar=TRUE,unkwnsigmas=TRUE,
       sigma1=NULL,sigma2=NULL,alpha=0.05,
       sam1col="grey5",sam2col="grey45",thrcol="black")

test2mu(X1=matrix(rnorm(50,mean=3,sd=2)),X2=matrix(rnorm(30,mean=4,sd=2.5)),
       xlab="x",title="Two means: Hypothesis testing by Sv-plot2",
       paired=FALSE,eqlvar=FALSE,unkwnsigmas=TRUE,
       sigma1=NULL,sigma2=NULL,alpha=0.05,
       sam1col="grey5",sam2col="grey45",thrcol="black")

test2mu(X1=matrix(rnorm(50,mean=3,sd=2)),X2=matrix(rnorm(30,mean=4,sd=2.5)),
       paired=FALSE,eqlvar=FALSE,unkwnsigmas=FALSE,
       sigma1=2,sigma2=4.920782,alpha=0.05,
       sam1col="grey5",sam2col="grey45",thrcol="black")

X1=matrix(rnorm(10,mean=3,sd=2))
X2=2*X1
test2mu(X1,X2,
       paired=TRUE,eqlvar=FALSE,unkwnsigmas=TRUE,
       sigma1=NULL,sigma2=NULL,alpha=0.05,
       sam1col="blue",sam2col="red",thrcol="black")

[Package svplots version 0.1.0 Index]