/usr/share/gretl/scripts/misc/wtp.inp is in gretl-common 1.9.14-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # Interval regression: Verbeek's "willingness to pay" example
set echo off
set messages off
open wtp.gdt --quiet
# construct the two bounds variables
series lo = NA
series hi = NA
smpl depvar = 1 --restrict
hi = bidl
smpl depvar = 2 --restrict --replace
lo = bidl
hi = bid1
smpl depvar = 3 --restrict --replace
lo = bid1
hi = bidh
smpl depvar = 4 --restrict --replace
lo = bidh
/*
Re-establish the full sample range and run two variants
of interval regression; a likelihood-ratio test is also
computed.
*/
smpl full
intreg lo hi const
scalar ll0 = $lnl
intreg lo hi const age female income
scalar ll1 = $lnl
scalar LR = 2*(ll1 - ll0)
printf "LR test: Chi-square(3) = %g, p-value = %g\n", \
LR, pvalue(X, 3, LR)
|