Library: | eiv |
See also: | reca |
Quantlet: | simex | |
Description: | SIMEX (SIMulation EXtrapolation) is a simulation-based method of estimating and reducing bias due to measurement error. simex is applicable to general estimation methods, for example, least-squares, maximum likelihood, quasi-likelihood, etc. |
Usage: | {simexl,simexq} = simex(y, w, z, su2, lam, b) | |
Input: | ||
y | n x 1 matrix, the design variables | |
w | n x 1 matrix, surrogate variable of unobservable variable | |
z | n x 1 matrix, covariate measured without error | |
su2 | the variance of the measurement error | |
lam | pseudo-parameter for generating pseudo-errors | |
b | the number of replication in each simulation | |
Output: | ||
simexl | the estimate based on linear extrapolant function | |
simexq | the estimate based on quadratic extrapolant function |
library("xplore") library("eiv") n=100 randomize(n) y=floor(uniform(n)+0.3) w=uniform(n)^2 z=floor(uniform(n)+0.45) su2=var(w)/4 lam=aseq(0.01,6,0.5) b=20 gest=simex(y,w,z,su2,lam,b) gest.simexl gest.simexq
Contents of simexl [1,] -2.2569 0.92894 0.90323 Contents of simexq [1,] -2.265 0.95407 0.90822