Library: | eiv |
See also: | eivknownatt eivknownratue |
Quantlet: | eivknownvaru | |
Description: | eivknownvaru presents the moment estimates of the parameters in the measurement error models, which has only one variable x. The variance of measurement error sigma_u is known. All of the variables obey normal distributions. |
Usage: | {mux,beta1,beta0,sigmax,sigmae,varbeta1,varbeta0} = eivknownvaru(w,y,sigmau) | |
Input: | ||
w | n x 1 matrix, the design variables | |
y | n x 1 matrix, the response | |
sigmau | scalar, the variance of measurement error sigma_u | |
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 | |
sigmae | scalar, the estimate of the variance of error 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=9*normal(n) w=x+9*normal(n) y=0.9+0.8*x+0.01*normal(n) sigmau=81 gest=eivknownvaru(w,y,sigmau) gest.mux gest.beta1 gest.beta0 gest.sigmax gest.sigmae 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.89725 Contents of beta0 [1,] 0.42382 Contents of sigmax [1,] 64.17 Contents of sigmae [1,] 1.3344 Contents of varbeta1 [1,] 0.036895 Contents of varbeta0 [1,] 0.70441