File: wtp.inp

package info (click to toggle)
gretl 2016d-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 48,620 kB
  • ctags: 22,779
  • sloc: ansic: 345,830; sh: 4,648; makefile: 2,712; xml: 570; perl: 364
file content (35 lines) | stat: -rw-r--r-- 721 bytes parent folder | download | duplicates (4)
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
35
# 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)