simex {simex}R Documentation

Measurement error in models using SIMEX

Description

Implementation of the SIMEX algorithm for measurement error models according to Cook and Stefanski

Usage

simex(model, SIMEXvariable, measurement.error, lambda = c(0.5, 1, 1.5, 2),
  B = 100, fitting.method = "quadratic", jackknife.estimation = "quadratic",
  asymptotic = TRUE)

## S3 method for class 'simex':
print(x, digits = max(3, getOption("digits") - 3), ...)
## S3 method for class 'simex':
summary(object,...)
## S3 method for class 'simex':
plot(x, xlab = expression((1 + lambda)), ylab = colnames(b[, -1]),
  ask = FALSE, show = rep(TRUE, NCOL(b) - 1), ...)
## S3 method for class 'simex':
predict(object, newdata, ...)

refit(object, ...)
## S3 method for class 'simex':
refit(object, fitting.method = "quadratic",
  jackknife.estimation = "quadratic", asymptotic = TRUE, ...)

Arguments

model the naive model
SIMEXvariable character or vector of characters containing the names of the variables with measurement error
measurement.error vector of standard deviations of the known measurement errors
lambda vector of lambdas for which the simulation step should be done (without 0)
B number of iterations for each lambda
fitting.method fitting method linear, quadratic, nonlinear are implemented. (first 4 letters are enough)
jackknife.estimation specifying the extrapolation method for jackknife variance estimation. Can be set to FALSE if it should not be performed
asymptotic logical, indicating if asymptotic variance estimation should be done, in the naive model the option x = TRUE has to be set
x object of class 'simex'
digits number of digits to be printed
object object of class 'simex'
xlab optional name for the X-Axis
ylab vector containing the names for the Y-Axis
ask logical. If TRUE, the user is asked for input, before a new figure is drawn
show vector of logicals indicating for wich variables a plot should be produced
newdata optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors are used
... arguments passed to other functions

Details

Nonlinear is implemented as described in Cook and Stefanski, but is numerically instable. It is not advisable to use this feature. If a nonlinear extrapolation is desired please use the refit() method.

Asymptotic is only implemented for naive models of class lm or glm.

refit() refits the object with a different extrapolation function.

Value

An object of class 'simex' which contains:

coefficients the corrected coefficients of the SIMEX model,
SIMEX.estimates the estimates for every lambda,
model the naive model,
measurement.error the known error standard deviations,
B the number of iterations,
extrapolation the model object of the extrapolation step,
fitting.method the fitting method used in the extrapolation step,
residuals the residuals,
fitted.values the fitted values,
call the function call,
variance.jackknife the jackknife variance estimate,
extrapolation.variance the model object of the variance extrapolation,
variance.jackknife.lambda the data set for the extrapolation,
variance.asymptotic the asymptotic variance estimates,
theta the estimates for every B and lambda,

...

Author(s)

Wolfgang Lederer,wolfgang.lederer@googlemail.com

References

Cook, J.R. and Stefanski, L.A. (1994) Simulation-extrapolation estimation in parametric measurement error models. Journal of American Statistical Association, 89, 1314 – 1328

Carroll, R.J., Küchenhoff, H., Lombard, F. and Stefanski L.A. (1996) Asymptotics for the SIMEX estimator in nonlinear measurement error models. Journal of the American Statistical Association, 91, 242 – 250

Carrol, R.J., Ruppert, D., Stefanski, L.A. and Crainiceanu, C. (2006). Measurement error in nonlinear models: A modern perspective., Second Edition. London: Chapman and Hall.

Lederer, W. and Küchenhoff, H. (2006) A short introduction to the SIMEX and MCSIMEX. R News, 6(4), 26–31

See Also

mcsimex for discrete data with misclassification, lm, glm

Examples

# to test nonlinear extrapolation
#set.seed(3)
x <- rnorm(200, 0, 100)
u <- rnorm(200, 0, 25)
w <- x + u
y <- x + rnorm(200, 0, 9)
true.model <- lm(y ~ x)
naive.model <- lm(y ~ w, x = TRUE)
simex.model <- simex(model = naive.model, SIMEXvariable = "w",
    measurement.error = 25)
plot(x, y)
abline(true.model, col = "darkblue")
abline(simex.model, col = "red")
abline(naive.model, col = "green")
legend(min(x), max(y), legend = c("True Model", "SIMEX model", "Naive Model"),
    col = c("darkblue", "red", "green"), lty = 1)

plot(simex.model, mfrow = c(2, 2))

simex.model2 <-  refit(simex.model, "line")
plot(simex.model2, mfrow = c(2, 2))

[Package simex version 1.4 Index]