Library: | eiv |
See also: | eivknownvaru eivknownratue |
Quantlet: | eivknownatt | |
Description: | eivknownatt presents the moment estimates of the parameters in the measurement error models, which has only one variable x. The degree of attenuation (also called reliability ratio) is known. All of the variables obey normal distributions. |
Usage: | {mux,beta1,beta0,sigmax,sigmau,sigmae,varbeta1,varbeta0} = eivknownatt(w,y,kww) | |
Input: | ||
w | n x 1 matrix, the design variables | |
y | n x 1 matrix, the response | |
kww | scalar, the degree of attenuation | |
Output: | ||
mux | scalar, the mean value of x | |
beta1 | scalar, the estimate | |
beta0 | scalar, the estimate | |
sigmax | scalar, the estimate of the variance of x | |
sigmau | scalar, the estimate of the variance of u | |
sigmae | scalar, the estimate of the variance of e | |
varbeta1 | scalar, the estimate of the variance of the estimate of beta1 | |
varbeta0 | scalar, the estimate of the variance of the estimate of beta0 |
library("eiv") n = 100 randomize(n) x=0.9*normal(n) w=x+0.9*normal(n) y=0.9+0.8*x+0.01*normal(n) kww =0.5 gest=eivknownatt(w,y,kww) gest.mux ; the estimate of the mean of x gest.beta1 ; the estimate of b(true value is 0.8) gest.beta0 ; the estimate of a(true value is 0.9) gest.sigmax ; the estimate of the variance of x gest.sigmau ; the estimate of the variance of u gest.sigmae ; the estimate of the variance of e gest.varbeta1 ; the estimate of the variance of the estimate of beta1 gest.varbeta0 ; the estimate of the variance of the estimate of beta0
Contents of mux [1,] -0.93396 Contents of beta1 [1,] 0.79286 Contents of beta0 [1,] 0.8425 Contents of sigmax [1,] 0.72585 Contents of sigmau [1,] 0.72585 Contents of sigmae [1,] 0.074451 Contents of varbeta1 [1,] 0.0085078 Contents of varbeta0 [1,] 0.0054358