Subject: XploRe Application Guide
See XploRe: eivknownvarumod

Quantlet: eiv04
Description: estimates the parameters of eiv model for corn data with known variace of the measurement error - modified method
Download: eiv04.xpl

Code:
; Corrected 2000-05-15 SK
library("eiv")
z=read("corn.dat")
z=sort(z,3)
n=rows(z)
y=z[,1]
x=z[,2:3]
vv=inv(x'*x)*(x'*y); beta0=73.153 beta1=0.34404 
w=x[,2]
sigmau=57
omega=2+2*inv(var(w))*sigmau ;5
gest=eivknownvarumod(omega,w,y,sigmau)
; the fit values
y1=vv[1]+vv[2]*w
y2=gest.beta0+gest.beta1*w  ;gest.beta1=0.37952 
          ;gest.beta0=70.647 
data=sort(w~y)
data1=w~y1
data2=w~y2
; output display
dds3=createdisplay(1,1)
part=grid(1,1,rows(w))'
color=0*matrix(rows(w))
color1=2*matrix(rows(w))
color2=5*matrix(rows(w))
layout=3*matrix(rows(w))
layout1=1*matrix(rows(w))
layout2=3*matrix(rows(w))
setmaskp(data,color,layout,9)
setmaskp(data1,color1,layout1,2)
setmaskp(data2,color2,layout2,3)
;setmaskl(data,part,0,0,1)
setmaskl(data1,part,4,7,1)
setmaskl(data2,part,1,1,1)
show(dds3,1,1,data,data1,data2)
setgopt(dds3,1,1,"xlabel","Soil Nitrogen","title","omega=2+2*inv(var(w))*sigmau","ylabel","Yield")
; uncomment the following line for a PS picture
; print(dds3,"eivknownvarumodtu.ps")

Subject: XploRe Application Guide
See XploRe: eivknownvarumod

© MD*Tech - Method and Data Technologies, generated on 19.7.2000 .