Learn R Programming

MEtest (version 1.1)

me.test: A homogeneity Test under the Presence of Measurement Error

Description

This function provides the test statistic and p-value of a homogeneity test of distributions when the observations are measured with error.

Usage

me.test(W, V, B = 1000, wt = c("Uniform", "Normal"), wt.bd = NULL, 
	wt.prob = 0.99, nGL = 32)

Arguments

W

an \(m_x\) (>= 2) by \(n_x\) matrix of observations.

V

an \(m_y\) (>= 2) by \(n_y\) matrix of observations.

B

the number of bootstrap samples. Default is 1000.

wt

type of the weight function. Uniform and standard normal distributions are available.

wt.bd

lower and upper bound of the weight function. If wt.bd is not specified, bounds are computed based on the deconvoluted distribution function.

wt.prob

probability used to compute lower and upper bound. Will be ignored if wt.bd is provided.

nGL

the number of nodes for Gaussian quadrature

Value

The output is an object of the class htest like in t.test.

statistic

the value of the test statistic.

p.value

the p-value for the test.

method

the character string indicating the weight function.

alternative

a character string describing the alternative hypothesis.

boundary

lower and upper bound for the weight function.

Details

Based on our extensive simulations, we recommend to use uniform weight function with 0.99 probability.

References

Lee, D., Lahiri, S. N. and Sinha, S. A Test of Homegeneity of Distributions when Observations are Subject to Measurement Errors. Submitted.

Examples

Run this code
# NOT RUN {
library(statmod)
set.seed(1234)
n <- 200
mx <- my <- 2
X <- rnorm(n, mean = 0, sd = 1)
Y <- rnorm(n, mean = 0.2, sd = 1)
Ux <- matrix(rnorm(n*mx, mean = 0, sd = 0.5), ncol = mx)
Uy <- matrix(rnorm(n*my, mean = 0, sd = 0.5), ncol = my)

W <- X + Ux
V <- Y + Uy
me.test(W, V, wt = "Uniform")
# }

Run the code above in your browser using DataLab