simex {simex} | R Documentation |
Implementation of the SIMEX Algorithm for measurement error models according to Cook and Stefanski
simex(model , SIMEXvariable , measurement.error , lambda = c(0.5,1,1.5,2) , B = 100, fitting.method = "quadratic" , jackknife.estimation = "quad" , asymptotic = TRUE)
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 have to be set. |
nonlinear is implemented as described in Cook and Stefanski, but is numerically not stable. It is not advisable to use this feature. See fit.nls
for details.
If a nonlinear extrapolation is desired please use the refit
function.
Asymptotic is only implemented for naive models of class lm
or glm
Returns 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 variances, |
B |
the number of iterations, |
extrapolation |
the model object of the extrapolation step, |
fitting.method |
the fitting method of the extrapolation step, |
residuals |
residuals, |
fitted.values |
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 |
estimates for every B and lambda |
...
Wolfgang Lederer,wolfgang.lederer@googlemail.com
Cook, J.R. and Stefanski, L.A. (1994) Simulation-Extrapolation Estimation in Parametric Measurement error Models. Journal of American Statistical Assosiaction, 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. and Stefanski L.A. (1995). Measurement Error in Nonlinear Models. London: Chapman and Hall.
mcsimex
for discreete data with misclassification, lm
,glm
, refit
# 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) # True model 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))