Description Usage Arguments Details Value Author(s) References See Also Examples
Implementation of the SIMEX algorithm for measurement error models according to Cook and Stefanski.
1 2 3 |
model |
naive model |
model.model |
dataframe containing all variables in the model |
SIMEXvariable |
character name of the variable with measurement error. Assumed to be the baseline measurement. |
respvar |
character name of the response variable. The response is assumed to represent a change from baseline. |
grpvar |
character name of the grouping variable for the random effects in the model. |
corform |
formula for the correlation of residual errors within groups. see example |
measurement.error |
The known standard deviation of measurement errors for |
measurement.error.resp |
The known stadard deviaiton for |
lambda |
vector of lambdas for which the simulation step should be done |
B |
number of iterations for each lambda |
fitting.method |
fitting method for extrapolation. Only |
jackknife.estimation |
specifying the extrapolation method for jackknife variance estimation. |
See documentation for mcsimex
function. This function for lme models was adapted from that function, which is designed to handle linear and generalized linear models, but not lme models. In this function, the measurement error variable must be the baseline value of some measurement and the response is the change from baseline in the same measurement. There is assumed to be one value of this baseline measurement per level of the grouping variable in the mixed effect model. The correlation between the measurement errors for two response values within a subject is assumed to be equal to be equal to the variance of baseline divided by the sum of the variance of baseline and variance of post-baseline errors. For example, for a study measuring the effect of some weight loss treatment, the grouping variable could be subject, the baseline weight is the covariate with measurement error and the response is change from baseline in weight.
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 for |
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 of the main model |
fitted.values |
the fitted values of the main model |
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 |
John Lawrence,john.lawrence@fda.hhs.gov, Jianjin Xu, Wolfgang Lederer, Heidi Seibold
Cook, J.R. and Stefanski, L.A. (1994) Simulation-extrapolation estimation in parametric measurement error models. Journal of American Statistical Association, 89, 1314 – 1328
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | set.seed(1234)
data("simGFRdata")
simGFR=simGFR[is.element(simGFR$time,c(1:12)/4) & is.element(simGFR$PID,c(1:80)*100),]
fm2=nlme::lme.formula(fixed = cfb ~ time + x1:time + trt + trt:time + trt:x1:time + 0,
data = simGFR, random = ~time | PID,
correlation = nlme::corCompSymm(0.5,form = ~time | PID, fixed = TRUE),
control=nlme::lmeControl(returnObject=TRUE))
(s1 = simexlme(model=fm2, model.model=simGFR[,c("cfb","PID","time","x1","trt")],
SIMEXvariable="x1",respvar="cfb",grpvar="PID",corform="~time | PID",
measurement.error=res.sd,measurement.error.resp=res.sd,
lambda = c(0.5,2),B = 2, fitting.method = "linear",
jackknife.estimation = FALSE))
plot(s1)
#values of fixed effects used to simulate data
c(fixed.time,fixed.trt,fixed.leGFR,fixed.trttime,fixed.leGFRtrt)
#naive estimates
fm2$coefficients$fixed
#SIMEX corrected estimates
s1$coefficients
|
Naive model:
nlme::lme.formula(fixed = cfb ~ time + x1:time + trt + trt:time + trt:x1:time + 0, data = simGFR, random = ~time | PID, correlation = nlme::corCompSymm(0.5, form = ~time | PID, fixed = TRUE), control = nlme::lmeControl(returnObject = TRUE))
SIMEX-Variables: x1
Number of Simulations: 2
Coefficients:
time trt time:x1 time:trt time:x1:trt
-0.51693 -0.03342 0.10798 0.14614 -0.03106
[1] -0.6447911 -0.0478315 0.1333391 0.2186963 -0.0458998
time trt time:x1 time:trt time:x1:trt
-0.52505122 -0.04379181 0.10882352 0.20892427 -0.04492911
time trt time:x1 time:trt time:x1:trt
-0.51693485 -0.03342354 0.10797836 0.14614182 -0.03106170
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.