Skip to content
R package implementing tests for hypotheses about measurement error
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
man
.Rbuildignore
.gitignore
DESCRIPTION
METests.Rproj
NAMESPACE
README.md

README.md

METests

The R package METests implements tests for various hypotheses about measurement error as proposed in Wilhelm (2018). The R package contains help files describing the various commands, their syntax and gives examples.

Installation

  1. Install the package devtools if it isn't already:
install.packages("devtools")
  1. Load the package devtools:
library("devtools")
  1. Install the package METests:
install_github("danielwilhelm/R-ME-test")

Example

Here is an example of how to test the null hypothesis that there is no measurement error in an explanatory variable X, using a second measurement Z and an outcome Y that depends on the true explanatory variable:

rm(list = ls(all = TRUE))
set.seed(1090)
library(METests)

# generate true explanatory variable
Xstar <- runif(100)

# generate repeated measurements X and Z
X <- Xstar + rnorm(100, 0, 0.3)
Z <- Xstar + rnorm(100, 0, 0.3)

# generate outcome
Y <- Xstar^2+Xstar/2 + rnorm(100, 0, 0.5)	

# perform the test for measurement error using cross-validated bandwidth
DMTest(Y, X, Z)

Reference

Wilhelm, D. (2018), "Testing for the Presence of Measurement Error", CeMMAP Working Paper CWP45/18

You can’t perform that action at this time.