Code: Select all
%ex7 = "\Example Files\EV7 Manual Data\"
%ch26 = "Chapter 26 - Discrete and Limited Dependent Variable Models"
%wf = @evpath + %ex7 +%ch26 +"\censor.wf1"
wfopen %wf
equation eq20.censored(t,d=x) hrs c age edu kid1
eq20.fit yf
eq20.fit(i) qi
eq20.forecast y2
'compute index
eq20.makeregs xx
series h = eq20.c(1)
for !i = 2 to xx.@count
h = h+eq20.c(!i)*xx(!i)
next
eq20.makemodel(mod1)
mod1.solve(g=n,z=n)
c = 100
c(1) = @sum(@abs(qi-h))
c(2) = @sum(@abs(qi-i_hrs_0))
c(3) = @sum(@abs(yf-hrs_0))
c(4) = @sum(@abs(y2-yf))
However, if I change the block sequence as
Code: Select all
%ex7 = "\Example Files\EV7 Manual Data\"
%ch26 = "Chapter 26 - Discrete and Limited Dependent Variable Models"
%wf = @evpath + %ex7 +%ch26 +"\censor.wf1"
wfopen %wf
equation eq20.censored(t,d=x) hrs c age edu kid1
'compute index
eq20.makeregs xx
series h = eq20.c(1)
for !i = 2 to xx.@count
h = h+eq20.c(!i)*xx(!i)
next
eq20.fit yf
eq20.fit(i) qi
eq20.forecast y2
eq20.makemodel(mod1)
mod1.solve(g=n,z=n)
c = 100
c(1) = @sum(@abs(qi-h))
c(2) = @sum(@abs(qi-i_hrs_0))
c(3) = @sum(@abs(yf-hrs_0))
c(4) = @sum(@abs(y2-yf))
the differences are that the computation of h is move to lines before "fit" (the order is h - qi - mod1)
and the following code works (the order is qi - mod1 - h)
Code: Select all
%ex7 = "\Example Files\EV7 Manual Data\"
%ch26 = "Chapter 26 - Discrete and Limited Dependent Variable Models"
%wf = @evpath + %ex7 +%ch26 +"\censor.wf1"
wfopen %wf
equation eq20.censored(t,d=x) hrs c age edu kid1
eq20.fit yf
eq20.fit(i) qi
eq20.forecast y2
eq20.makemodel(mod1)
'mod1.unlink @all
mod1.solve(g=n,z=n)
'stop
'compute index
eq20.makeregs xx
series h = eq20.c(1)
for !i = 2 to xx.@count
h = h+eq20.c(!i)*xx(!i)
next
c = 100
c(1) = @sum(@abs(qi-h))
c(2) = @sum(@abs(qi-i_hrs_0))
c(3) = @sum(@abs(yf-hrs_0))
c(4) = @sum(@abs(y2-yf))
