| Library: | eiv |
| See also: | simex |
| Quantlet: | reca | |
| Description: | RECA (REgression CAlibration) is a method in which replacing the unobserved x by its expected value E(x|w,z) and then to perform a standard analysis. |
| Usage: | {beta,bv} = reca(y,w,z,su2) | |
| Input: | ||
| y | n x 1 matrix, the design variables | |
| w | n x 1 matrix | |
| z | n x 1 matrix | |
| su2 | the variance of the measurement error | |
| Output: | ||
| beta | vector, the estimate | |
| bv | matrix, the variance of the estimate | |
library("xplore")
library("eiv")
n=100
randomize(n)
y=floor(uniform(n)+0.25)
w=uniform(n)^2
z=floor(uniform(n)+0.4)
su2=var(w)/4
res=reca(y,w,z,su2)
res.beta
res.bv
Contents of beta [1,] -2.7659 [2,] 1.531 [3,] 0.96504 Contents of bv [1,] 0.49574 -0.68988 -0.24432 [2,] -0.68988 1.7197 0.06315 [2,] -0.24432 0.06315 0.33938
| Library: | eiv |
| See also: | simex |