mvar2.1976PL {SHT} | R Documentation |
Two-sample Simultaneous Test of Mean and Variance by Perng and Littell (1976)
Description
Given two univariate samples x
and y
, it tests
H_0 : \mu_x = \mu_y, \sigma_x^2 = \sigma_y^2 \quad vs \quad H_1 : \textrm{ not } H_0
using Fisher's method of merging two p
-values.
Usage
mvar2.1976PL(x, y)
Arguments
x |
a length- |
y |
a length- |
Value
a (list) object of S3
class htest
containing:
- statistic
a test statistic.
- p.value
p
-value underH_0
.- alternative
alternative hypothesis.
- method
name of the test.
- data.name
name(s) of provided sample data.
References
Perng SK, Littell RC (1976). “A Test of Equality of Two Normal Population Means and Variances.” Journal of the American Statistical Association, 71(356), 968–971. ISSN 0162-1459, 1537-274X.
Examples
## CRAN-purpose small example
x = rnorm(10)
y = rnorm(10)
mvar2.1976PL(x, y)
## Not run:
## empirical Type 1 error
niter = 1000
counter = rep(0,niter) # record p-values
for (i in 1:niter){
x = rnorm(100) # sample x from N(0,1)
y = rnorm(100) # sample y from N(0,1)
counter[i] = ifelse(mvar2.1976PL(x,y)$p.value < 0.05, 1, 0)
}
## print the result
cat(paste("\n* Example for 'mvar2.1976PL'\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=""))
## End(Not run)
[Package SHT version 0.1.8 Index]