File: restrict.inp

package info (click to toggle)
gretl 2022c-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 59,552 kB
  • sloc: ansic: 409,074; sh: 4,449; makefile: 3,222; cpp: 2,777; xml: 599; perl: 364
file content (40 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (7)
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
36
37
38
39
40
# Illustrations of use of the "restrict" command
open data4-10

# initial OLS
ols 1 0 2 3 4 5

# Evaluate two zero restrictions
restrict --quiet
  b[4] = 0
  b[5] = 0
end restrict

# Equivalent: use the "omit" command
omit 4 5

# Now try a test for equality of coefficients
ols 1 0 2 3 4 5
restrict --quiet
  b[4] - b[5] = 0
end restrict

# Manual equivalent to the above...
scalar essu = $ess
scalar dfu = $df
series vsum = WHITE + ADMEXP
ols 1 0 2 3 vsum
scalar essr = $ess
scalar Fval = (essr - essu)/(essu/dfu)
pvalue F 1 dfu Fval 

# Try testing for sum of coefficients
ols 1 0 2 3 4 5
restrict --quiet
  b[WHITE] + b[ADMEXP] = 0
end restrict

# Alternative method (t-test)
coeffsum WHITE ADMEXP