| Library: | eiv |
| See also: | simex |
| Macro: | 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, | |
| Output: | ||
| su2 | ||
| beta | vector, the estimate | |
| bv | matrix, the variance of the estimate | |
library("eiv")
library("xplore")
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
res.beta=(-3.0804, -0.33574) res.bv=(0.77973, -0.21232 -0.21232, 0.18033)
| Library: | eiv |
| See also: | simex |