This file is indexed.

/usr/share/gretl/gretlcli.hlp.pt is in gretl-common 1.9.6-1build1.

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
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
headings 10
Tests 24
add
adf
arch
chow
chow
coeffsum
coint
coint2
cusum
difftest
hausman
kpss
leverage
levinlin
meantest
modtest
normtest
omit
qlrtest
reset
restrict
runs
vartest
vif
Statistics 13
anova
corr
corrgm
fractint
freq
hurst
mahal
pca
pergm
spearman
summary
xcorrgm
xtab
Dataset 16
append
data
dataset
delete
genr
info
labels
nulldata
open
rename
setinfo
setobs
setmiss
smpl
store
varlist
Estimation 33
ar
ar1
arbond
arima
biprobit
dpanel
duration
equation
estimate
garch
gmm
heckit
hsk
intreg
kalman
lad
logistic
logit
mle
mpols
negbin
nls
ols
panel
poisson
probit
quantreg
system
tobit
tsls
var
vecm
wls
Graphs 7
boxplot
gnuplot
graphpg
qqplot
rmplot
scatters
textplot
Programming 19
break
clear
catch
clear
debug
elif
else
end
endif
endloop
foreign
function
if
include
loop
makepkg
run
set
sscanf
Utilities 5
help
modeltab
pvalue
quit
shell
Transformations 9
diff
discrete
dummify
lags
ldiff
logs
orthdev
sdiff
square
Printing 7
eqnprint
modprint
outfile
print
printf
sprintf
tabprint
Prediction 1
fcast

# add Tests

Argument:   lista-de-variáveis 
Options:    --vcv (mostrar matriz de covariância)
            --quiet (não mostrar estimativas para o modelo aumentado)
            --silent (não mostrar nada)
            --inst (acrescentar como instrumento, apenas para TSLS)
            --both (acrescentar tanto como regressor como instrumento, apenas para TSLS)
Examples:   add 5 7 9
            add xx yy zz --quiet

Tem que ser invocado após um comando de estimação. As variáveis na
lista-de-variáveis são acrescentadas ao modelo anterior e o novo modelo é
estimado. É apresentada uma estatística de significância conjunta,
juntamente com o seu p-value. O teste estatístico é o F no caso de
estimação por mínimos quadrados (OLS), ou qui-quadrado assimptótico de
Wald nos outros casos. Um p-value abaixo de 0,05 significa que os
coeficientes são conjuntamente significantes num nível de 5 porcento.

Se foi fornecida a opção --quiet os resultados apresentados ficam
confinados ao teste da significância conjunta das variáveis acrescentadas,
caso contrário, também serão mostradas as estimativas para o modelo
aumentado. Neste caso, a opção --vcv faz com que a matriz de covariâncias
dos coeficientes também seja apresentada. Se for usada a opção --silent,
não será mostrado nada; em em todo o caso, os resultados do teste podem
ser obtidos usando as variáveis especiais $test e $pvalue.

Se o modelo original foi estimado usando o método dos mínimos quadrados de
duas fases, ocorre uma situação ambígua: devem as novas variáveis serem
acrescentadas como sendo regressores, como instrumentos, ou como ambos? Isto
resolve-se do seguinte modo: por omissão as novas variáveis são
acrescentadas como regressores endógenos, mas se foi dada a opção --inst
elas são acrescentadas como instrumentos, ou se a opção --both está
presente elas são acrescentadas como regressores exógenos.

Menu path:    Janela do modelo, /Testes/Acrescentar variáveis

# adf Tests

Arguments:  ordem nome-de-variável 
Options:    --nc (teste sem constante)
            --c (apenas com constante)
            --ct (com constante e tendência)
            --ctt (com constante, tendência e quadrado da tendência)
            --seasonals (incluir variáveis sazonais auxiliares)
            --verbose (mostrar resultados da regressão)
            --quiet (não mostrar resultados da regressão)
            --difference (usar a primeira diferença da variável)
            --test-down (ordem 'lag' automática)
Examples:   adf 0 y
            adf 2 y --nc --c --ct
            adf 12 y --c --test-down
            See also jgm-1996.inp

Determina estatísticas para um conjunto de testes de Dickey-Fuller sobre a
variável especificada, com a hipótese nula de que a variável tem uma raiz
unitária. (Mas se a opção de diferenciação tiver sido dada, a primeira
diferença da variável é obtida, e a discussão abaixo deve ser
interpretada como sendo referente à variável transformada.)

Por omissão, são apresentadas três variantes do teste: uma baseada na
regressão contendo uma constante, uma usando uma constante e uma tendência
linear, e uma usando uma constante e uma tendência quadrática. Você pode
controlar as variantes que são apresentadas ao especificar uma ou mais
opções.

Em todos os casos a variável dependente é a primeira diferença da
variável especificada, y, e a variável independente chave é o primeiro
'lag' de y. O modelo é construido de modo a que o coeficiente do 'lag' de y
iguale 1 menos a raiz em questão. Por exemplo, o modelo com uma constante
pode ser escrito como

  (1 - L)y(t) = b0 + (1-a)y(t-1) + e(t)

Se a ordem de 'lag', k, é maior que 0, então k 'lags' da variável
dependente são incluidos no lado direito das regressões de teste, sujeitos
à seguinte qualificação. Se a opção --test-down foi dada, k é
considerada como sendo o 'lag' máximo e a ordem de 'lag' efectivamente
usada é obtida testando para baixo, de acordo com o seguinte algoritmo:

1. Estimar a regressão de Dickey-Fuller com k 'lags' da variável
   dependente.

2. O último 'lag' é significante? Se sim, executar o teste com com a ordem
   de 'lag', k. Senão, fazer k = k - 1; se k for igual a 0, executar o
   teste com a ordem de 'lag' 0, senão saltar para o passo 1.

No contexto do passo 2 acima, "significante" quer dizer que para o último
'lag', a estatística-t, que segue uma distribuição normal, tem um p-value
bilateral assimptótico menor ou igual a 0,10.

Os p-values para os testes de Dickey-Fuller baseiam-se em MacKinnon (1996).
O código relevante é incluído com a generosa permissão do autor.

Menu path:    /Variável/Teste de Dickey-Fuller aumentado

# anova Statistics

Arguments:  response treatment [ block ] 
Option:     --quiet (don't print results)

Analysis of Variance: response is a series measuring some effect of interest
and treatment must be a discrete variable that codes for two or more types
of treatment (or non-treatment). For two-way ANOVA, the block variable
(which should also be discrete) codes for the values of some control
variable.

Unless the --quiet option is given, this command prints a table showing the
sums of squares and mean squares along with an F-test. The F-test and its
P-value can be retrieved using the accessors $test and $pvalue respectively.

The null hypothesis for the F-test is that the mean response is invariant
with respect to the treatment type, or in words that the treatment has no
effect. Strictly speaking, the test is valid only if the variance of the
response is the same for all treatment types.

Note that the results shown by this command are in fact a subset of the
information given by the following procedure, which is easily implemented in
gretl. Create a set of dummy variables coding for all but one of the
treatment types. For two-way ANOVA, in addition create a set of dummies
coding for all but one of the "blocks". Then regress response on a constant
and the dummies using "ols". For a one-way design the ANOVA table is printed
via the --anova option to ols. In the two-way case the relevant F-test is
found by using the "omit" command. For example (assuming y is the response,
xt codes for the treatment, and xb codes for blocks):

	# one-way
	list dxt = dummify(xt)
	ols y 0 dxt --anova
	# two-way
	list dxb = dummify(xb)
	ols y 0 dxt dxb
	# test joint significance of dxt
	omit dxt --quiet

Menu path:    /Model/Other linear models/ANOVA

# append Dataset

Argument:   ficheiro-de-dados 

Abre um ficheiro de dados e acrescenta esse conteúdo ao conjunto de dados
actual, se os novos dados forem compatíveis. O programa tentará determinar
o formato do ficheiro de dados (nativo, texto simples, CVS, Gnumeric, Excel,
etc.).

Menu path:    /Ficheiro/Acrescentar dados

# ar Estimation

Arguments:  'lags' ; variável-dependente variáveis-independentes 
Option:     --vcv (mostrar matriz de covariância)
Example:    ar 1 3 4 ; y 0 x1 x2 x3

Determina estimativas para os parâmetros usando o procedimento iteractivo e
generalizado de Cochrane-Orcutt (ver a Secção 9.5 de Ramanathan, 2002). A
iteração termina quando os erros das somas de quadrados sucessivos não
difiram em mais que 0,005 porcento ou após 20 iterações.

"'lags'" é uma lista de 'lags' nos resíduos, terminada por um
ponto-e-vírgula. No exemplo acima o termo do erro é especificado como

  u(t) = rho(1)*u(t-1) + rho(3)*u(t-3) + rho(4)*u(t-4)

Menu path:    /Modelo/Série temporal/Estimação autoregressiva

# ar1 Estimation

Arguments:  depvar indepvars 
Options:    --hilu (use Hildreth-Lu procedure)
            --pwe (use Prais-Winsten estimator)
            --vcv (print covariance matrix)
            --no-corc (do not fine-tune results with Cochrane-Orcutt)
Examples:   ar1 1 0 2 4 6 7
            ar1 y 0 xlist --hilu --no-corc
            ar1 y 0 xlist --pwe

Computes feasible GLS estimates for a model in which the error term is
assumed to follow a first-order autoregressive process.

The default method is the Cochrane-Orcutt iterative procedure (see, for
example, Section 9.4 of Ramanathan, 2002). Iteration is terminated when
successive estimates of the autocorrelation coefficient do not differ by
more than 0.001 or after 20 iterations.

If the --hilu option is given, the Hildreth-Lu search procedure is used. The
results are then fine-tuned using the Cochrane-Orcutt method, unless the
--no-corc flag is specified. (The latter option is ignored if --hilu is not
specified.)

If the --pwe option is given, the Prais-Winsten estimator is used. This
involves an an iteration similar to Cochrane-Orcutt; the difference is that
while Cochrane-Orcutt discards the first observation, Prais-Winsten makes
use of it. See, for example, Chapter 13 of Greene's Econometric Analysis
(2000) for details.

Menu path:    /Model/Time series/Cochrane-Orcutt
Menu path:    /Model/Time series/Hildreth-Lu
Menu path:    /Model/Time series/Prais-Winsten

# arbond Estimation

Argument:   p [ q ] ; variável-dependente variáveis-independentes [ ; instrumentos ] 
Options:    --vcv (mostrar matriz de covariância)
            --two-step (executa estimação pelo Método Generalizado dos Momentos (GMM) de 2-fases)
            --time-dummies (acrescenta variáveis auxiliares tempo)
            --asymptotic (erros padrão assimptóticos)
Examples:   arbond 2 ; y Dx1 Dx2
            arbond 2 5 ; y Dx1 Dx2 ; Dx1
            arbond 1 ; y Dx1 Dx2 ; Dx1 GMM(x2,2,3)
            See also arbond91.inp

Executa a estimação de modelos de painel dinâmico (ou seja, modelos de
painel que contenham um ou mais 'lags' da variável dependente) recorrendo
ao método Método Generalizado dos Momentos (GMM) desenvolvido por Arellano
e Bond (1991).

O parâmetro p representa a ordem da autoregressão para a variável
dependente. O parâmetro opcional q indica o máximo 'lag' do nível da
variável dependente a ser usada como um instrumento. Se este argumento for
omitido, ou de valor 0, todos os 'lags' disponíveis são usados.

A variável dependente deve ser dada na forma de níveis; ela será
automaticamente diferenciada (pois este estimador usa diferenciação para
anular os efeitos individuais). As variáveis independentes não são
automaticamente diferenciadas; se você pretende usar diferenças (o que
acontece em geral para variáveis quantitativas, mas não será, por
exemplo, para variáveis auxiliares temporais), deve primeiro criar essas
diferenças e depois especificar estas como sendo regressoras.

O último campo (opcional) do comando serve para especificar instrumentos.
Se não for dado nenhum, então é assumido que todas as variáveis
independentes são estritamente exógenas. Se você especificar alguns
instrumentos, então deve incluir na lista quaisquer variáveis
independentes estritamente exógenas. Para regressores predeterminados,
você pode usar a função GMM para incluir uma gama de 'lags' especificada
no modo bloco-diagonal. Isto é ilustrado no terceiro exemplo acima. O
primeiro argumento de GMM é o nome da variável em questão, o segundo é o
mínimo 'lag' a ser usado como instrumento, e o terceiro é o máximo 'lag'.
Se o terceiro argumento for dado como 0, todos os 'lags' disponíveis são
usados.

Por omissão são apresentados os resultados da estimação 1-fase (com
erros padrão robustos). Opcionalmente, você pode escolher estimação de
2-fases. Em ambos os casos são efectuados testes de autocorrelação de
ordem 1 e 2, assim como o teste de sobre-identificação de Sargan e o teste
de Wald para a significância conjunta dos regressores. Note-se que este
modelo de diferenciação com autocorrelação de primeira-ordem não
invalida o modelo, mas que a autocorrelação de segunda-ordem não respeita
as assunções estatísticas presentes.

No caso da estimação de 2-fases, por omissão, os erros padrão são
determinados usando a correcção de amostra-finita sugerida por Windmeijer
(2005). Os erros padrão assimptóticos associados ao estimador de 2-fases
são em geral considerados como guias para inferência pouco fiáveis, mas
se por alguma razão os pretender ver, você pode usar a opção
--asymptotic para desligar a correcção de Windmeijer.

Se for dada a opção --time-dummies, são acrescentadas variáveis
auxiliares temporais aos regressores especificados. Para evitar
colinearidade perfeita com a constante, o número de auxiliares é uma
unidade a menos que o número máximo de períodos usados na estimação. As
auxiliares são introduzidas por níveis; se você deseja usar auxiliares de
tempo na forma de primeiras-diferenças, você terá que definir e
acrescentar essas variáveis manualmente.

Menu path:    /Modelo/Painel/Arellano-Bond

# arch Tests

Arguments:  ordem variável-dependente variáveis-independentes 
Example:    arch 4 y 0 x1 x2 x3

Testa o modelo em ARCH (Heterosquedicidade Condicional Autoregressiva) da
ordem de 'lag' especificada. Se a estatística de teste LM tiver um p-value
abaixo de 0,10, então a estimação ARCH também é executada. Se a
variância predita de qualquer observação na regressão auxiliar não for
positiva, então é usado o correspondente resíduo ao quadrado. Segue-se
uma estimação por Mínimos Quadrados com Pesos sobre o modelo original.

Ver também "garch".

Menu path:    Janela do modelo, /Testes/ARCH

# arima Estimation

Arguments:  p d q [ ; P D Q ] ; variável-dependente [ variáveis-independentes ] 
Options:    --verbose (mostrar detalhes das iterações)
            --vcv (mostrar matriz de covariância)
            --nc (não incluir uma constante)
            --conditional (usar verosimilhança máxima condicional)
            --x-12-arima (usar X-12-ARIMA para estimação)
Examples:   arima 1 0 2 ; y
            arima 2 0 2 ; y 0 x1 x2 --verbose
            arima 0 1 1 ; 0 1 1 ; y --nc

Se não for dada a lista de variáveis-independentes, é estimado um modelo
ARIMA (Média Móvel, Autoregressiva, Integrada) univariado. O valores
inteiros p, d e q representam respectivamente, a ordem autoregressiva (AR),
a ordem de diferenciação, e ordem da média móvel (MA). Estes valores
podem ser fornecidos na forma numérica, ou como nome de variáveis
escalares pré-existentes. Por exemplo, um valor de 1 em d, significa que a
primeira diferença da variável dependente deve ser obtida antes de estimar
os parâmetros ARMA.

Os valores inteiros opcionais,P, D e Q representam respectivamente, a
sazonalidade AR, a ordem para diferenciação de sazonalidade e a ordem de
sazonalidade MA. Estes são apenas aplicáveis se os dados tiverem uma
frequência superior a 1 (por exemplo, quadrimestral ou mensal). Mais uma
vez, estas ordens podem ser dadas na forma numérica ou como variáveis.

No caso univariado é incluído no modelo por omissão, um interceptor, mas
isto pode ser suprimido com a opção --nc. Se forem fornecidas
variáveis-independentes, o modelo passa a ser ARMAX; neste caso a constante
deve ser explicitamente incluída se você pretender um interceptor (tal
como no segundo exemplo acima).

Existe outra forma alternativa para este comando: se você não pretende
aplicar diferenciação (seja sazonal ou não-sazonal), você pode omitir
ambos os parâmetros d e D, em vez de entrar explicitamente zeros. Além
disso, arma é um sinónimo ou aliás para arima. Assim, por exemplo, o
comando seguinte é válido para especificar o modelo ARMA(2, 1):

	arma 2 1 ; y

O normal é usar a funcionalidade "nativa" gretl ARMA, com estimação de
Máxima Verosimilhança (ML) exacta (usando o filtro de Kalman). Outras
opções são: código nativo, ML condicional; X-12-ARIMA, ML exacta; e
X-12-ARIMA, ML condicional. (As últimas duas opções estão disponíveis
apenas se o programa X-12-ARIMA estiver instalado.) Para detalhes sobre
estas opções, veja por favor the Gretl User's Guide.

O valor AIC retornado em ligação com os modelos ARIMA é calculado
conforme a definição usada no programa X-12-ARIMA, nomeadamente

  AIC = -2L + 2k

onde L é o logaritmo da verosimilhança e k é o número total de
parâmetros estimados. Note-se que o programa X-12-ARIMA não produz
critérios de informação tal como o AIC quando a estimação é por ML
condicional.

A imagem da "frequência" apresentada em ligação com as raízes AR e MA é
valor lambda que resolve

  z = r * exp(i*2*pi*lambda)

onde z é a raiz em questão e r o seu módulo.

Menu path:    /Modelo/Série temporal/ARIMA
Other access: Menu de contexto da janela principal (selecção singular)

# biprobit Estimation

Arguments:  depvar1 depvar2 indepvars1 [ ; indepvars2 ] 
Options:    --vcv (print covariance matrix)
            --robust (robust standard errors)
            --opg (see below)
            --save-xbeta (see below)
            --verbose (print extra information)
Examples:   biprobit y1 y2 0 x1 x2
            biprobit y1 y2 0 x11 x12 ; 0 x21 x22
            See also biprobit.inp

Estimates a bivariate probit model, using the Newton-Raphson method to
maximize the likelihood.

The argument list starts with the two (binary) dependent variables, followed
by a list of regressors. If a second list is given, separated by a
semicolon, this is interpreted as a set of regressors specific to the second
equation, with indepvars1 being specific to the first equation; otherwise
indepvars1 is taken to represent a common set of regressors.

By default, standard errors are computed using a numerical approximation to
the Hessian at convergence. But if the --opg option is given the covariance
matrix is based on the Outer Product of the Gradient (OPG), or if the
--robust option is given QML standard errors are calculated, using a
"sandwich" of the inverse of the Hessian and the OPG.

After successful estimation, the accessor $uhat retrieves a matrix with two
columns holding the generalized residuals for the two equations; that is,
the expected values of the disturbances conditional on the observed outcomes
and covariates. By default $yhat retrieves a matrix with four columns,
holding the estimated probabilities of the four possible joint outcomes for
(y_1, y_2), in the order (1,1), (1,0), (0,1), (0,0). Alternatively, if the
option --save-xbeta is given, $yhat has two columns and holds the values of
the index functions for the respective equations.

The output includes a likelihood ratio test of the null hypothesis that the
disturbances in the two equations are uncorrelated.

# boxplot Graphs

Argument:   lista-de-variáveis 
Option:     --notches (mostrar intervalo de 90 porcento para a mediana delimitado por entalhes)

Estes gráficos (criados por Tukey e Chambers) apresentam a distribuição
de uma variável. A caixa central contém os 50 porcento dos dados centrais,
i.e. está limitada pelos primeiro e terceiro quartis. Os "bigodes"
estendem-se até aos valores mínimo e máximo. É desenhada uma linha que
corta a caixa na mediana.

No caso de caixas com entalhes, os entalhes representam os limites do
intervalo de confiança para a mediana de cerca de 90 porcento. Isto é
obtido usando o método 'bootstrap'.

A seguir a cada variável indicada no comando caixa-com-bigodes, pode-se
acrescentar uma expressão Booleana para restringir a variável em questão.
Tem que se inserir um espaço entre o nome da variável ou número, e a
expressão. Suponha que você dispõe de valores de salários (salary) para
homens e mulheres, e que tem a variável auxiliar GENDER com valor 1 para
homens e 0 para mulheres. Nesse caso você podia ter gráficos
caixa-com-bigodes comparativos com a seguinte "lista-de-variáveis":

	salary (GENDER=1) salary (GENDER=0)

Alguns detalhes das caixas-com-bigodes do gretl podem ser controlados por
intermédio de um ficheiro (de texto simples) com o nome .boxplotrc. Para
mais detalhes sobre isto veja the Gretl User's Guide.

Menu path:    /Ver/Gráfico das variáveis/Caixa com bigodes

# break Programming

Sai de um ciclo. Este comando pode apenas ser usado dentro de um ciclo; ele
termina a execução de comandos e sai de dentro do ciclo (o mais interior).
Ver também "loop".

# chow Tests

Argument:   obs 
Examples:   chow 25
            chow 1988:1

Tem que se seguir a uma regressão de Mínimos Quadrados (OLS). Cria uma
variável auxiliar que é igual a 1 a partir do ponto especificado por obs
até ao final da amostra, caso contrário é 0, e cria também termos de
interacção entre esta variável auxiliar e as variáveis independentes
originais. É executada uma regressão aumentada que inclui estes termos e
é calculada a estatística F, considerando a regressão aumentada como não
restringida e a original como restringida. Esta estatística é apropriada
para testar a hipótese nula de não existência de quebra estrutural no
ponto de separação dado.

Menu path:    Janela do modelo, /Testes/Teste de Chow

# clear Programming

Options:    --dataset (clear dataset only)
            --other (clear everything but the dataset)

With no options, clears all saved objects, including the current dataset if
any, out of memory. Note that opening a new dataset, or using the "nulldata"
command to create an empty dataset, also has this effect, so use of "clear"
is not usually necessary.

If the --dataset option is given, then only the dataset is cleared; other
saved objects such as named matrices and scalars are preserved.

If the --other option is given, then the current dataset, if any, is
preserved but all other saved objects are destroyed.

# catch Programming

Syntax:     
        catch command

This is not a command in its own right but can be used as a prefix to most
regular commands: the effect is to prevent termination of a script if an
error occurs in executing the command. If an error does occur, this is
registered in an internal error code which can be accessed as $error (a zero
value indicates success). The value of $error should always be checked
immediately after using catch, and appropriate action taken if the command
failed.

The catch keyword cannot be used before if, elif or endif.

# chow Tests

Variants:   chow obs
            chow dummyvar --dummy
Options:    --dummy (use a pre-existing dummy variable)
            --quiet (don't print estimates for augmented model)
Examples:   chow 25
            chow 1988:1
            chow female --dummy

Must follow an OLS regression. If an observation number or date is given,
provides a test for the null hypothesis of no structural break at the given
split point. The procedure is to create a dummy variable which equals 1 from
the split point specified by obs to the end of the sample, 0 otherwise, and
also interaction terms between this dummy and the original regressors. If a
dummy variable is given, tests the null hypothesis of structural homogeneity
with respect to that dummy. Again, interaction terms are added. In either
case an augmented regression is run including the additional terms.

By default an F statistic is calculated, taking the augmented regression as
the unrestricted model and the original as the restricted. But if the
original model used a robust estimator for the covariance matrix, the test
statistic is a Wald chi-square value based on a robust estimator of the
covariance matrix for the augmented regression.

Menu path:    Model window, /Tests/Chow test

# clear Programming

Options:    --dataset (clear dataset only)
            --other (clear everything but the dataset)

With no options, clears all saved objects, including the current dataset if
any, out of memory. Note that opening a new dataset, or using the "nulldata"
command to create an empty dataset, also has this effect, so use of "clear"
is not usually necessary.

If the --dataset option is given, then only the dataset is cleared; other
saved objects such as named matrices and scalars are preserved.

If the --other option is given, then the current dataset, if any, is
preserved but all other saved objects are destroyed.

# coeffsum Tests

Argument:   lista-de-variáveis 
Example:    coeffsum xt xt_1 xr_2
            See also restrict.inp

Tem que se seguir a uma regressão. Calcula a soma dos coeficientes nas
variáveis indicadas na lista-de-variáveis. Apresenta esta soma juntamente
com o seu erro padrão e o p-value para a hipótese nula de que a soma é
zero.

Note-se a diferença entre este teste e "omit", que testa a hipótese nula
de que os coeficientes num conjunto especificado de variáveis independentes
são todos iguais a zero.

Menu path:    Janela do modelo, /Testes/Soma de coeficientes

# coint Tests

Arguments:  ordem variável-dependente variáveis-independentes 
Options:    --nc (não incluir uma constante)
            --ct (incluir constante e tendência)
            --ctt (incluir constante e tendência quadrática)
            --skip-df (não efectuar testes DF nas variáveis individuais)
Examples:   coint 4 y x1 x2
            coint 0 y x1 x2 --ct --skip-df

O teste de cointegração Engle-Granger. O procedimento por omissão é: (1)
efectuar testes de Dickey-Fuller (DF) segundo a hipótese nula de que cada
variável listada tem uma raiz unitária; (2) estima a regressão de
cointegração; e (3)executar um teste DF sobre os resíduos da regressão
de cointegração. Se for dada a opção --skip-df, o passo (1) é omitido.

Se a ordem de 'lag' especificada é positiva, todos os testes Dickey-Fuller
usam essa ordem. Se a ordem for antecedida de um sinal menos, ela é
encarada como sendo o máximo 'lag' e a ordem efectivamente usada em cada
caso é obtida testando para baixo: ver o comando "adf" para detalhes.

Por omissão, a regressão de cointegração contém uma constante. Se você
deseja suprimir a constante, acrescente a opção --nc. Se você deseja
aumentar a lista de termos determinísticos na regressão de cointegração
com uma tendência linear ou quadrática, use a opção --ct ou --ctt. Estas
opções são mutualmente exclusivas.

Os P-values para este teste são baseados em MacKinnon (1996). O código
relevante é incluído com a generosa permissão do autor.

Menu path:    /Modelo/Série temporal/Testes de Cointegração/Engle-Granger

# coint2 Tests

Arguments:  ordem variável-dependente variáveis-independentes 
Options:    --nc (sem constante)
            --rc (constante restringida)
            --crt (constante e tendência restringida)
            --ct (constante e tendência não restringida)
            --seasonals (incluir auxiliares sazonais centradas)
            --quiet (apenas mostrar os testes)
            --verbose (mostrar detalhes das regressões auxiliares)
Examples:   coint2 2 y x
            coint2 4 y x1 x2 --verbose
            coint2 3 y x1 x2 --rc

Executa o teste de Johansen para a cointegração entre as variáveis
listadas para a dada ordem de 'lag'. Os valores críticos são determinados
usando a aproximação gamma de J. Doornik (Doornik, 1998). Para detalhes
sobre este teste ver o Capítulo 20 do livro de Hamilton, Time Series
Analysis (1994).

A inclusão de termos determinísticos no modelo é controlada por
intermédio das opções. Por omissão, se não tiver sido indicada nenhuma
opção, será incluída uma "constante não restringida", o que permite a
presença de um interceptor não-nulo nas relações cointegrantes assim
como uma tendência nos níveis das variáveis endógenas. Na literatura
derivada do trabalho de Johansen (ver por exemplo o livro dele de 1995) isto
é frequentemente referido como sendo o "caso 3". As primeiras quatro
opções apresentadas acima, que são mutualmente exclusivas, produzem
respectivamente os casos 1, 2, 4, e 5. O significado destes casos e os
critérios para seleccionar um caso estão explicados no the Gretl User's
Guide.

A opção --seasonals, que pode ser combinada com qualquer outra opção,
especifica a inclusão de um conjunto de variáveis auxiliares sazonais.
Esta opção apenas está disponível para dados trimestrais ou mensais.

A seguinte tabela serve como uma guia à interpretação dos resultados
apresentados pelo teste, num caso de 3-variáveis. H0 significa a hipótese
nula, H1 a hipótese alternativa, e c o número de relações cointegrantes.

                 Ordem    Teste Traço        Teste Lmax
                          H0     H1          H0     H1
                 ---------------------------------------
                  0      c = 0  c = 3       c = 0  c = 1
                  1      c = 1  c = 3       c = 1  c = 2
                  2      c = 2  c = 3       c = 2  c = 3
                 ---------------------------------------

Ver também o comando "vecm".

Menu path:    /Modelo/Série temporal/Testes de Cointegração/Johansen

# corr Statistics

Argument:   [ lista-de-variáveis ] 
Example:    corr y x1 x2 x3

Apresenta os coeficientes de correlação emparelhados das variáveis em
lista-de-variáveis, ou de todas as variáveis no conjunto de dados se não
for dada a lista-de-variáveis.

Menu path:    /Ver/Matriz de correlação
Other access: Menu de contexto da janela principal (selecção múltipla)

# corrgm Statistics

Arguments:  variável [ maxlag ] 
Example:    corrgm x 12

Apresenta os valores da função de autocorrelação para a variável, que
pode ser especificada por nome ou por número. Os valores são definidos
pela equação rho(u(t), u(t-s)) onde u_t é a t-ésima observação da
variável u e s é o número de "lags".

Também são apresentadas as autocorrelações parciais (obtidas segundo o
algoritmo de Durbin-Levinson): estas constituem a rede dos efeitos dos
"lags" intervenientes. O comando também produz o gráfico correlograma e
apresenta a estatística de teste Q de Box-Pierce, para a hipótese nula de
que a série temporal é "ruído branco": terá uma distribuição
qui-quadrado assimptótico com os graus de liberdade iguais ao número de
"lags" usados.

Se o valor maxlag for especificado o comprimento do correlograma fica
limitado a esse máximo número de "lags", senão o comprimento é
determinado automáticamente, como uma função da frequência dos dados e
do número de observações.

Menu path:    /Variável/Correlograma
Other access: Menu de contexto da janela principal (selecção singular)

# cusum Tests

Option:     --squares (executa o teste CUSUMSQ)

Tem que se seguir à estimação de um modelo por via de OLS. Executa o
teste CUSUM -- ou se for dada a opção --squares, o teste CUSUMSQ -- para a
estabilidade dos parâmetros. É obtida uma série temporal de erros de
predição um passo-à-frente, pela execução de séries de regressões: a
primeira regressão usa as primeiras k observações e é usada para gerar a
predição da variável dependente na observação k + 1; a segunda usa a
primeira predição para a observação k + 2, e por aí a diante (onde k é
o número de parâmetros no modelo original).

A soma acumulada dos erros de predição escalados, ou os quadrados desses
erros, é mostrada e apresentada em gráfico. A hipótese nula para a
estabilidade dos parâmetros é rejeitada ao nível de cinco porcento, se a
soma acumulada se desviar do intervalo de confiança de 95 porcento.

No caso do teste CUSUM, é também apresentada a estatística de teste t de
Harvey-Collier, para a hipótese nula da estabilidade dos parâmetros. Ver o
livro Econometric Analysis de Greene para mais detalhes. Para o teste
CUSUMSQ, o intervalo de confiança a 95 porcento é calculado de acordo com
o algoritmo apresentado por Edgerton e Wells (1994).

Menu path:    Janela do modelo, /Testes/Teste CUSUM(SQ)

# data Dataset

Argument:   varlist 
Option:     --quiet (don't report results except on error)

Reads the variables in varlist from a database (gretl, RATS 4.0 or PcGive),
which must have been opened previously using the "open" command. The data
frequency and sample range may be established via the "setobs" and "smpl"
commands prior to using this command. Here is a full example:

	open macrodat.rat
	setobs 4 1959:1
	smpl ; 1999:4
	data GDP_JP GDP_UK

The commands above open a database named macrodat.rat, establish a quarterly
data set starting in the first quarter of 1959 and ending in the fourth
quarter of 1999, and then import the series named GDP_JP and GDP_UK.

If setobs and smpl are not specified in this way, the data frequency and
sample range are set using the first variable read from the database.

If the series to be read are of higher frequency than the working data set,
you may specify a compaction method as below:

	data (compact=average) LHUR PUNEW

The four available compaction methods are "average" (takes the mean of the
high frequency observations), "last" (uses the last observation), "first"
and "sum". If no method is specified, the default is to use the average.

Menu path:    /File/Databases

# dataset Dataset

Arguments:  keyword parameters 
Examples:   dataset addobs 24
            dataset insobs 10
            dataset compact 1
            dataset compact 4 last
            dataset expand interp
            dataset transpose
            dataset sortby x1
            dataset resample 500
            dataset renumber x 4
            dataset clear

Performs various operations on the data set as a whole, depending on the
given keyword, which must be addobs, insobs, clear, compact, expand,
transpose, sortby, dsortby, resample or renumber. Note: with the exception
of clear, these actions are not available when the dataset is currently
subsampled by selection of cases on some Boolean criterion.

addobs: Must be followed by a positive integer. Adds the specified number of
extra observations to the end of the working dataset. This is primarily
intended for forecasting purposes. The values of most variables over the
additional range will be set to missing, but certain deterministic variables
are recognized and extended, namely, a simple linear trend and periodic
dummy variables.

insobs: Must be followed by a positive integer no greater than the current
number of observations. Inserts a single observation at the specified
position. All subsequent data are shifted by one place and the dataset is
extended by one observation. All variables apart from the constant are given
missing values at the new observation. This action is not available for
panel datasets.

clear: No parameter required. Clears out the current data, returning gretl
to its initial "empty" state.

compact: Must be followed by a positive integer representing a new data
frequency, which should be lower than the current frequency (for example, a
value of 4 when the current frequency is 12 indicates compaction from
monthly to quarterly). This command is available for time series data only;
it compacts all the series in the data set to the new frequency. A second
parameter may be given, namely one of sum, first or last, to specify,
respectively, compaction using the sum of the higher-frequency values,
start-of-period values or end-of-period values. The default is to compact by
averaging.

expand: This command is only available for annual or quarterly time series
data: annual data can be expanded to quarterly, and quarterly data to
monthly frequency. By default all the series in the data set are padded out
to the new frequency by repeating the existing values, but if the modifier
interp is appended then the series are expanded using Chow-Lin
interpolation: the regressors are a constant and quadratic trend and an
AR(1) disturbance process is assumed.

transpose: No additional parameter required. Transposes the current data
set. That is, each observation (row) in the current data set will be treated
as a variable (column), and each variable as an observation. This command
may be useful if data have been read from some external source in which the
rows of the data table represent variables.

sortby: The name of a single series or list is required. If one series is
given, the observations on all variables in the dataset are re-ordered by
increasing value of the specified series. If a list is given, the sort
proceeds hierarchically: if the observations are tied in sort order with
respect to the first key variable then the second key is used to break the
tie, and so on until the tie is broken or the keys are exhausted. Note that
this command is available only for undated data.

dsortby: Works as sortby except that the re-ordering is by decreasing value
of the key series.

resample: Constructs a new dataset by random sampling, with replacement, of
the rows of the current dataset. One argument is required, namely the number
of rows to include. This may be less than, equal to, or greater than the
number of observations in the original data. The original dataset can be
retrieved via the command smpl full.

renumber: Requires the name of an existing series followed by an integer
between 1 and the number of series in the dataset minus one. Moves the
specified series to the specified position in the dataset, renumbering the
other series accordingly. (Position 0 is occupied by the constant, which
cannot be moved.)

Menu path:    /Data

# debug Programming

Argument:   function 

Experimental debugger for user-defined functions, available in the
command-line program, gretlcli, and in the GUI console. The debug command
should be invoked after the function in question is defined but before it is
called. The effect is that execution pauses when the function is called and
a special prompt is shown.

At the debugging prompt you can type next to execute the next command in the
function, or continue to allow execution of the function to continue
unimpeded. These commands can be abbreviated as n and c respectively. You
can also interpolate an instruction at this prompt, for example a print
command to reveal the current value of some variable of interest.

# delete Dataset

Argument:   varname 
Option:     --db (delete series from database)

This command is an all-purpose destructor for named variables (whether
series, scalars, matrices, strings or bundles). It should be used with
caution; no confirmation is asked.

In the case of series, varname may take the form of a named list, in which
case all series in the list are deleted, or it may take the form of an
explicit list of series given by name or ID number. Note that when you
delete series any series with higher ID numbers than those on the deletion
list will be re-numbered.

If the --db option is given, this command deletes the listed series not from
the current dataset but from a gretl database, assuming that a database has
been opened, and the user has write permission for file in question. See
also the "open" command.

Menu path:    Main window pop-up (single selection)

# diff Transformations

Argument:   varlist 

The first difference of each variable in varlist is obtained and the result
stored in a new variable with the prefix d_. Thus "diff x y" creates the new
variables

	d_x = x(t) - x(t-1)
	d_y = y(t) - y(t-1)

Menu path:    /Add/First differences of selected variables

# difftest Tests

Arguments:  var1 var2 
Options:    --sign (Sign test, the default)
            --rank-sum (Wilcoxon rank-sum test)
            --signed-rank (Wilcoxon signed-rank test)
            --verbose (print extra output)

Carries out a nonparametric test for a difference between two populations or
groups, the specific test depending on the option selected.

With the --sign option, the Sign test is performed. This test is based on
the fact that if two samples, x and y, are drawn randomly from the same
distribution, the probability that x_i > y_i, for each observation i, should
equal 0.5. The test statistic is w, the number of observations for which x_i
> y_i. Under the null hypothesis this follows the Binomial distribution with
parameters (n, 0.5), where n is the number of observations.

With the --rank-sum option, the Wilcoxon rank-sum test is performed. This
test proceeds by ranking the observations from both samples jointly, from
smallest to largest, then finding the sum of the ranks of the observations
from one of the samples. The two samples do not have to be of the same size,
and if they differ the smaller sample is used in calculating the rank-sum.
Under the null hypothesis that the samples are drawn from populations with
the same median, the probability distribution of the rank-sum can be
computed for any given sample sizes; and for reasonably large samples a
close Normal approximation exists.

With the --signed-rank option, the Wilcoxon signed-rank test is performed.
This is designed for matched data pairs such as, for example, the values of
a variable for a sample of individuals before and after some treatment. The
test proceeds by finding the differences between the paired observations,
x_i - y_i, ranking these differences by absolute value, then assigning to
each pair a signed rank, the sign agreeing with the sign of the difference.
One then calculates W_+, the sum of the positive signed ranks. As with the
rank-sum test, this statistic has a well-defined distribution under the null
that the median difference is zero, which converges to the Normal for
samples of reasonable size.

For the Wilcoxon tests, if the --verbose option is given then the ranking is
printed. (This option has no effect if the Sign test is selected.)

# discrete Transformations

Argument:   varlist 
Option:     --reverse (mark variables as continuous)

Marks each variable in varlist as being discrete. By default all variables
are treated as continuous; marking a variable as discrete affects the way
the variable is handled in frequency plots, and also allows you to select
the variable for the command "dummify".

If the --reverse flag is given, the operation is reversed; that is, the
variables in varlist are marked as being continuous.

Menu path:    /Variable/Edit attributes

# dpanel Estimation

Argument:   p ; depvar indepvars [ ; instruments ] 
Options:    --quiet (don't show estimated model)
            --vcv (print covariance matrix)
            --two-step (perform 2-step GMM estimation)
            --system (add equations in levels)
            --time-dummies (add time dummy variables)
            --dpdstyle (emulate DPD package for Ox)
            --asymptotic (uncorrected asymptotic standard errors)
Examples:   dpanel 2 ; y x1 x2
            dpanel 2 ; y x1 x2 --system
            dpanel {2 3} ; y x1 x2 ; x1
            dpanel 1 ; y x1 x2 ; x1 GMM(x2,2,3)
            See also bbond98.inp

Carries out estimation of dynamic panel data models (that is, panel models
including one or more lags of the dependent variable) using either the
GMM-DIF or GMM-SYS method.

The parameter p represents the order of the autoregression for the dependent
variable. In the simplest case this is a scalar value, but a pre-defined
matrix may be given for this argument, to specify a set of (possibly
non-contiguous) lags to be used.

The dependent variable and regressors should be given in levels form; they
will be differenced automatically (since this estimator uses differencing to
cancel out the individual effects).

The last (optional) field in the command is for specifying instruments. If
no instruments are given, it is assumed that all the independent variables
are strictly exogenous. If you specify any instruments, you should include
in the list any strictly exogenous independent variables. For predetermined
regressors, you can use the GMM function to include a specified range of
lags in block-diagonal fashion. This is illustrated in the third example
above. The first argument to GMM is the name of the variable in question,
the second is the minimum lag to be used as an instrument, and the third is
the maximum lag. The same syntax can be used with the GMMlevel function to
specify GMM-type instruments for the equations in levels.

By default the results of 1-step estimation are reported (with robust
standard errors). You may select 2-step estimation as an option. In both
cases tests for autocorrelation of orders 1 and 2 are provided, as well as
the Sargan overidentification test and a Wald test for the joint
significance of the regressors. Note that in this differenced model
first-order autocorrelation is not a threat to the validity of the model,
but second-order autocorrelation violates the maintained statistical
assumptions.

In the case of 2-step estimation, standard errors are by default computed
using the finite-sample correction suggested by Windmeijer (2005). The
standard asymptotic standard errors associated with the 2-step estimator are
generally reckoned to be an unreliable guide to inference, but if for some
reason you want to see them you can use the --asymptotic option to turn off
the Windmeijer correction.

If the --time-dummies option is given, a set of time dummy variables is
added to the specified regressors. The number of dummies is one less than
the maximum number of periods used in estimation, to avoid perfect
collinearity with the constant. The dummies are entered in differenced form
unless the --dpdstyle option is given, in which case they are entered in
levels.

For further details and examples, please see the Gretl User's Guide.

Menu path:    /Model/Panel/Dynamic panel model

# dummify Transformations

Argument:   varlist 
Options:    --drop-first (omit lowest value from encoding)
            --drop-last (omit highest value from encoding)

For any suitable variables in varlist, creates a set of dummy variables
coding for the distinct values of that variable. Suitable variables are
those that have been explicitly marked as discrete, or those that take on a
fairly small number of values all of which are "fairly round" (multiples of
0.25).

By default a dummy variable is added for each distinct value of the variable
in question. For example if a discrete variable x has 5 distinct values, 5
dummy variables will be added to the data set, with names Dx_1, Dx_2 and so
on. The first dummy variable will have value 1 for observations where x
takes on its smallest value, 0 otherwise; the next dummy will have value 1
when x takes on its second-smallest value, and so on. If one of the option
flags --drop-first or --drop-last is added, then either the lowest or the
highest value of each variable is omitted from the encoding (which may be
useful for avoiding the "dummy variable trap").

This command can also be embedded in the context of a regression
specification. For example, the following line specifies a model where y is
regressed on the set of dummy variables coding for x. (Option flags cannot
be passed to "dummify" in this context.)

	ols y dummify(x)

# duration Estimation

Arguments:  depvar indepvars [ ; censvar ] 
Options:    --exponential (use exponential distribution)
            --loglogistic (use log-logistic distribution)
            --lognormal (use log-normal distribution)
            --medians (fitted values are medians)
            --robust (robust (QML) standard errors)
            --vcv (print covariance matrix)
            --verbose (print details of iterations)
Examples:   duration y 0 x1 x2
            duration y 0 x1 x2 ; cens

Estimates a duration model: the dependent variable (which must be positive)
represents the duration of some state of affairs, for example the length of
spells of unemployment for a cross-section of respondents. By default the
Weibull distribution is used but the exponential, log-logistic and
log-normal distributions are also available.

If some of the duration measurements are right-censored (e.g. an
individual's spell of unemployment has not come to an end within the period
of observation) then you should supply the trailing argument censvar, a
series in which non-zero values indicate right-censored cases.

By default the fitted values obtained via the accessor $yhat are the
conditional means of the durations, but if the --medians option is given
then $yhat provides the conditional medians instead.

Please see the Gretl User's Guide for details.

Menu path:    /Model/Nonlinear models/Duration data...

# elif Programming

See "if".

# else Programming

See "if". Note that "else" requires a line to itself, before the following
conditional command. You can append a comment, as in

	else # OK, do something different

But you cannot append a command, as in

	else x = 5 # wrong!

# end Programming

Ends a block of commands of some sort. For example, "end system" terminates
an equation "system".

# endif Programming

See "if".

# endloop Programming

Marks the end of a command loop. See "loop".

# eqnprint Printing

Argument:   [ -f filename ] 
Option:     --complete (Create a complete document)

Must follow the estimation of a model. Prints the estimated model in the
form of a LaTeX equation. If a filename is specified using the -f flag
output goes to that file, otherwise it goes to a file with a name of the
form equation_N.tex, where N is the number of models estimated to date in
the current session. See also "tabprint".

If the --complete flag is given, the LaTeX file is a complete document,
ready for processing; otherwise it must be included in a document.

Menu path:    Model window, /LaTeX

# equation Estimation

Arguments:  depvar indepvars 
Example:    equation y x1 x2 x3 const

Specifies an equation within a system of equations (see "system"). The
syntax for specifying an equation within an SUR system is the same as that
for, e.g., "ols". For an equation within a Three-Stage Least Squares system
you may either (a) give an OLS-type equation specification and provide a
common list of instruments using the "instr" keyword (again, see "system"),
or (b) use the same equation syntax as for "tsls".

# estimate Estimation

Arguments:  [ systemname ] [ estimator ] 
Options:    --iterate (iterate to convergence)
            --no-df-corr (no degrees of freedom correction)
            --geomean (see below)
            --quiet (don't print results)
            --verbose (print details of iterations)
Examples:   estimate "Klein Model 1" method=fiml
            estimate Sys1 method=sur
            estimate Sys1 method=sur --iterate

Calls for estimation of a system of equations, which must have been
previously defined using the "system" command. The name of the system should
be given first, surrounded by double quotes if the name contains spaces. The
estimator, which must be one of "ols", "tsls", "sur", "3sls", "fiml" or
"liml", is preceded by the string method=. These arguments are optional if
the system in question has already been estimated and occupies the place of
the "last model"; in that case the estimator defaults to the previously used
value.

If the system in question has had a set of restrictions applied (see the
"restrict" command), estimation will be subject to the specified
restrictions.

If the estimation method is "sur" or "3sls" and the --iterate flag is given,
the estimator will be iterated. In the case of SUR, if the procedure
converges the results are maximum likelihood estimates. Iteration of
three-stage least squares, however, does not in general converge on the
full-information maximum likelihood results. The --iterate flag is ignored
for other methods of estimation.

If the equation-by-equation estimators "ols" or "tsls" are chosen, the
default is to apply a degrees of freedom correction when calculating
standard errors. This can be suppressed using the --no-df-corr flag. This
flag has no effect with the other estimators; no degrees of freedom
correction is applied in any case.

By default, the formula used in calculating the elements of the
cross-equation covariance matrix is

  sigma(i,j) = u(i)' * u(j) / T

If the --geomean flag is given, a degrees of freedom correction is applied:
the formula is

  sigma(i,j) = u(i)' * u(j) / sqrt((T - ki) * (T - kj))

where the ks denote the number of independent parameters in each equation.

If the verbose option is given and an iterative method is specified, details
of the iterations are printed.

# fcast Prediction

Arguments:  [ startobs endobs ] [ steps-ahead ] [ varname ] 
Options:    --dynamic (create dynamic forecast)
            --static (create static forecast)
            --out-of-sample (generate post-sample forecast)
            --no-stats (don't print forecast statistics)
            --quiet (don't print anything)
            --rolling (see below)
            --plot[=filename] (see below)
Examples:   fcast 1997:1 2001:4 f1
            fcast fit2
            fcast 2004:1 2008:3 4 rfcast --rolling

Must follow an estimation command. Forecasts are generated for a certain
range of observations: if startobs and endobs are given, for that range (if
possible); otherwise if the --out-of-sample option is given, for
observations following the range over which the model was estimated;
otherwise over the currently defined sample range. If an out-of-sample
forecast is requested but no relevant observations are available, an error
is flagged. Depending on the nature of the model, standard errors may also
be generated; see below. Also see below for the special effect of the
--rolling option.

If the last model estimated is a single equation, then the optional varname
argument has the following effect: the forecast values are not printed, but
are saved to the dataset under the given name. If the last model is a system
of equations, varname has a different effect, namely selecting a particular
endogenous variable for forecasting (the default being to produce forecasts
for all the endogenous variables). In the system case, or if varname is not
given, the forecast values can be retrieved using the accessor $fcast, and
the standard errors, if available, via $fcerr.

The choice between a static and a dynamic forecast applies only in the case
of dynamic models, with an autoregressive error process or including one or
more lagged values of the dependent variable as regressors. Static forecasts
are one step ahead, based on realized values from the previous period, while
dynamic forecasts employ the chain rule of forecasting. For example, if a
forecast for y in 2008 requires as input a value of y for 2007, a static
forecast is impossible without actual data for 2007. A dynamic forecast for
2008 is possible if a prior forecast can be substituted for y in 2007.

The default is to give a static forecast for any portion of the forecast
range that lies within the sample range over which the model was estimated,
and a dynamic forecast (if relevant) out of sample. The dynamic option
requests a dynamic forecast from the earliest possible date, and the static
option requests a static forecast even out of sample.

The rolling option is presently available only for single-equation models
estimated via OLS. When this option is given the forecasts are recursive.
That is, each forecast is generated from an estimate of the given model
using data from a fixed starting point (namely, the start of the sample
range for the original estimation) up to the forecast date minus k, where k
is the number of steps ahead, which must be given in the steps-ahead
argument. The forecasts are always dynamic if this is applicable. Note that
the steps-ahead argument should be given only in conjunction with the
rolling option.

The --plot option (available only in the case of single-equation estimation)
calls for a plot file to be produced, containing a graphical representation
of the forecast. When no filename parameter is given, gretl writes a gnuplot
command file with a name on the pattern gpttmp01.plt to the user's gretl
working directory (with the number incremented for successive plots). If a
filename is appended, its extension is used to determine the type of file to
be written (.eps for EPS, .pdf for PDF, or .png for PNG; any other extension
gives a gnuplot command file). For example,

	fcast --plot=fc.pdf

will generate a graphic in PDF format. Absolute pathnames are respected,
otherwise files are written to the gretl working directory.

The nature of the forecast standard errors (if available) depends on the
nature of the model and the forecast. For static linear models standard
errors are computed using the method outlined by Davidson and MacKinnon
(2004); they incorporate both uncertainty due to the error process and
parameter uncertainty (summarized in the covariance matrix of the parameter
estimates). For dynamic models, forecast standard errors are computed only
in the case of a dynamic forecast, and they do not incorporate parameter
uncertainty. For nonlinear models, forecast standard errors are not
presently available.

Menu path:    Model window, /Analysis/Forecasts

# foreign Programming

Syntax:     foreign language=lang
Options:    --send-data (pre-load the current dataset; see below)
            --quiet (suppress output from foreign program)

This command opens a special mode in which commands to be executed by
another program are accepted. You exit this mode with end foreign; at this
point the stacked commands are executed.

At present three "foreign" programs are supported in this way, GNU R
(language=R), Jurgen Doornik's Ox (language=Ox) and GNU Octave
(language=Octave). Language names are recognized on a case-insensitive
basis.

The --send-data option is valid only in connection with R and Octave; it has
the effect of making the entire current gretl dataset available within the
target program, under the name gretldata.

See the Gretl User's Guide for details and examples.

# fractint Statistics

Arguments:  series [ order ] 
Options:    --gph (do Geweke and Porter-Hudak test)
            --all (do both tests)
            --quiet (don't print results)

Tests the specified series for fractional integration ("long memory"). The
null hypothesis is that the integration order of the series is zero. By
default the local Whittle estimator (Robinson, 1995) is used but if the
--gph option is given the GPH test (Geweke and Porter-Hudak, 1983) is
performed instead. If the --all flag is given then the results of both tests
are printed.

For details on this sort of test, see Phillips and Shimotsu (2004).

If the optional order argument is not given the order for the test(s) is set
automatically as the lesser of T/2 and T^0.6.

The results can be retrieved using the accessors $test and $pvalue. These
values are based on the Local Whittle Estimator unless the --gph option is
given.

Menu path:    /Variable/Unit root tests/Fractional integration

# freq Statistics

Argument:   series 
Options:    --nbins=n (specify number of bins)
            --min=minval (specify minimum, see below)
            --binwidth=width (specify bin width, see below)
            --quiet (suppress printing of graph)
            --normal (test for the normal distribution)
            --gamma (test for gamma distribution)
            --silent (don't print anything)
            --show-plot (see below)
Examples:   freq x
            freq x --normal
            freq x --nbins=5
            freq x --min=0 --binwidth=0.10

With no options given, displays the frequency distribution for series (given
by name or number), with the number of bins and their size chosen
automatically.

To control the presentation of the distribution you may specify either the
number of bins or the minimum value plus the width of the bins, as shown in
the last two examples above. The --min option sets the lower limit of the
left-most bin.

If the --normal option is given, the Doornik-Hansen chi-square test for
normality is computed. If the --gamma option is given, the test for
normality is replaced by Locke's nonparametric test for the null hypothesis
that the variable follows the gamma distribution; see Locke (1976), Shapiro
and Chen (2001). Note that the parameterization of the gamma distribution
used in gretl is (shape, scale).

In interactive mode a graph of the distribution is displayed by default. The
--quiet flag can be used to suppress this. Conversely, the graph is not
usually shown when the "freq" is used in a script, but you can force its
display by giving the --show-plot option. (This does not apply when using
the command-line program, gretlcli.)

The --silent flag suppresses the usual output entirely. This makes sense
only in conjunction with one or other of the distribution test options: the
test statistic and its p-value are recorded, and can be retrieved using the
accessors $test and $pvalue.

Menu path:    /Variable/Frequency distribution

# function Programming

Argument:   fnname 

Opens a block of statements in which a function is defined. This block must
be closed with end function. Please see the Gretl User's Guide for details.

# garch Estimation

Arguments:  p q ; depvar [ indepvars ] 
Options:    --robust (robust standard errors)
            --verbose (print details of iterations)
            --vcv (print covariance matrix)
            --nc (do not include a constant)
            --stdresid (standardize the residuals)
            --fcp (use Fiorentini, Calzolari, Panattoni algorithm)
            --arma-init (initial variance parameters from ARMA)
Examples:   garch 1 1 ; y
            garch 1 1 ; y 0 x1 x2 --robust

Estimates a GARCH model (GARCH = Generalized Autoregressive Conditional
Heteroskedasticity), either a univariate model or, if indepvars are
specified, including the given exogenous variables. The integer values p and
q (which may be given in numerical form or as the names of pre-existing
scalar variables) represent the lag orders in the conditional variance
equation:

  h(t) = a(0) + sum(i=1 to q) a(i)*u(t-i)^2 + sum(j=1 to p) b(j)*h(t-j)

The parameter p therefore represents the Generalized (or "AR") order, while
q represents the regular ARCH (or "MA") order. If p is non-zero, q must also
be non-zero otherwise the model is unidentified. However, you can estimate a
regular ARCH model by setting q to a positive value and p to zero. The sum
of p and q must be no greater than 5. Note that a constant is automatically
included in the mean equation unless the --nc option is given.

By default native gretl code is used in estimation of GARCH models, but you
also have the option of using the algorithm of Fiorentini, Calzolari and
Panattoni (1996). The former uses the BFGS maximizer while the latter uses
the information matrix to maximize the likelihood, with fine-tuning via the
Hessian.

Several variant estimators of the covariance matrix are available with this
command. By default, the Hessian is used unless the --robust option is
given, in which case the QML (White) covariance matrix is used. Other
possibilities (e.g. the information matrix, or the Bollerslev-Wooldridge
estimator) can be specified using the "set" command.

By default, the estimates of the variance parameters are initialized using
the unconditional error variance from initial OLS estimation for the
constant, and small positive values for the coefficients on the past values
of the squared error and the error variance. The flag --arma-init calls for
the starting values of these parameters to be set using an initial ARMA
model, exploiting the relationship between GARCH and ARMA set out in Chapter
21 of Hamilton's Time Series Analysis. In some cases this may improve the
chances of convergence.

The GARCH residuals and estimated conditional variance can be retrieved as
$uhat and $h respectively. For example, to get the conditional variance:

	genr ht = $h

If the --stdresid option is given, the $uhat values are divided by the
square root of h_t.

Menu path:    /Model/Time series/GARCH

# genr Dataset

Arguments:  newvar = formula 

In the appropriate context, series, scalar and matrix are synonyms for this
command.

Creates new variables, often via transformations of existing variables. See
also "diff", "logs", "lags", "ldiff", "sdiff" and "square" for shortcuts. In
the context of a genr formula, existing variables must be referenced by
name, not ID number. The formula should be a well-formed combination of
variable names, constants, operators and functions (described below). Note
that further details on some aspects of this command can be found in the
Gretl User's Guide.

A genr command may yield either a series or a scalar result. For example,
the formula x2 = x * 2 naturally yields a series if the variable x is a
series and a scalar if x is a scalar. The formulae x = 0 and mx = mean(x)
naturally return scalars. Under some circumstances you may want to have a
scalar result expanded into a series or vector. You can do this by using
series as an "alias" for the genr command. For example, series x = 0
produces a series all of whose values are set to 0. You can also use scalar
as an alias for genr. It is not possible to coerce a vector result into a
scalar, but use of this keyword indicates that the result should be a
scalar: if it is not, an error occurs.

When a formula yields a series result, the range over which the result is
written to the target variable depends on the current sample setting. It is
possible, therefore, to define a series piecewise using the smpl command in
conjunction with genr.

Supported arithmetical operators are, in order of precedence: ^
(exponentiation); *, / and % (modulus or remainder); + and -.

The available Boolean operators are (again, in order of precedence): !
(negation), && (logical AND), || (logical OR), >, <, =, >= (greater than or
equal), <= (less than or equal) and != (not equal). The Boolean operators
can be used in constructing dummy variables: for instance (x > 10) returns 1
if x > 10, 0 otherwise.

Built-in constants are pi and NA. The latter is the missing value code: you
can initialize a variable to the missing value with scalar x = NA.

The genr command supports a wide range of mathematical and statistical
functions, including all the common ones plus several that are special to
econometrics. In addition it offers access to numerous internal variables
that are defined in the course of running regressions, doing hypothesis
tests, and so on. For a listing of functions and accessors, type "help
functions".

Besides the operators and functions noted above there are some special uses
of "genr":

  "genr time" creates a time trend variable (1,2,3,...) called "time". "genr
  index" does the same thing except that the variable is called index.

  "genr dummy" creates dummy variables up to the periodicity of the data. In
  the case of quarterly data (periodicity 4), the program creates dq1 = 1
  for first quarter and 0 in other quarters, dq2 = 1 for the second quarter
  and 0 in other quarters, and so on. With monthly data the dummies are
  named dm1, dm2, and so on. With other frequencies the names are dummy_1,
  dummy_2, etc.

  "genr unitdum" and "genr timedum" create sets of special dummy variables
  for use with panel data. The first codes for the cross-sectional units and
  the second for the time period of the observations.

Note: In the command-line program, "genr" commands that retrieve
model-related data always reference the model that was estimated most
recently. This is also true in the GUI program, if one uses "genr" in the
"gretl console" or enters a formula using the "Define new variable" option
under the Variable menu in the main window. With the GUI, however, you have
the option of retrieving data from any model currently displayed in a window
(whether or not it's the most recent model). You do this under the "Model
data" menu in the model's window.

The special variable obs serves as an index of the observations. For
instance genr dum = (obs=15) will generate a dummy variable that has value 1
for observation 15, 0 otherwise. You can also use this variable to pick out
particular observations by date or name. For example, genr d = (obs>1986:4),
genr d = (obs>"2008/04/01"), or genr d = (obs="CA"). If daily dates or
observation labels are used in this context, they should be enclosed in
double quotes. Quarterly and monthly dates (with a colon) may be used
unquoted. Note that in the case of annual time series data, the year is not
distinguishable syntactically from a plain integer; therefore if you wish to
compare observations against obs by year you must use the function obsnum to
convert the year to a 1-based index value, as in genr d =
(obs>obsnum(1986)).

Scalar values can be pulled from a series in the context of a genr formula,
using the syntax varname[obs]. The obs value can be given by number or date.
Examples: x[5], CPI[1996:01]. For daily data, the form YYYY/MM/DD should be
used, e.g. ibm[1970/01/23].

An individual observation in a series can be modified via genr. To do this,
a valid observation number or date, in square brackets, must be appended to
the name of the variable on the left-hand side of the formula. For example,
genr x[3] = 30 or genr x[1950:04] = 303.7.

  Formula                Comment
  -------                -------
  y = x1^3               x1 cubed
  y = ln((x1+x2)/x3)     
  z = x>y                z(t) = 1 if x(t) > y(t), otherwise 0
  y = x(-2)              x lagged 2 periods
  y = x(+2)              x led 2 periods
  y = diff(x)            y(t) = x(t) - x(t-1)
  y = ldiff(x)           y(t) = log x(t) - log x(t-1), the instantaneous rate 
                         of growth of x
  y = sort(x)            sorts x in increasing order and stores in y
  y = dsort(x)           sort x in decreasing order
  y = int(x)             truncate x and store its integer value as y
  y = abs(x)             store the absolute values of x
  y = sum(x)             sum x values excluding missing NA entries
  y = cum(x)             cumulation: y(t) = the sum from s=1 to s=t of x(s) 
  aa = $ess              set aa equal to the Error Sum of Squares from last 
                         regression
  x = $coeff(sqft)       grab the estimated coefficient on the variable sqft 
                         from the last regression
  rho4 = $rho(4)         grab the 4th-order autoregressive coefficient from 
                         the last model (presumes an ar model)
  cvx1x2 = $vcv(x1, x2)  grab the estimated coefficient covariance of vars x1 
                         and x2 from the last model
  foo = uniform()        uniform pseudo-random variable in range 0-1
  bar = 3 * normal()     normal pseudo-random variable, mu = 0, sigma = 3
  samp = ok(x)           = 1 for observations where x is not missing.

Menu path:    /Add/Define new variable
Other access: Main window pop-up menu

# gmm Estimation

Options:    --two-step (two step estimation)
            --iterate (iterated GMM)
            --vcv (print covariance matrix)
            --verbose (print details of iterations)
            --lbfgs (use L-BFGS-B instead of regular BFGS)

Performs Generalized Method of Moments (GMM) estimation using the BFGS
(Broyden, Fletcher, Goldfarb, Shanno) algorithm. You must specify one or
more commands for updating the relevant quantities (typically GMM
residuals), one or more sets of orthogonality conditions, an initial matrix
of weights, and a listing of the parameters to be estimated, all enclosed
between the tags gmm and end gmm. Any options should be appended to the end
gmm line.

Please see the Gretl User's Guide for details on this command. Here we just
illustrate with a simple example.

	gmm e = y - X*b
	  orthog e ; W
	  weights V
	  params b
	end gmm

In the example above we assume that y and X are data matrices, b is an
appropriately sized vector of parameter values, W is a matrix of
instruments, and V is a suitable matrix of weights. The statement

	orthog e ; W

indicates that the residual vector e is in principle orthogonal to each of
the instruments composing the columns of W.

Menu path:    /Model/GMM

# gnuplot Graphs

Arguments:  yvars xvar [ dumvar ] 
Options:    --with-lines (use lines, not points)
            --with-impulses (use vertical lines)
            --time-series (plot against time)
            --suppress-fitted (don't show fitted line)
            --single-yaxis (force use of just one y-axis)
            --linear-fit (show least squares fit)
            --inverse-fit (show inverse fit)
            --quadratic-fit (show quadratic fit)
            --loess-fit (show loess fit)
            --dummy (see below)
            --matrix=name (plot columns of named matrix)
            --output=filename (send output to specified file)
            --input=filename (take input from specified file)
Examples:   gnuplot y1 y2 x
            gnuplot x --time-series --with-lines
            gnuplot wages educ gender --dummy

The variables in the list yvars are graphed against xvar. For a time series
plot you may either give time as xvar or use the option flag --time-series.

If the --dummy option is selected, exactly three variables should be given:
a single y variable, an x variable, and dvar, a discrete variable. The
effect is to plot yvar against xvar with the points shown in different
colors depending on the value of dvar at the given observation.

Generally, yvars and xvar refer to series in the current dataset (given
either by name or ID number). But if a named matrix is supplied via the
--matrix option these arguments (which must be given as numerical values)
denote (1-based) column indices for the given matrix. So for example if you
want a scatterplot of column 2 of matrix M against column 1, you should do:

	gnuplot 2 1 --matrix=M

In interactive mode the plot is displayed immediately. In batch mode the
default behavior is that a gnuplot command file is written in the user's
working directory, with a name on the pattern gpttmpN.plt, starting with N =
01. The actual plots may be generated later using gnuplot (under MS Windows,
wgnuplot). This behavior can be modified by use of the --output=filename
option. This option controls the filename used, and at the same time allows
you to specify a particular output format via the three-letter extension of
the file name, as follows: .eps results in the production of an Encapulated
PostScript (EPS) file; .pdf produces PDF; .png produces PNG format, .emf
calls for EMF (Enhanced MetaFile), .fig calls for an Xfig file, and .svg for
SVG (Scalable Vector Graphics). If the dummy filename "display" is given
then the plot is shown on screen as in interactive mode. If a filename with
any extension other than those just mentioned is given, a gnuplot command
file is written.

The various "fit" options are applicable only in the case of a bivariate
scatterplot. The default behavior is to show the OLS fitted line if and only
if the slope coefficient is significant at the 10 percent level. If the
suppress option is given, no fitted line is shown. If the linear option is
given, the OLS line is shown regardless of whether or not it is significant.
The other options -- inverse, quadratic and loess -- produce respectively an
inverse fit (regression of y on 1/x), a quadratic fit, or a loess fit. Loess
(also sometimes called "lowess") is a robust locally weighted regression.

A further option to this command is available: following the specification
of the variables to be plotted and the option flag (if any), you may add
literal gnuplot commands to control the appearance of the plot (for example,
setting the plot title and/or the axis ranges). These commands should be
enclosed in braces, and each gnuplot command must be terminated with a
semi-colon. A backslash may be used to continue a set of gnuplot commands
over more than one line. Here is an example of the syntax:

{ set title 'My Title'; set yrange [0:1000]; }

Menu path:    /View/Graph specified vars
Other access: Main window pop-up menu, graph button on toolbar

# graphpg Graphs

The session "graph page" will work only if you have the LaTeX typesetting
system installed, and are able to generate and view PDF or PostScript
output.

In the session icon window, you can drag up to eight graphs onto the graph
page icon. When you double-click on the graph page (or right-click and
select "Display"), a page containing the selected graphs will be composed
and opened in a suitable viewer. From there you should be able to print the
page.

To clear the graph page, right-click on its icon and select "Clear".

In script (or console) mode, you can add a graph to the graph page by
issuing the command graphpg add after saving a named graph, as in

	grf1 <- gnuplot Y X
	graphpg add

Also in script mode you can call for display of the graph page using the
command graphpg show, and can clear the page via graphpg free.

Note that on systems other than MS Windows, you may have to adjust the
setting for the program used to view PDF or PostScript files. Find that
under the "Programs" tab in the gretl Preferences dialog box (under the
Tools menu in the main window).

# hausman Tests

This test is available only after estimating an OLS model using panel data
(see also "setobs"). It tests the simple pooled model against the principal
alternatives, the fixed effects and random effects models.

The fixed effects model allows the intercept of the regression to vary
across the cross-sectional units. An F-test is reported for the null
hypotheses that the intercepts do not differ. The random effects model
decomposes the residual variance into two parts, one part specific to the
cross-sectional unit and the other specific to the particular observation.
(This estimator can be computed only if the number of cross-sectional units
in the data set exceeds the number of parameters to be estimated.) The
Breusch-Pagan LM statistic tests the null hypothesis that the pooled OLS
estimator is adequate against the random effects alternative.

The pooled OLS model may be rejected against both of the alternatives, fixed
effects and random effects. Provided the unit- or group-specific error is
uncorrelated with the independent variables, the random effects estimator is
more efficient than the fixed effects estimator; otherwise the random
effects estimator is inconsistent and the fixed effects estimator is to be
preferred. The null hypothesis for the Hausman test is that the
group-specific error is not so correlated (and therefore the random effects
model is preferable). A low p-value for this test counts against the random
effects model and in favor of fixed effects.

Menu path:    Model window, /Tests/Panel diagnostics

# heckit Estimation

Arguments:  depvar indepvars ; selection equation 
Options:    --quiet (suppress printing of results)
            --robust (QML standard errors)
            --two-step (perform two-step estimation)
            --vcv (print covariance matrix)
            --verbose (print extra output)
Example:    heckit y 0 x1 x2 ; ys 0 x3 x4
            See also heckit.inp

Heckman-type selection model. In the specification, the list before the
semicolon represents the outcome equation, and the second list represents
the selection equation. The dependent variable in the selection equation (ys
in the example above) must be a binary variable.

By default, the parameters are estimated by maximum likelihood. The
covariance matrix of the parameters is computed using the negative inverse
of the Hessian. If two-step estimation is desired, use the --two-step
option. In this case, the covariance matrix of the parameters of the outcome
equation is appropriately adjusted as per Heckman (1979).

Please note that in ML estimation a numerical approximation of the Hessian
is used; this may lead to inaccuracies in the estimated covariance matrix if
the scale of the explanatory variables is such that some of the estimated
coefficients are very small in absolute value. This problem will be
addressed in future versions; in the meantime, rescaling the offending
explanatory variable(s) can be used as a workaround.

Menu path:    /Model/Nonlinear models/Heckit

# help Utilities

Variants:   help
            help functions
            help command
            help function
Option:     --func (select functions help)

If no arguments are given, prints a list of available commands. If the
single argument "functions" is given, prints a list of available functions
(see "genr").

help command describes command (e.g. help smpl). help function describes
function (e.g. help ldet). Some functions have the same names as related
commands (e.g. diff): in that case the default is to print help for the
command, but you can get help on the function by using the --func option.

Menu path:    /Help

# hsk Estimation

Arguments:  depvar indepvars 
Option:     --vcv (print covariance matrix)

This command is applicable where heteroskedasticity is present in the form
of an unknown function of the regressors which can be approximated by a
quadratic relationship. In that context it offers the possibility of
consistent standard errors and more efficient parameter estimates as
compared with OLS.

The procedure involves (a) OLS estimation of the model of interest, followed
by (b) an auxiliary regression to generate an estimate of the error
variance, then finally (c) weighted least squares, using as weight the
reciprocal of the estimated variance.

In the auxiliary regression (b) we regress the log of the squared residuals
from the first OLS on the original regressors and their squares. The log
transformation is performed to ensure that the estimated variances are
non-negative. Call the fitted values from this regression u^*. The weight
series for the final WLS is then formed as 1/exp(u^*).

Menu path:    /Model/Other linear models/Heteroskedasticity corrected

# hurst Statistics

Argument:   series 

Calculates the Hurst exponent (a measure of persistence or long memory) for
a time-series variable having at least 128 observations.

The Hurst exponent is discussed by Mandelbrot. In theoretical terms it is
the exponent, H, in the relationship

  RS(x) = an^H

where RS is the "rescaled range" of the variable x in samples of size n and
a is a constant. The rescaled range is the range (maximum minus minimum) of
the cumulated value or partial sum of x over the sample period (after
subtraction of the sample mean), divided by the sample standard deviation.

As a reference point, if x is white noise (zero mean, zero persistence) then
the range of its cumulated "wandering" (which forms a random walk), scaled
by the standard deviation, grows as the square root of the sample size,
giving an expected Hurst exponent of 0.5. Values of the exponent
significantly in excess of 0.5 indicate persistence, and values less than
0.5 indicate anti-persistence (negative autocorrelation). In principle the
exponent is bounded by 0 and 1, although in finite samples it is possible to
get an estimated exponent greater than 1.

In gretl, the exponent is estimated using binary sub-sampling: we start with
the entire data range, then the two halves of the range, then the four
quarters, and so on. For sample sizes smaller than the data range, the RS
value is the mean across the available samples. The exponent is then
estimated as the slope coefficient in a regression of the log of RS on the
log of sample size.

Menu path:    /Variable/Hurst exponent

# if Programming

Flow control for command execution. Three sorts of construction are
supported, as follows.

	# simple form
	if condition
	   commands
	endif
            
	# two branches
	if condition
	   commands1
	else
	   commands2
	endif
            
	# three or more branches
	if condition1
	   commands1
	elif condition2
	   commands2
	else
	   commands3
	endif
            
"condition" must be a Boolean expression, for the syntax of which see
"genr". More than one "elif" block may be included. In addition, if ...
endif blocks may be nested.

# include Programming

Argument:   filename 
Examples:   include myfile.inp
            include sols.gfn

Intended for use in a command script, primarily for including definitions of
functions. Executes the commands in filename then returns control to the
main script. To include a packaged function, be sure to include the filename
extension.

See also "run".

# info Dataset

Prints out any supplementary information stored with the current datafile.

Menu path:    /Data/Dataset info
Other access: Data browser windows

# intreg Estimation

Arguments:   minvar maxvar indepvars 
Options:    --quiet (suppress printing of results)
            --verbose (print details of iterations)
            --robust (robust standard errors)
Example:    intreg lo hi const x1 x2
            See also wtp.inp

Estimates an interval regression model. This model arises when the dependent
variable is imperfectly observed for some (possibly all) observations. In
other words, the data generating process is assumed to be

  y* = x b + u

but we only observe m <= y* <= M (the interval may be left- or
right-unbounded). Note that for some observations m may equal M. The
variables minvar and maxvar must contain NAs for left- and right-unbounded
observations, respectively.

The model is estimated by maximum likelihood, assuming normality of the
disturbance term.

By default, standard errors are computed using the negative inverse of the
Hessian. If the --robust flag is given, then QML or Huber-White standard
errors are calculated instead. In this case the estimated covariance matrix
is a "sandwich" of the inverse of the estimated Hessian and the outer
product of the gradient.

Menu path:    /Model/Nonlinear models/Interval regression

# kalman Estimation

Options:    --cross (allow for cross-correlated disturbances)
            --diffuse (use diffuse initialization)

Opens a block of statements to set up a Kalman filter. This block should end
with the line end kalman, to which the options shown above may be appended.
The intervening lines specify the matrices that compose the filter. For
example,

	kalman 
	  obsy y
	  obsymat H
	  statemat F
	  statevar Q
	end kalman

Please see the Gretl User's Guide for details.

See also "kfilter", "ksimul", "ksmooth".

# kpss Tests

Arguments:  order varlist 
Options:    --trend (include a trend)
            --seasonals (include seasonal dummies)
            --verbose (print regression results)
            --quiet (suppress printing of results)
            --difference (use first difference of variable)
Examples:   kpss 8 y
            kpss 4 x1 --trend

For use of this command with panel data please see the final section in this
entry.

Computes the KPSS test (Kwiatkowski et al, Journal of Econometrics, 1992)
for stationarity, for each of the specified variables (or their first
difference, if the --difference option is selected). The null hypothesis is
that the variable in question is stationary, either around a level or, if
the --trend option is given, around a deterministic linear trend.

The order argument determines the size of the window used for Bartlett
smoothing. If the --verbose option is chosen the results of the auxiliary
regression are printed, along with the estimated variance of the random walk
component of the variable.

The critical values shown for the test statistic are based on the response
surfaces estimated by Sephton (Economics Letters, 1995), which are more
accurate for small samples than the values given in the original KPSS
article. When the test statistic lies between the 10 percent and 1 percent
critical values a p-value is shown; this is obtained by linear interpolation
and should not be taken too literally.

Panel data

When the kpss command is used with panel data, to produce a panel unit root
test, the applicable options and the results shown are somewhat different.
While you may give a list of variables for testing in the regular
time-series case, with panel data only one variable may be tested per
command. And the --verbose option has a different meaning: it produces a
brief account of the test for each individual time series (the default being
to show only the overall result).

When possible, the overall test (null hypothesis: the series in question is
stationary for all the panel units) is calculated using the method of Choi
(Journal of International Money and Finance, 2001). This is not always
straightforward, the difficulty being that while the Choi test is based on
the p-values of the tests on the individual series, we do not currently have
a means of calculating p-values for the KPSS test statistic; we must rely on
a few critical values.

If the test statistic for a given series falls between the 10 percent and 1
percent critical values, we are able to interpolate a p-value. But if the
test falls short of the 10 percent value, or exceeds the 1 percent value, we
cannot interpolate and can at best place a bound on the global Choi test. If
the individual test statistic falls short of the 10 percent value for some
units but exceeds the 1 percent value for others, we cannot even compute a
bound for the global test.

Menu path:    /Variable/Unit root tests/KPSS test

# labels Dataset

Variants:   labels [ varlist ]
            labels --to-file=filename
            labels --from-file=filename

In the first form, prints out the informative labels (if present) for the
series in varlist, or for all series in the dataset if varlist is not
specified.

With the option --to-file, writes to the named file the labels for all
series in the dataset, one per line. If no labels are present an error is
flagged; if some series have labels and others do not, a blank line is
printed for series with no label.

With the option --from-file, reads the specified file (which should be plain
text) and assigns labels to the series in the dataset, reading one label per
line and taking blank lines to indicate blank labels.

Via the file writing and reading options it is possible to copy series
labels from one data file to another.

# lad Estimation

Arguments:  depvar indepvars 
Option:     --vcv (print covariance matrix)

Calculates a regression that minimizes the sum of the absolute deviations of
the observed from the fitted values of the dependent variable. Coefficient
estimates are derived using the Barrodale-Roberts simplex algorithm; a
warning is printed if the solution is not unique.

Standard errors are derived using the bootstrap procedure with 500 drawings.
The covariance matrix for the parameter estimates, printed when the --vcv
flag is given, is based on the same bootstrap.

Menu path:    /Model/Robust estimation/Least Absolute Deviation

# lags Transformations

Variants:   lags varlist
            lags order ; varlist
Examples:   lags x y
            lags 12 ; x y

Creates new series which are lagged values of each of the series in varlist.
By default the number of lags created equals the periodicity of the data.
For example, if the periodicity is 4 (quarterly), the command "lags x"
creates

	x_1 = x(t-1)
	x_2 = x(t-2)
	x_3 = x(t-3)
	x_4 = x(t-4)

The number of lags created can be controlled by the optional first
parameter.

Menu path:    /Add/Lags of selected variables

# ldiff Transformations

Argument:   varlist 

The first difference of the natural log of each series in varlist is
obtained and the result stored in a new series with the prefix ld_. Thus
"ldiff x y" creates the new variables

	ld_x = log(x) - log(x(-1))
	ld_y = log(y) - log(y(-1))

Menu path:    /Add/Log differences of selected variables

# leverage Tests

Option:     --save (save variables)

Must immediately follow an "ols" command. Calculates the leverage (h, which
must lie in the range 0 to 1) for each data point in the sample on which the
previous model was estimated. Displays the residual (u) for each observation
along with its leverage and a measure of its influence on the estimates,
u*h/(1-h). "Leverage points" for which the value of h exceeds 2k/n (where k
is the number of parameters being estimated and n is the sample size) are
flagged with an asterisk. For details on the concepts of leverage and
influence see Davidson and MacKinnon (1993), Chapter 2.

DFFITS values are also shown: these are "studentized residuals" (predicted
residuals divided by their standard errors) multiplied by sqrt[h/(1 - h)].
For discussions of studentized residuals and DFFITS see chapter 12 of
Maddala's Introduction to Econometrics or Belsley, Kuh and Welsch (1980).

Briefly, a "predicted residual" is the difference between the observed value
of the dependent variable at observation t, and the fitted value for
observation t obtained from a regression in which that observation is
omitted (or a dummy variable with value 1 for observation t alone has been
added); the studentized residual is obtained by dividing the predicted
residual by its standard error.

If the --save flag is given with this command, then the leverage, influence
and DFFITS values are added to the current data set.

Menu path:    Model window, /Tests/Influential observations

# levinlin Tests

Arguments:  order series 
Options:    --nc (test without a constant)
            --ct (with constant and trend)
            --quiet (suppress printing of results)
Examples:   levinlin 0 y
            levinlin 2 y --ct
            levinlin {2,2,3,3,4,4} y

Carries out the panel unit-root test described by Levin, Lin and Chu (2002).
The null hypothesis is that all of the individual time series exhibit a unit
root, and the alternative is that none of the series has a unit root. (That
is, a common AR(1) coefficient is assumed, although in other respects the
statistical properties of the series are allowed to vary across
individuals.)

By default the test ADF regressions include a constant; to suppress the
constant use the --nc option, or to add a linear trend use the --ct option.
(See the "adf" command for explanation of ADF regressions.)

The (non-negative) order for the test (governing the number of lags of the
dependent variable to include in the ADF regressions) may be given in either
of two forms. If a scalar value is given, this is applied to all the
individuals in the panel. The alternative is to provide a matrix containing
a specific lag order for each individual; this must be a vector with as many
elements as there are individuals in the current sample range. Such a matrix
can be specified by name, or constructed using braces as illustrated in the
last example above.

Menu path:    /Variable/Unit root tests/Levin-Lin-Chu test

# logistic Estimation

Arguments:  depvar indepvars [ ymax=value ] 
Option:     --vcv (print covariance matrix)
Examples:   logistic y const x
            logistic y const x ymax=50

Logistic regression: carries out an OLS regression using the logistic
transformation of the dependent variable,

  log(y/(y* - y))

The dependent variable must be strictly positive. If it is a decimal
fraction, between 0 and 1, the default is to use a y^* value (the asymptotic
maximum of the dependent variable) of 1. If the dependent variable is a
percentage, between 0 and 100, the default y^* is 100.

If you wish to set a different maximum, use the optional ymax=value syntax
following the list of regressors. The supplied value must be greater than
all of the observed values of the dependent variable.

The fitted values and residuals from the regression are automatically
transformed using

  y = y* / (1 + exp(-x))

where x represents either a fitted value or a residual from the OLS
regression using the transformed dependent variable. The reported values are
therefore comparable with the original dependent variable.

Note that if the dependent variable is binary, you should use the "logit"
command instead.

Menu path:    /Model/Nonlinear models/Logistic

# logit Estimation

Arguments:  depvar indepvars 
Options:    --robust (robust standard errors)
            --multinomial (estimate multinomial logit)
            --vcv (print covariance matrix)
            --verbose (print details of iterations)
            --p-values (show p-values instead of slopes)

If the dependent variable is a binary variable (all values are 0 or 1)
maximum likelihood estimates of the coefficients on indepvars are obtained
via the "binary response model regression" (BRMR) method outlined by
Davidson and MacKinnon (2004). As the model is nonlinear the slopes depend
on the values of the independent variables. By default the slopes with
respect to each of the independent variables are calculated (at the means of
those variables) and these slopes replace the usual p-values in the
regression output. This behavior can be suppressed my giving the --p-values
option. The chi-square statistic tests the null hypothesis that all
coefficients are zero apart from the constant.

By default, standard errors are computed using the negative inverse of the
Hessian. If the --robust flag is given, then QML or Huber-White standard
errors are calculated instead. In this case the estimated covariance matrix
is a "sandwich" of the inverse of the estimated Hessian and the outer
product of the gradient. See chapter 10 of Davidson and MacKinnon for
details.

If the dependent variable is not binary but is discrete, then by default it
is interpreted as an ordinal response, and Ordered Logit estimates are
obtained. However, if the --multinomial option is given, the dependent
variable is interpreted as an unordered response, and Multinomial Logit
estimates are produced. (In either case, if the variable selected as
dependent is not discrete an error is flagged.) In the multinomial case, the
accessor $mnlprobs is available after estimation, to get a matrix containing
the estimated probabilities of the outcomes at each observation
(observations in rows, outcomes in columns).

If you want to use logit for analysis of proportions (where the dependent
variable is the proportion of cases having a certain characteristic, at each
observation, rather than a 1 or 0 variable indicating whether the
characteristic is present or not) you should not use the "logit" command,
but rather construct the logit variable, as in

	genr lgt_p = log(p/(1 - p))

and use this as the dependent variable in an OLS regression. See chapter 12
of Ramanathan (2002).

Menu path:    /Model/Nonlinear models/Logit

# logs Transformations

Argument:   varlist 

The natural log of each of the series in varlist is obtained and the result
stored in a new series with the prefix l_ ("el" underscore). For example,
"logs x y" creates the new variables l_x = ln(x) and l_y = ln(y).

Menu path:    /Add/Logs of selected variables

# loop Programming

Argument:   control 
Options:    --progressive (enable special forms of certain commands)
            --verbose (report details of genr commands)
            --quiet (do not report number of iterations performed)
Examples:   loop 1000
            loop 1000 --progressive
            loop while essdiff > .00001
            loop i=1991..2000
            loop for (r=-.99; r<=.99; r+=.01)
            loop foreach i xlist

This command opens a special mode in which the program accepts commands to
be executed repeatedly. You exit the mode of entering loop commands with
"endloop": at this point the stacked commands are executed.

The parameter "control" may take any of five forms, as shown in the
examples: an integer number of times to repeat the commands within the loop;
"while" plus a boolean condition; a range of integer values for index
variable; "for" plus three expressions in parentheses, separated by
semicolons (which emulates the for statement in the C programming language);
or "foreach" plus an index variable and a list.

See the Gretl User's Guide for further details and examples. The effect of
the --progressive option (which is designed for use in Monte Carlo
simulations) is explained there. Not all gretl commands may be used within a
loop; the commands available in this context are also set out there.

# mahal Statistics

Argument:   varlist 
Options:    --quiet (don't print anything)
            --save (add distances to the dataset)
            --vcv (print covariance matrix)

The Mahalanobis distance is the distance between two points in a
k-dimensional space, scaled by the statistical variation in each dimension
of the space. For example, if p and q are two observations on a set of k
variables with covariance matrix C, then the Mahalanobis distance between
the observations is given by

  sqrt((p - q)' * C-inverse * (p - q))

where (p - q) is a k-vector. This reduces to Euclidean distance if the
covariance matrix is the identity matrix.

The space for which distances are computed is defined by the selected
variables. For each observation in the current sample range, the distance is
computed between the observation and the centroid of the selected variables.
This distance is the multidimensional counterpart of a standard z-score, and
can be used to judge whether a given observation "belongs" with a group of
other observations.

If the --vcv option is given, the covariance matrix and its inverse are
printed. If the --save option is given, the distances are saved to the
dataset under the name mdist (or mdist1, mdist2 and so on if there is
already a variable of that name).

Menu path:    /View/Mahalanobis distances

# makepkg Programming

Argument:   filename 
Options:    --index (write auxiliary index file)
            --translations (write auxiliary strings file)

Supports creation of a gretl function package via the command line. The
filename argument represents the name of the package to be created, and
should have the .gfn extension. Please see the Gretl User's Guide for
details.

The option flags support the writing of auxiliary files for use with gretl
"addons". The index file is a short XML document containing basic
information about the package; it has the same basename as the package and
the extension .xml. The translations file contains strings from the package
that may be suitable for translation, in C format; for package foo this file
is named foo-i18n.c.

Menu path:    /File/Function files/New package

# meantest Tests

Arguments:  var1 var2 
Option:     --unequal-vars (assume variances are unequal)

Calculates the t statistic for the null hypothesis that the population means
are equal for the variables var1 and var2, and shows its p-value.

By default the test statistic is calculated on the assumption that the
variances are equal for the two variables; with the --unequal-vars option
the variances are assumed to be different. This will make a difference to
the test statistic only if there are different numbers of non-missing
observations for the two variables.

Menu path:    /Model/Bivariate tests/Difference of means

# mle Estimation

Arguments:  log-likelihood function [ derivatives ] 
Options:    --quiet (don't show estimated model)
            --vcv (print covariance matrix)
            --hessian (base covariance matrix on the Hessian)
            --robust (QML covariance matrix)
            --verbose (print details of iterations)
            --no-gradient-check (see below)
            --lbfgs (use L-BFGS-B instead of regular BFGS)
Example:    weibull.inp

Performs Maximum Likelihood (ML) estimation using the BFGS (Broyden,
Fletcher, Goldfarb, Shanno) algorithm. The user must specify the
log-likelihood function. The parameters of this function must be declared
and given starting values (using the "genr" command) prior to estimation.
Optionally, the user may specify the derivatives of the log-likelihood
function with respect to each of the parameters; if analytical derivatives
are not supplied, a numerical approximation is computed.

Simple example: Suppose we have a series X with values 0 or 1 and we wish to
obtain the maximum likelihood estimate of the probability, p, that X = 1.
(In this simple case we can guess in advance that the ML estimate of p will
simply equal the proportion of Xs equal to 1 in the sample.)

The parameter p must first be added to the dataset and given an initial
value. This can be done using the genr command. For example, genr p = 0.5.

We then construct the MLE command block:

	mle loglik = X*log(p) + (1-X)*log(1-p)
	  deriv p = X/p - (1-X)/(1-p)
	end mle

The first line above specifies the log-likelihood function. It starts with
the keyword mle, then a dependent variable is specified and an expression
for the log-likelihood is given (using the same syntax as in the "genr"
command). The next line (which is optional) starts with the keyword deriv
and supplies the derivative of the log-likelihood function with respect to
the parameter p. If no derivatives are given, you should include a statement
using the keyword params which identifies the free parameters: these are
listed on one line, separated by spaces and can be either scalars, or
vectors, or any combination of the two. For example, the above could be
changed to:

	mle loglik = X*log(p) + (1-X)*log(1-p)
	  params p
	end mle

in which case numerical derivatives would be used.

Note that any option flags should be appended to the ending line of the MLE
block.

By default, estimated standard errors are based on the Outer Product of the
Gradient. If the --hessian option is given, they are instead based on the
negative inverse of the Hessian (which is approximated numerically). If the
--robust option is given, a QML estimator is used (namely, a sandwich of the
negative inverse of the Hessian and the covariance matrix of the gradient).

If you supply analytical derivatives, by default gretl runs a numerical
check on their plausibility. Occasionally this may produce false positives,
instances where correct derivatives appear to be wrong and estimation is
refused. To counter this, or to achieve a little extra speed, you can give
the option --no-gradient-check. Obviously, you should do this only if you
are quite confident that the gradient you have specified is right.

Menu path:    /Model/Maximum likelihood

# modeltab Utilities

Arguments:  add  or show  or free 

Manipulates the gretl "model table". See the Gretl User's Guide for details.
The sub-commands have the following effects: "add" adds the last model
estimated to the model table, if possible; "show" displays the model table
in a window; and "free" clears the table.

Menu path:    Session window, Model table icon

# modprint Printing

Arguments:  coeffmat names [ addstats ] 

Prints the coefficient table and optional additional statistics for a model
estimated "by hand". Mainly useful for user-written functions.

The argument coeffmat should be a k by 2 matrix containing k coefficients
and k associated standard errors, and names should be a string containing at
least k names for the coefficients, separated by commas or spaces. (The
names argument may be either the name of a string variable or a literal
string, enclosed in double quotes.)

The optional argument addstats is a vector containing p additional
statistics to be printed under the coefficient table. If this argument is
given, then names should contain k + p comma-separated strings, the
additional p strings to be associated with the additional statistics.

# modtest Tests

Argument:   [ order ] 
Options:    --normality (normality of residual)
            --logs (non-linearity, logs)
            --autocorr (serial correlation)
            --arch (ARCH)
            --squares (non-linearity, squares)
            --white (heteroskedasticity, White's test)
            --white-nocross (White's test, squares only)
            --breusch-pagan (heteroskedasticity, Breusch-Pagan)
            --robust (robust variance estimate for Breusch-Pagan)
            --panel (heteroskedasticity, groupwise)
            --comfac (common factor restriction, AR1 models only)
            --quiet (don't print details)

Must immediately follow an estimation command. Depending on the option
given, this command carries out one of the following: the Doornik-Hansen
test for the normality of the error term; a Lagrange Multiplier test for
nonlinearity (logs or squares); White's test (with or without
cross-products) or the Breusch-Pagan test for heteroskedasticity; the LMF
test for serial correlation (Kiviet, 1986); a test for ARCH (Autoregressive
Conditional Heteroskedasticity; see also the "arch" command); or a test of
the common factor restriction implied by AR(1) estimation. With the
exception of the normality and common factor test most of the options are
only available for models estimated via OLS, but see below for details
regarding two-stage least squares.

The optional order argument is relevant only in case the --autocorr or
--arch options are selected. The default is to run these tests using a lag
order equal to the periodicity of the data, but this can be adjusted by
supplying a specific lag order.

The --robust option applies only when the Breusch-Pagan test is selected;
its effect is to use the robust variance estimator proposed by Koenker
(1981), making the test less sensitive to the assumption of normality.

The --panel option is available only when the model is estimated on panel
data: in this case a test for groupwise heteroskedasticity is performed
(that is, for a differing error variance across the cross-sectional units).

The --comfac option is available only when the model is estimated via an
AR(1) method such as Hildreth-Lu. The auxiliary regression takes the form of
a relatively unrestricted dynamic model, which is used to test the common
factor restriction implicit in the AR(1) specification.

By default, the program prints the auxiliary regression on which the test
statistic is based, where applicable. This may be suppressed by using the
--quiet flag. The test statistic and its p-value may be retrieved using the
accessors $test and $pvalue respectively.

When a model has been estimated by two-stage least squares (see "tsls"), the
LM principle breaks down and gretl offers some equivalents: the --autocorr
option computes Godfrey's test for autocorrelation (Godfrey, 1994) while the
--white option yields the HET1 heteroskedasticity test (Pesaran and Taylor,
1999).

Menu path:    Model window, /Tests

# mpols Estimation

Arguments:  depvar indepvars 
Options:    --vcv (print covariance matrix)
            --simple-print (do not print auxiliary statistics)
            --quiet (suppress printing of results)

Computes OLS estimates for the specified model using multiple precision
floating-point arithmetic. This command is available only if gretl is
compiled with support for the Gnu Multiple Precision (GMP) library. By
default 256 bits of precision are used for the calculations, but this can be
increased via the environment variable GRETL_MP_BITS. For example, when
using the bash shell one could issue the following command, before starting
gretl, to set a precision of 1024 bits.

	export GRETL_MP_BITS=1024

A rather arcane option is available for this command (primarily for testing
purposes): if the indepvars list is followed by a semicolon and a further
list of numbers, those numbers are taken as powers of x to be added to the
regression, where x is the last variable in indepvars. These additional
terms are computed and stored in multiple precision. In the following
example y is regressed on x and the second, third and fourth powers of x:

	mpols y 0 x ; 2 3 4

Menu path:    /Model/Other linear models/High precision OLS

# negbin Estimation

Arguments:  depvar indepvars [ ; offset ] 
Options:    --model1 (use NegBin 1 model)
            --opg (see below)
            --robust (QML covariance matrix)
            --vcv (print covariance matrix)
            --verbose (print details of iterations)

Estimates a Negative Binomial model. The dependent variable is taken to
represent a count of the occurrence of events of some sort, and must have
only non-negative integer values. By default the model NegBin 2 is used, in
which the conditional variance of the count is given by mu(1 + αmu), where
mu denotes the conditional mean. But if the --model1 option is given the
conditional variance is mu(1 + α).

The optional offset series works in the same way as for the "poisson"
command. The Poisson model is a restricted form of the Negative Binomial in
which α = 0 by construction.

By default, standard errors are computed using a numerical approximation to
the Hessian at convergence. But if the --opg option is given the covariance
matrix is based on the Outer Product of the Gradient (OPG), or if the
--robust option is given QML standard errors are calculated, using a
"sandwich" of the inverse of the Hessian and the OPG.

Menu path:    /Model/Nonlinear models/Count data...

# nls Estimation

Arguments:  function [ derivatives ] 
Options:    --quiet (don't show estimated model)
            --robust (robust standard errors)
            --vcv (print covariance matrix)
            --verbose (print details of iterations)
Example:    wg_nls.inp

Performs Nonlinear Least Squares (NLS) estimation using a modified version
of the Levenberg-Marquardt algorithm. You must supply a function
specification. The parameters of this function must be declared and given
starting values (using the "genr" command) prior to estimation. Optionally,
you may specify the derivatives of the regression function with respect to
each of the parameters. If you do not supply derivatives you should instead
give a list of the parameters to be estimated (separated by spaces or
commas), preceded by the keyword params. In the latter case a numerical
approximation to the Jacobian is computed.

It is easiest to show what is required by example. The following is a
complete script to estimate the nonlinear consumption function set out in
William Greene's Econometric Analysis (Chapter 11 of the 4th edition, or
Chapter 9 of the 5th). The numbers to the left of the lines are for
reference and are not part of the commands. Note that any option flags, such
as --vcv for printing the covariance matrix of the parameter estimates,
should be appended to the final command, end nls.

	1   open greene11_3.gdt
	2   ols C 0 Y
	3   genr a = $coeff(0)
	4   genr b = $coeff(Y)
	5   genr g = 1.0
	6   nls C = a + b * Y^g
	7    deriv a = 1
	8    deriv b = Y^g
	9    deriv g = b * Y^g * log(Y)
	10  end nls --vcv

It is often convenient to initialize the parameters by reference to a
related linear model; that is accomplished here on lines 2 to 5. The
parameters alpha, beta and gamma could be set to any initial values (not
necessarily based on a model estimated with OLS), although convergence of
the NLS procedure is not guaranteed for an arbitrary starting point.

The actual NLS commands occupy lines 6 to 10. On line 6 the "nls" command is
given: a dependent variable is specified, followed by an equals sign,
followed by a function specification. The syntax for the expression on the
right is the same as that for the "genr" command. The next three lines
specify the derivatives of the regression function with respect to each of
the parameters in turn. Each line begins with the keyword "deriv", gives the
name of a parameter, an equals sign, and an expression whereby the
derivative can be calculated (again, the syntax here is the same as for
"genr"). As an alternative to supplying numerical derivatives, you could
substitute the following for lines 7 to 9:

	params a b g

Line 10, "end nls", completes the command and calls for estimation. Any
options should be appended to this line.

For further details on NLS estimation please see the Gretl User's Guide.

Menu path:    /Model/Nonlinear models/Nonlinear Least Squares

# normtest Tests

Argument:   series 
Options:    --dhansen (Doornik-Hansen test, the default)
            --swilk (Shapiro-Wilk test)
            --lillie (Lilliefors test)
            --jbera (Jarque-Bera test)
            --all (do all tests)
            --quiet (suppress printed output)

Carries out a test for normality for the given series. The specific test is
controlled by the option flags (but if no flag is given, the Doornik-Hansen
test is performed). Note: the Doornik-Hansen and Shapiro-Wilk tests are
recommended over the others, on account of their superior small-sample
properties.

The test statistic and its p-value may be retrieved using the accessors
$test and $pvalue. Please note that if the --all option is given, the result
recorded is that from the Doornik-Hansen test.

Menu path:    /Variable/Normality test

# nulldata Dataset

Argument:   series_length 
Option:     --preserve (preserve matrices)
Example:    nulldata 500

Establishes a "blank" data set, containing only a constant and an index
variable, with periodicity 1 and the specified number of observations. This
may be used for simulation purposes: some of the "genr" commands (e.g. "genr
uniform()", "genr normal()") will generate dummy data from scratch to fill
out the data set. This command may be useful in conjunction with "loop". See
also the "seed" option to the "set" command.

By default, this command cleans out all data in gretl's current workspace.
If you give the --preserve option, however, any currently defined matrices
are retained.

Menu path:    /File/New data set

# ols Estimation

Arguments:  depvar indepvars 
Options:    --vcv (print covariance matrix)
            --robust (robust standard errors)
            --jackknife (see below)
            --simple-print (do not print auxiliary statistics)
            --quiet (suppress printing of results)
            --anova (print an ANOVA table)
            --no-df-corr (suppress degrees of freedom correction)
            --print-final (see below)
Examples:   ols 1 0 2 4 6 7
            ols y 0 x1 x2 x3 --vcv
            ols y 0 x1 x2 x3 --quiet

Computes ordinary least squares (OLS) estimates with depvar as the dependent
variable and indepvars as the list of independent variables. Variables may
be specified by name or number; use the number zero for a constant term.

Besides coefficient estimates and standard errors, the program also prints
p-values for t (two-tailed) and F-statistics. A p-value below 0.01 indicates
statistical significance at the 1 percent level and is marked with ***. **
indicates significance between 1 and 5 percent and * indicates significance
between the 5 and 10 percent levels. Model selection statistics (the Akaike
Information Criterion or AIC and Schwarz's Bayesian Information Criterion)
are also printed. The formula used for the AIC is that given by Akaike
(1974), namely minus two times the maximized log-likelihood plus two times
the number of parameters estimated.

If the option --no-df-corr is given, the usual degrees of freedom correction
is not applied when calculating the estimated error variance (and hence also
the standard errors of the parameter estimates).

The option --print-final is applicable only in the context of a "loop". It
arranges for the regression to be run silently on all but the final
iteration of the loop. See the Gretl User's Guide for details.

Various internal variables may be retrieved using the "genr" command,
provided "genr" is invoked directly after estimation. For example

	genr uh = $uhat

saves the residuals under the name uh. See the "accessors" section of the
gretl function reference for details.

The specific formula used for generating robust standard errors (when the
--robust option is given) can be adjusted via the "set" command. The
--jackknife option has the effect of selecting an hc_version of 3a; it is
provided to emulate the old hccm command.

Menu path:    /Model/Ordinary Least Squares
Other access: Beta-hat button on toolbar

# omit Tests

Argument:   varlist 
Options:    --test-only (don't replace the current model)
            --chi-square (give chi-square form of Wald test)
            --quiet (print only the basic test result)
            --silent (don't print anything)
            --vcv (print covariance matrix for reduced model)
            --auto[=alpha] (sequential elimination, see below)
Examples:   omit 5 7 9
            omit seasonals --quiet
            omit --auto
            omit --auto=0.05

This command must follow an estimation command. It calculates a Wald test
for the joint significance of the variables in varlist, which should be a
subset of the independent variables in the model last estimated. The results
of the test may be retrieved using the accessors $test and $pvalue.

By default the restricted model is estimated and it replaces the original as
the "current model" for the purposes of, for example, retrieving the
residuals as $uhat or doing further tests. This behavior may be suppressed
via the --test-only option.

By default the F-form of the Wald test is recorded; the --chi-square option
may be used to record the chi-square form instead.

If the restricted model is both estimated and printed, the --vcv option has
the effect of printing its covariance matrix, otherwise this option is
ignored.

Alternatively, if the --auto flag is given, sequential elimination is
performed: at each step the variable with the highest p-value is omitted,
until all remaining variables have a p-value no greater than some cutoff.
The default cutoff is 10 percent (two-sided); this can be adjusted by
appending "=" and a value between 0 and 1 (with no spaces), as in the fourth
example above. If varlist is given this process is confined to the listed
variables, otherwise all variables are treated as candidates for omission.
Note that the --auto and --test-only options cannot be combined.

Menu path:    Model window, /Tests/Omit variables

# open Dataset

Argument:   filename 
Options:    --quiet (don't print list of series)
            --preserve (preserve any matrices and scalars)
            --www (use a database on the gretl server)
            See below for additional specialized options
Examples:   open data4-1
            open voter.dta
            open fedbog --www

Opens a data file. If a data file is already open, it is replaced by the
newly opened one. To add data to the current dataset, see "append".

If a full path is not given, the program will search some relevant paths to
try to find the file. If no filename suffix is given (as in the first
example above), gretl assumes a native datafile with suffix .gdt. Based on
the name of the file and various heuristics, gretl will try to detect the
format of the data file (native, plain text, CSV, MS Excel, Stata, SPSS,
etc.).

If the filename argument takes the form of a URI starting with http://, then
gretl will attempt to download the indicated data file before opening it.

By default, opening a new data file clears the current gretl session, which
includes deletion of any named matrices and scalars. If you wish to keep any
currently defined matrices and scalars, use the --preserve option.

The open command can also be used to open a database (gretl, RATS 4.0 or
PcGive) for reading. In that case it should be followed by the "data"
command to extract particular series from the database. If the www option is
given, the program will try to access a database of the given name on the
gretl server -- for instance the Federal Reserve interest rates database in
the third example above.

When opening a spreadsheet file (Gnumeric, Open Document or XLS), you may
give up to three additional parameters following the filename. First, you
can select a particular worksheet within the file. This is done either by
giving its (1-based) number, using the syntax, e.g., --sheet=2, or, if you
know the name of the sheet, by giving the name in double quotes, as in
--sheet="MacroData". The default is to read the first worksheet. You can
also specify a column and/or row offset into the worksheet via, e.g.,

	--coloffset=3 --rowoffset=2

which would cause gretl to ignore the first 3 columns and the first 2 rows.
The default is an offset of 0 in both dimensions, that is, to start reading
at the top-left cell.

With plain text files, gretl generally expects to find the data columns
delimited in some standard manner. But there is also a special facility for
reading "fixed format" files, in which there are no delimiters but there is
a known specification of the form, e.g., "variable k occupies 8 columns
starting at column 24". To read such files, you should append a string
--cols=colspec, where colspec is composed of comma-separated integers. These
integers are interpreted as a set of pairs. The first element of each pair
denotes a starting column, measured in bytes from the beginning of the line
with 1 indicating the first byte; and the second element indicates how many
bytes should be read for the given field. So, for example, if you say

	open fixed.txt --cols=1,6,20,3

then for variable 1 gretl will read 6 bytes starting at column 1; and for
variable 2, 3 bytes starting at column 20. Lines that are blank, or that
begin with #, are ignored, but otherwise the column-reading template is
applied, and if anything other than a valid numerical value is found an
error is flagged. If the data are read successfully, the variables will be
named v1, v2, etc. It's up to the user to provide meaningful names and/or
descriptions using the commands "rename" and/or "setinfo".

Menu path:    /File/Open data
Other access: Drag a data file into gretl (MS Windows or Gnome)

# orthdev Transformations

Argument:   varlist 

Applicable with panel data only. A series of forward orthogonal deviations
is obtained for each variable in varlist and stored in a new variable with
the prefix o_. Thus "orthdev x y" creates the new variables o_x and o_y.

The values are stored one step ahead of their true temporal location (that
is, o_x at observation t holds the deviation that, strictly speaking,
belongs at t - 1). This is for compatibility with first differences: one
loses the first observation in each time series, not the last.

# outfile Printing

Arguments:  filename option 
Options:    --append (append to file)
            --close (close file)
            --write (overwrite file)
Examples:   outfile --write regress.txt
            outfile --close

Diverts output to filename, until further notice. Use the flag --append to
append output to an existing file or --write to start a new file (or
overwrite an existing one). Only one file can be opened in this way at any
given time.

The --close flag is used to close an output file that was previously opened
as above. Output will then revert to the default stream.

In the first example command above, the file regress.txt is opened for
writing, and in the second it is closed. This would make sense as a sequence
only if some commands were issued before the --close. For example if an
"ols" command intervened, its output would go to regress.txt rather than the
screen.

Three special variants on the above are available. If you give the keyword
null in place of a real filename along with the --write option, the effect
is to suppress all printed output until the next outfile --close. In
addition if the keywords stdout or stderr are given in place of a regular
filename the effect is to redirect output to standard output or standard
error output respectively.

# panel Estimation

Arguments:  depvar indepvars 
Options:    --vcv (print covariance matrix)
            --fixed-effects (estimate with group fixed effects)
            --random-effects (random effects or GLS model)
            --between (estimate the between-groups model)
            --robust (robust standard errors; see below)
            --time-dummies (include time dummy variables)
            --unit-weights (weighted least squares)
            --iterate (iterative estimation)
            --matrix-diff (use matrix-difference method for Hausman test)
            --quiet (less verbose output)
            --verbose (more verbose output)

Estimates a panel model. By default the fixed effects estimator is used;
this is implemented by subtracting the group or unit means from the original
data.

If the --random-effects flag is given, random effects estimates are
computed, using the method of Swamy and Arora. In this case (only) the
option --matrix-diff forces use of the matrix-difference method (as opposed
to the regression method) for carrying out the Hausman test for the
consistency of the random effects estimator.

Alternatively, if the --unit-weights flag is given, the model is estimated
via weighted least squares, with the weights based on the residual variance
for the respective cross-sectional units in the sample. In this case (only)
the --iterate flag may be added to produce iterative estimates: if the
iteration converges, the resulting estimates are Maximum Likelihood.

As a further alternative, if the --between flag is given, the between-groups
model is estimated (that is, an OLS regression using the group means).

The --robust option is available only for fixed effects models. The default
variant is the Arellano HAC estimator, but Beck-Katz "Panel Corrected
Standard Errors" can be selected via the command set pcse on.

For more details on panel estimation, please see the Gretl User's Guide.

Menu path:    /Model/Panel

# pca Statistics

Argument:   varlist 
Options:    --covariance (use the covariance matrix)
            --save (save major components)
            --save-all (save all components)

Principal Components Analysis. Prints the eigenvalues of the correlation
matrix (or the covariance matrix if the --covariance option is given) for
the variables in varlist, along with the proportion of the joint variance
accounted for by each component. Also prints the corresponding eigenvectors
(or "component loadings").

If the --save flag is given, components with eigenvalues greater than the
mean (which means greater than 1.0 if the analysis is based on the
correlation matrix) are saved to the dataset as series, with names PC1, PC2
and so on. These artificial variables are formed as the sum of (component
loading) times (standardized Xi), where Xi denotes the ith variable in
varlist.

If the --save-all flag is given, all of the components are saved as
described above.

Menu path:    /View/Principal components
Other access: Main window pop-up (multiple selection)

# pergm Statistics

Arguments:  series [ bandwidth ] 
Options:    --bartlett (use Bartlett lag window)
            --log (use log scale)
            --radians (show frequency in radians)
            --degrees (show frequency in degrees)

Computes and displays (and if not in batch mode, graphs) the spectrum of the
specified series. By default the sample periodogram is given, but optionally
a Bartlett lag window is used in estimating the spectrum (see, for example,
Greene's Econometric Analysis for a discussion of this). The default width
of the Bartlett window is twice the square root of the sample size but this
can be set manually using the bandwidth parameter, up to a maximum of half
the sample size.

If the --log option is given the spectrum is represented on a logarithmic
scale.

The (mutually exclusive) options --radians and --degrees influence the
appearance of the frequency axis when the periodogram is graphed. By default
the frequency is scaled by the number of periods in the sample, but these
options cause the axis to be labeled from 0 to pi radians or from 0 to
180degrees, respectively.

Menu path:    /Variable/Periodogram
Other access: Main window pop-up menu (single selection)

# poisson Estimation

Arguments:  depvar indepvars [ ; offset ] 
Options:    --robust (robust standard errors)
            --vcv (print covariance matrix)
            --verbose (print details of iterations)
Examples:   poisson y 0 x1 x2
            poisson y 0 x1 x2 ; S

Estimates a poisson regression. The dependent variable is taken to represent
the occurrence of events of some sort, and must take on only non-negative
integer values.

If a discrete random variable Y follows the Poisson distribution, then

  Pr(Y = y) = exp(-v) * v^y / y!

for y = 0, 1, 2,.... The mean and variance of the distribution are both
equal to v. In the Poisson regression model, the parameter v is represented
as a function of one or more independent variables. The most common version
(and the only one supported by gretl) has

  v = exp(b0 + b1*x1 + b2*x2 + ...)

or in other words the log of v is a linear function of the independent
variables.

Optionally, you may add an "offset" variable to the specification. This is a
scale variable, the log of which is added to the linear regression function
(implicitly, with a coefficient of 1.0). This makes sense if you expect the
number of occurrences of the event in question to be proportional, other
things equal, to some known factor. For example, the number of traffic
accidents might be supposed to be proportional to traffic volume, other
things equal, and in that case traffic volume could be specified as an
"offset" in a Poisson model of the accident rate. The offset variable must
be strictly positive.

By default, standard errors are computed using the negative inverse of the
Hessian. If the --robust flag is given, then QML or Huber-White standard
errors are calculated instead. In this case the estimated covariance matrix
is a "sandwich" of the inverse of the estimated Hessian and the outer
product of the gradient.

See also "negbin".

Menu path:    /Model/Nonlinear models/Count data...

# print Printing

Variants:   print varlist
            print
            print object_name
            print string_literal
Options:    --byobs (by observations)
            --no-dates (use simple observation numbers)
Examples:   print x1 x2 --byobs
            print my_matrix
            print "This is a string"

If varlist is given, prints the values of the specified series, or if no
argument is given, prints the values of all series in the current dataset.
If the --byobs flag is added the data are printed by observation, otherwise
they are printed by variable. When printing by observation, the default is
to show the date (with time-series data) or the observation marker string
(if any) at the start of each line. The --no-dates option suppresses the
printing of dates or markers; a simple observation number is shown instead.

Besides printing series, you may give the name of a (single) matrix or
scalar variable for printing. Or you may give a literal string argument,
enclosed in double quotes, to be printed as is. In these case the option
flags are not applicable.

Note that you can gain greater control over the printing format (and so, for
example, expose a greater number of digits than are shown by default) by
using "printf".

Menu path:    /Data/Display values

# printf Printing

Arguments:  format , args 

Prints scalar values, series, matrices, or strings under the control of a
format string (providing a subset of the printf() statement in the C
programming language). Recognized numeric formats are %e, %E, %f, %g, %G and
%d, in each case with the various modifiers available in C. Examples: the
format %.10g prints a value to 10 significant figures; %12.6f prints a value
to 6 decimal places, with a width of 12 characters. The format %s should be
used for strings.

The format string itself must be enclosed in double quotes. The values to be
printed must follow the format string, separated by commas. These values
should take the form of either (a) the names of variables, (b) expressions
that are valid for the "genr" command, or (c) the special functions
varname() or date(). The following example prints the values of two
variables plus that of a calculated expression:

	ols 1 0 2 3
	genr b = $coeff(2)
	genr se_b = $stderr(2)
	printf "b = %.8g, standard error %.8g, t = %.4f\n", b, se_b, b/se_b

The next lines illustrate the use of the varname and date functions, which
respectively print the name of a variable, given its ID number, and a date
string, given a 1-based observation number.

	printf "The name of variable %d is %s\n", i, varname(i)
	printf "The date of observation %d is %s\n", j, date(j)

If a matrix argument is given in association with a numeric format, the
entire matrix is printed using the specified format for each element. The
same applies to series, except that the range of values printed is governed
by the current sample setting.

The maximum length of a format string is 127 characters. The escape
sequences \n (newline), \t (tab), \v (vertical tab) and \\ (literal
backslash) are recognized. To print a literal percent sign, use %%.

As in C, numerical values that form part of the format (width and or
precision) may be given directly as numbers, as in %10.4f, or they may be
given as variables. In the latter case, one puts asterisks into the format
string and supplies corresponding arguments in order. For example,

	scalar width = 12
	scalar precision = 6
	printf "x = %*.*f\n", width, precision, x

# probit Estimation

Arguments:  depvar indepvars 
Options:    --robust (robust standard errors)
            --vcv (print covariance matrix)
            --verbose (print details of iterations)
            --p-values (show p-values instead of slopes)

If the dependent variable is a binary variable (all values are 0 or 1)
maximum likelihood estimates of the coefficients on indepvars are obtained
via the "binary response model regression" (BRMR) method outlined by
Davidson and MacKinnon (2004). As the model is nonlinear the slopes depend
on the values of the independent variables. By default the slopes with
respect to each of the independent variables are calculated (at the means of
those variables) and these slopes replace the usual p-values in the
regression output. This behavior can be suppressed my giving the --p-values
option. The chi-square statistic tests the null hypothesis that all
coefficients are zero apart from the constant.

By default, standard errors are computed using the negative inverse of the
Hessian. If the --robust flag is given, then QML or Huber-White standard
errors are calculated instead. In this case the estimated covariance matrix
is a "sandwich" of the inverse of the estimated Hessian and the outer
product of the gradient. See chapter 10 of Davidson and MacKinnon for
details.

If the dependent variable is not binary but is discrete, then Ordered Probit
estimates are obtained. (If the variable selected as dependent is not
discrete, an error is flagged.)

Probit for analysis of proportions is not implemented in gretl at this
point.

Menu path:    /Model/Nonlinear models/Probit

# pvalue Utilities

Arguments:  dist [ params ] xval 
Examples:   pvalue z zscore
            pvalue t 25 3.0
            pvalue X 3 5.6
            pvalue F 4 58 fval
            pvalue G shape scale x
            pvalue B bprob 10 6
            pvalue P lambda x
            pvalue W shape scale x

Computes the area to the right of xval in the specified distribution (z for
Gaussian, t for Student's t, X for chi-square, F for F, G for gamma, B for
binomial, P for Poisson, or W for Weibull).

Depending on the distribution, the following information must be given,
before the xval: for the t and chi-square distributions, the degrees of
freedom; for F, the numerator and denominator degrees of freedom; for gamma,
the shape and scale parameters; for the binomial distribution, the "success"
probability and the number of trials; for the Poisson distribution, the
parameter lambda (which is both the mean and the variance); and for the
Weibull distribution, shape and scale parameters. As shown in the examples
above, the numerical parameters may be given in numeric form or as the names
of variables.

The parameters for the gamma distribution are sometimes given as mean and
variance rather than shape and scale. The mean is the product of the shape
and the scale; the variance is the product of the shape and the square of
the scale. So the scale may be found as the variance divided by the mean,
and the shape as the mean divided by the scale.

Menu path:    /Tools/P-value finder

# qlrtest Tests

For a model estimated on time-series data via OLS, performs the Quandt
likelihood ratio (QLR) test for a structural break at an unknown point in
time, with 15 percent trimming at the beginning and end of the sample
period.

For each potential break point within the central 70 percent of the
observations, a Chow test is performed (see "chow"). The QLR test statistic
is the maximum of the F values from these tests. It follows a non-standard
distribution, the critical values of which are taken from Stock and Watson's
Introduction to Econometrics (2003). If the QLR statistic exceeds the
critical value at the chosen level of significance, one can infer that the
parameters of the model are not constant. This statistic can be used to
detect forms of instability other than a single discrete break (such as
multiple breaks or a slow drifting of the parameters).

Menu path:    Model window, /Tests/QLR test

# qqplot Graphs

Variants:   qqplot y
            qqplot y x
Options:    --z-scores (see below)
            --raw (see below)

Given just one series argument, displays a plot of the empirical quantiles
of the selected series (given by name or ID number) against the quantiles of
the normal distribution. The series must include at least 20 valid
observations in the current sample range. By default the empirical quantiles
are plotted against quantiles of the normal distribution having the same
mean and variance as the sample data, but two alternatives are available: if
the --z-scores option is given the data are standardized, while if the --raw
option is given the "raw" empirical quantiles are plotted against the
quantiles of the standard normal distribution.

Given two series arguments, y and x, displays a plot of the empirical
quantiles of y against those of x. The data values are not standardized.

Menu path:    /Variable/Normal Q-Q plot
Menu path:    /View/Graph specified vars/Q-Q plot

# quantreg Estimation

Arguments:  tau depvar indepvars 
Options:    --robust (robust standard errors)
            --intervals[=level] (compute confidence intervals)
            --vcv (print covariance matrix)
            --quiet (suppress printing of results)
Examples:   quantreg 0.25 y 0 xlist
            quantreg 0.5 y 0 xlist --intervals
            quantreg 0.5 y 0 xlist --intervals=.95
            quantreg tauvec y 0 xlist --robust
            See also mrw_qr.inp

Quantile regression. The first argument, tau, is the conditional quantile
for which estimates are wanted. It may be given either as a numerical value
or as the name of a pre-defined scalar variable; the value must be in the
range 0.01 to 0.99. (Alternatively, a vector of values may be given for tau;
see below for details.) The second and subsequent arguments compose a
regression list on the same pattern as "ols".

Without the --intervals option, standard errors are printed for the quantile
estimates. By default, these are computed according to the asymptotic
formula given by Koenker and Bassett (1978), but if the --robust option is
given, standard errors that are robust with respect to heteroskedasticity
are calculated using the method of Koenker and Zhao (1994).

When the --intervals option is chosen, confidence intervals are given for
the parameter estimates instead of standard errors. These intervals are
computed using the rank inversion method, and in general they are
asymmetrical about the point estimates. The specifics of the calculation are
inflected by the --robust option: without this, the intervals are computed
on the assumption of IID errors (Koenker, 1994); with it, they use the
robust estimator developed by Koenker and Machado (1999).

By default, 90 percent confidence intervals are produced. You can change
this by appending a confidence level (expressed as a decimal fraction) to
the intervals option, as in --intervals=0.95.

Vector-valued tau: instead of supplying a scalar, you may give the name of a
pre-defined matrix. In this case estimates are computed for all the given
tau values and the results are printed in a special format, showing the
sequence of quantile estimates for each regressor in turn.

Menu path:    /Model/Robust estimation/Quantile regression

# quit Utilities

Exits from the program, giving you the option of saving the output from the
session on the way out.

Menu path:    /File/Exit

# rename Dataset

Arguments:  series newname 

Changes the name of series (identified by name or ID number) to newname. The
new name must be of 15 characters maximum, must start with a letter, and
must be composed of only letters, digits, and the underscore character.

Menu path:    /Variable/Edit attributes
Other access: Main window pop-up menu (single selection)

# reset Tests

Options:    --quiet (don't print the auxiliary regression)
            --squares-only (compute the test using only the squares)
            --cubes-only (compute the test using only the cubes)

Must follow the estimation of a model via OLS. Carries out Ramsey's RESET
test for model specification (non-linearity) by adding the square and/or the
cube of the fitted values to the regression and calculating the F statistic
for the null hypothesis that the parameters on the added terms are zero.

Both the square and the cube are added, unless one of the options
--squares-only or --cubes-only is given.

Menu path:    Model window, /Tests/Ramsey's RESET

# restrict Tests

Options:    --quiet (don't print restricted estimates)
            --silent (don't print anything)
            --wald (system estimators only - see below)
            --bootstrap (bootstrap the test if possible)
            --full (OLS and VECMs only, see below)

Imposes a set of (usually linear) restrictions on either (a) the model last
estimated or (b) a system of equations previously defined and named. In all
cases the set of restrictions should be started with the keyword "restrict"
and terminated with "end restrict".

In the single equation case the restrictions are always implicitly to be
applied to the last model, and they are evaluated as soon as the restrict
block is closed.

In the case of a system of equations (defined via the "system" command), the
initial "restrict" may be followed by the name of a previously defined
system of equations. If this is omitted and the last model was a system then
the restrictions are applied to the last model. By default the restrictions
are evaluated when the system is next estimated, using the "estimate"
command. But if the --wald option is given the restriction is tested right
away, via a Wald chi-square test on the covariance matrix. Note that this
option will produce an error if a system has been defined but not yet
estimated.

Depending on the context, the restrictions to be tested may be expressed in
various ways. The simplest form is as follows: each restriction is given as
an equation, with a linear combination of parameters on the left and a
scalar value to the right of the equals sign (either a numerical constant or
the name of a scalar variable).

In the single-equation case, parameters may be referenced in the form b[i],
where i represents the position in the list of regressors (starting at 1),
or b[varname], where varname is the name of the regressor in question. In
the system case, parameters are referenced using b plus two numbers in
square brackets. The leading number represents the position of the equation
within the system and the second number indicates position in the list of
regressors. For example b[2,1] denotes the first parameter in the second
equation, and b[3,2] the second parameter in the third equation. The b terms
in the equation representing a restriction may be prefixed with a numeric
multiplier, for example 3.5*b[4].

Here is an example of a set of restrictions for a previously estimated
model:

	restrict
	 b[1] = 0
	 b[2] - b[3] = 0
	 b[4] + 2*b[5] = 1
	end restrict

And here is an example of a set of restrictions to be applied to a named
system. (If the name of the system does not contain spaces, the surrounding
quotes are not required.)

	restrict "System 1"
	 b[1,1] = 0
	 b[1,2] - b[2,2] = 0
	 b[3,4] + 2*b[3,5] = 1
	end restrict

In the single-equation case the restrictions are by default evaluated via a
Wald test, using the covariance matrix of the model in question. If the
original model was estimated via OLS then the restricted coefficient
estimates are printed; to suppress this, append the --quiet option flag to
the initial restrict command. As an alternative to the Wald test, for models
estimated via OLS or WLS only, you can give the --bootstrap option to
perform a bootstrapped test of the restriction.

In the system case, the test statistic depends on the estimator chosen: a
Likelihood Ratio test if the system is estimated using a Maximum Likelihood
method, or an asymptotic F-test otherwise.

There are two alternatives to the method of expressing restrictions
discussed above. First, a set of g linear restrictions on a k-vector of
parameters, beta, may be written compactly as Rbeta - q = 0, where R is an g
x k matrix and q is a g-vector. You can specify a restriction by giving the
names of pre-defined, conformable matrices to be used as R and q, as in

	restrict 
	  R = Rmat
	  q = qvec
	end restrict

Secondly, if you wish to test a nonlinear restriction (this is currently
available for single-equation models only) you should give the restriction
as the name of a function, preceded by "rfunc = ", as in

	restrict
	  rfunc = myfunction
	end restrict

The constraint function should take a single const matrix argument; this
will be automatically filled out with the parameter vector. And it should
return a vector which is zero under the null hypothesis, non-zero otherwise.
The length of the vector is the number of restrictions. This function is
used as a "callback" by gretl's numerical Jacobian routine, which calculates
a Wald test statistic via the delta method.

Here is a simple example of a function suitable for testing one nonlinear
restriction, namely that two pairs of parameter values have a common ratio.

	function matrix restr (const matrix b)
	  matrix v = b[1]/b[2] - b[4]/b[5]
	  return v
	end function

On successful completion of the restrict command the accessors $test and
$pvalue give the test statistic and its p-value.

When testing restrictions on a single-equation model estimated via OLS, or
on a VECM, the --full option can be used to set the restricted estimates as
the "last model" for the purposes of further testing or the use of accessors
such as $coeff and $vcv. Note that some special considerations apply in the
case of testing restrictions on Vector Error Correction Models. Please see
the Gretl User's Guide for details.

Menu path:    Model window, /Tests/Linear restrictions

# rmplot Graphs

Argument:   series 
Option:     --quiet (suppress printed output)

Range-mean plot: this command creates a simple graph to help in deciding
whether a time series, y(t), has constant variance or not. We take the full
sample t=1,...,T and divide it into small subsamples of arbitrary size k.
The first subsample is formed by y(1),...,y(k), the second is y(k+1), ...,
y(2k), and so on. For each subsample we calculate the sample mean and range
(= maximum minus minimum), and we construct a graph with the means on the
horizontal axis and the ranges on the vertical. So each subsample is
represented by a point in this plane. If the variance of the series is
constant we would expect the subsample range to be independent of the
subsample mean; if we see the points approximate an upward-sloping line this
suggests the variance of the series is increasing in its mean; and if the
points approximate a downward sloping line this suggests the variance is
decreasing in the mean.

Besides the graph, gretl displays the means and ranges for each subsample,
along with the slope coefficient for an OLS regression of the range on the
mean and the p-value for the null hypothesis that this slope is zero. If the
slope coefficient is significant at the 10 percent significance level then
the fitted line from the regression of range on mean is shown on the graph.
The t-statistic for the null, and the corresponding p-value, are recorded
and may be retrieved using the accessors $test and $pvalue respectively.

If the --quiet option is given, no graph is shown and no output is printed;
only the t-statistic and p-value are recorded.

Menu path:    /Variable/Range-mean graph

# run Programming

Argument:   filename 

Execute the commands in filename then return control to the interactive
prompt. This command is intended for use with the command-line program
gretlcli, or at the "gretl console" in the GUI program.

See also "include".

Menu path:    Run icon in script window

# runs Tests

Argument:   series 
Options:    --difference (use first difference of variable)
            --equal (positive and negative values are equiprobable)

Carries out the nonparametric "runs" test for randomness of the specified
series, where runs are defined as sequences of consecutive positive or
negative values. If you want to test for randomness of deviations from the
median, for a variable named x1 with a non-zero median, you can do the
following:

	genr signx1 = x1 - median(x1)
	runs signx1

If the --difference option is given, the variable is differenced prior to
the analysis, hence the runs are interpreted as sequences of consecutive
increases or decreases in the value of the variable.

If the --equal option is given, the null hypothesis incorporates the
assumption that positive and negative values are equiprobable, otherwise the
test statistic is invariant with respect to the "fairness" of the process
generating the sequence, and the test focuses on independence alone.

Menu path:    /Tools/Nonparametric tests

# scatters Graphs

Arguments:  yvar ; xvars  or yvars ; xvar 
Options:    --with-lines (create line graphs)
            --output=filename (send output to specified file)
Examples:   scatters 1 ; 2 3 4 5
            scatters 1 2 3 4 5 6 ; 7
            scatters y1 y2 y3 ; x --with-lines

Generates pairwise graphs of yvar against all the variables in xvars, or of
all the variables in yvars against xvar. The first example above puts
variable 1 on the y-axis and draws four graphs, the first having variable 2
on the x-axis, the second variable 3 on the x-axis, and so on. The second
example plots each of variables 1 through 6 against variable 7 on the
x-axis. Scanning a set of such plots can be a useful step in exploratory
data analysis. The maximum number of plots is six; any extra variable in the
list will be ignored.

By default the graphs are scatterplots, but if you give the --with-lines
flag they will be line graphs.

For details on usage of the --output option, please see the "gnuplot"
command.

Menu path:    /View/Multiple graphs

# sdiff Transformations

Argument:   varlist 

The seasonal difference of each variable in varlist is obtained and the
result stored in a new variable with the prefix sd_. This command is
available only for seasonal time series.

Menu path:    /Add/Seasonal differences of selected variables

# set Programming

Variants:   set variable value
            set --to-file=filename
            set --from-file=filename
            set stopwatch
            set
Examples:   set svd on
            set csv_delim tab
            set horizon 10
            set --to-file=mysettings.inp

The most common use of this command is the first variant shown above, where
it is used to set the value of a selected program parameter. This is
discussed in detail below. The other uses are: with --to-file, to write a
script file containing all the current parameter settings; with --from-file
to read a script file containing parameter settings and apply them to the
current session; with stopwatch to zero the gretl "stopwatch" which can be
used to measure CPU time (see the entry for the $stopwatch accessor in the
gretl function reference); or, if the word set is given alone, to print the
current settings.

Values set via this comand remain in force for the duration of the gretl
session unless they are changed by a further call to "set". The parameters
that can be set in this way are enumerated below. Note that the settings of
hc_version, hac_lag and hac_kernel are used when the --robust option is
given to an estimation command.

The available settings are grouped under the following categories: program
interaction and behavior, numerical methods, random number generation,
robust estimation, filtering, time series estimation, and interaction with
GNU R.

Program interaction and behavior

These settings are used for controlling various aspects of the way gretl
interacts with the user.

  csv_delim: either comma (the default), space, tab or semicolon. Sets the
  column delimiter used when saving data to file in CSV format.

  csv_na: string to represent missing values when writing data to file in
  CSV format. Maximum 7 characters; the default is NA.

  echo: off or on (the default). Suppress or resume the echoing of commands
  in gretl's output.

  force_decpoint: on or off (the default). Force gretl to use the decimal
  point character, in a locale where another character (most likely the
  comma) is the standard decimal separator.

  halt_on_error: off or on (the default). By default, when an error is
  encountered in the course of executing a script, execution is halted (and
  if the command-line program is operating in batch mode, it exits with a
  non-zero return status). You can force gretl to continue on error by
  setting halt_on_error to off (or by setting the environment variable
  GRETL_KEEP_GOING to 1). If an error occurs while "compiling" a loop or
  user-defined function, however, execution is halted regardless.

  loop_maxiter: one positive integer value. Sets the maximum number of
  iterations that a while loop is allowed before halting (see "loop"). Note
  that this setting only affects the while variant, as its purpose is to
  forcibly break potentially infinite loops.

  max_verbose: on or off (the default). Toggles verbose output for the
  BFGSmax function (see the User's Guide for details).

  messages: off or on (the default). Suppress or resume the printing of
  non-error messages associated with various commands, for example when a
  new variable is generated or when the sample range is changed.

  warnings: off or on (the default). Suppress or resume the printing of
  warning messages issued when arithmetical operations produce non-finite
  values.

  debug: 1, 2 or 0 (the default). This is for use with user-defined
  functions. Setting debug to 1 is equivalent to turning messages on within
  all such functions; setting this variable to 2 has the additional effect
  of turning on max_verbose within all functions.

  shell_ok: on or off (the default). Enable launching external programs from
  gretl via the system shell. This is disabled by default for security
  reasons, and can only be enabled via the graphical user interface
  (Tools/Preferences/General). However, once set to on, this setting will
  remain active for future sessions until explicitly disabled.

  shelldir: path. Sets the current working directory for shell commands.

  use_cwd: on or off (the default). This setting affects the behavior of the
  "outfile" and "store" commands, which write external files. Normally, the
  file will be written in the user's default data directory; if use_cwd is
  on, on the contrary, the file will be created in the working directory
  when gretl was started.

  bfgs_verbskip: one integer. This setting affects the behavior of the
  --verbose option to those commands that use BFGS as an optimization
  algorithm and is used to compact output. if bfgs_verbskip is set to, say,
  3, then the --verbose switch will only print iterations 3, 6, 9 and so on.

  skip_missing: on (the default) or off. Controls gretl's behavior when
  contructing a matrix from data series: the default is to skip data rows
  that contain one or more missing values but if skip_missing is set off
  missing values are converted to NaNs.

  matrix_mask: the name of a series, or the keyword null. Offers greater
  control than skip_missing when constructing matrices from series: the data
  rows selected for matrices are those with non-zero (and non-missing)
  values in the specified series. The selected mask remains in force until
  it is replaced, or removed via the null keyword.

Numerical methods

These settings are used for controlling the numerical algorithms that gretl
uses for estimation.

  optimizer: either auto (the default), BFGS or newton. Sets the
  optimization algorithm used for various ML estimators, in cases where both
  BFGS and Newton-Raphson are applicable. The default is to use
  Newton-Raphson where an analytical Hessian is available, otherwise BFGS.

  bhhh_maxiter: one integer, the maximum number of iterations for gretl's
  internal BHHH routine, which is used in the "arma" command for conditional
  ML estimation. If convergence is not achieved after bhhh_maxiter, the
  program returns an error. The default is set at 500.

  bhhh_toler: one floating point value, or the string default. This is used
  in gretl's internal BHHH routine to check if convergence has occurred. The
  algorithm stops iterating as soon as the increment in the log-likelihood
  between iterations is smaller than bhhh_toler. The default value is
  1.0E-06; this value may be re-established by typing default in place of a
  numeric value.

  bfgs_maxiter: one integer, the maximum number of iterations for gretl's
  BFGS routine, which is used for "mle", "gmm" and several specific
  estimators. If convergence is not achieved in the specified number of
  iterations, the program returns an error. The default value depends on the
  context, but is typically of the order of 500.

  bfgs_toler: one floating point value, or the string default. This is used
  in gretl's BFGS routine to check if convergence has occurred. The
  algorithm stops as soon as the relative improvement in the objective
  function between iterations is smaller than bfgs_toler. The default value
  is the machine precision to the power 3/4; this value may be
  re-established by typing default in place of a numeric value.

  bfgs_maxgrad: one floating point value. This is used in gretl's BFGS
  routine to check if the norm of the gradient is reasonably close to zero
  when the bfgs_toler criterion is met. A warning is printed if the norm of
  the gradient exceeds 1; an error is flagged if the norm exceeds
  bfgs_maxgrad. At present the default is the permissive value of 5.0.

  initvals: a pre-specified matrix. Allows manual setting of the initial
  parameter estimates for numerical optimization problems (such as ARMA
  estimation). For details see the Gretl User's Guide.

  lbfgs: on or off (the default). Use the limited-memory version of BFGS
  (L-BFGS-B) instead of the ordinary algorithm. This may be advantageous
  when the function to be maximized is not globally concave.

  lbfgs_mem: an integer value in the range 3 to 20 (with a default value of
  8). This determines the number of corrections used in the limited memory
  matrix when L-BFGS-B is employed.

  nls_toler: a floating-point value (the default is the machine precision to
  the power 3/4). Sets the tolerance used in judging whether or not
  convergence has occurred in nonlinear least squares estimation using the
  "nls" command.

  svd: on or off (the default). Use SVD rather than Cholesky or QR
  decomposition in least squares calculations. This option applies to the
  mols function as well as various internal calculations, but not to the
  regular "ols" command.

  fcp: on or off (the default). Use the algorithm of Fiorentini, Calzolari
  and Panattoni rather than native gretl code when computing GARCH
  estimates.

  gmm_maxiter: one integer, the maximum number of iterations for gretl's gmm
  command when in iterated mode (as opposed to one- or two-step). The
  default value is 250.

Random number generation

  seed: an unsigned integer. Sets the seed for the pseudo-random number
  generator. By default this is set from the system time; if you want to
  generate repeatable sequences of random numbers you must set the seed
  manually.

  RNG: either MT or SFMT (the default). Switches between the default random
  number generator, namely the SIMD-oriented Fast Mersenne Twister (SFMT),
  and the Mersenne Twister of 2002 as implemented in GLib (MT). SFMT is
  faster and has better distributional properties but MT was gretl's RNG up
  to version 1.9.3.

  normal_rand: ziggurat (the default) or box-muller. Sets the method for
  generating random normal samples based on uniform input.

Robust estimation

  bootrep: an integer. Sets the number of replications for the "restrict"
  command with the --bootstrap option.

  garch_vcv: unset, hessian, im (information matrix) , op (outer product
  matrix), qml (QML estimator), bw (Bollerslev-Wooldridge). Specifies the
  variant that will be used for estimating the coefficient covariance
  matrix, for GARCH models. If unset is given (the default) then the Hessian
  is used unless the "robust" option is given for the garch command, in
  which case QML is used.

  arma_vcv: hessian (the default) or op (outer product matrix). Specifies
  the variant to be used when computing the covariance matrix for ARIMA
  models.

  force_hc: off (the default) or on. By default, with time-series data and
  when the --robust option is given with ols, the HAC estimator is used. If
  you set force_hc to "on", this forces calculation of the regular
  Heteroskedasticity Consistent Covariance Matrix (HCCM), which does not
  take autocorrelation into account. Note that when a VAR is estimated with
  the --robust option, the default is regular HCCM, but the --robust-hac
  option is available to produce a HAC estimator.

  hac_lag: nw1 (the default), nw2, nw3 or an integer. Sets the maximum lag
  value or bandwidth, p, used when calculating HAC (Heteroskedasticity and
  Autocorrelation Consistent) standard errors using the Newey-West approach,
  for time series data. nw1 and nw2 represent two variant automatic
  calculations based on the sample size, T: for nw1, p = 0.75 * T^(1/3), and
  for nw2, p = 4 * (T/100)^(2/9). nw3 calls for data-based bandwidth
  selection. See also qs_bandwidth and hac_prewhiten below.

  hac_kernel: bartlett (the default), parzen, or qs (Quadratic Spectral).
  Sets the kernel, or pattern of weights, used when calculating HAC standard
  errors.

  hac_prewhiten: on or off (the default). Use Andrews-Monahan prewhitening
  and re-coloring when computing HAC standard errors. This also implies use
  of data-based bandwidth selection.

  hc_version: 0 (the default), 1, 2, 3 or 3a. Sets the variant used when
  calculating Heteroskedasticity Consistent standard errors with
  cross-sectional data. The first four options correspond to the HC0, HC1,
  HC2 and HC3 discussed by Davidson and MacKinnon in Econometric Theory and
  Methods, chapter 5. HC0 produces what are usually called "White's standard
  errors". Variant 3a is the MacKinnon-White "jackknife" procedure.

  pcse: off (the default) or on. By default, when estimating a model using
  pooled OLS on panel data with the --robust option, the Arellano estimator
  is used for the covariance matrix. If you set pcse to "on", this forces
  use of the Beck and Katz Panel Corrected Standard Errors (which do not
  take autocorrelation into account).

  qs_bandwidth: Bandwidth for HAC estimation in the case where the Quadratic
  Spectral kernel is selected. (Unlike the Bartlett and Parzen kernels, the
  QS bandwidth need not be an integer.)

Time series

  horizon: one integer (the default is based on the frequency of the data).
  Sets the horizon for impulse responses and forecast variance
  decompositions in the context of vector autoregressions.

  vecm_norm: phillips (the default), diag, first or none. Used in the
  context of VECM estimation via the "vecm" command for identifying the
  cointegration vectors. See the the Gretl User's Guide for details.

Interaction with R

  R_lib: on (the default) or off. When sending instructions to be executed
  by R, use the R shared library by preference to the R executable, if the
  library is available.

  R_functions: off (the default) or on. Recognize functions defined in R as
  if they were native functions (the namespace prefix "R." is required). See
  the Gretl User's Guide for details on this and the previous item.

# setinfo Dataset

Arguments:  series -d description -n displayname 
Options:    --discrete (mark series as discrete)
            --continuous (mark series as continuous)
Examples:   setinfo x1 -d "Description of x1" -n "Graph name"
            setinfo z --discrete

Sets up to three attributes of series, given by name or ID number, as
follows.

If the -d flag is given followed by a string in double quotes, that string
is used to set the variable's descriptive label. This label is shown in
response to the "labels" command, and is also shown in the main window of
the GUI program.

If the -n flag is given followed by a quoted string, that string is used to
set the variable's "display name", which is then used in place of the
variable's name in graphs.

If one or other of the --discrete or --continuous option flags is given, the
variable's numerical character is set accordingly. The default is to treat
all series as continuous; setting a series as discrete affects the way the
variable is handled in frequency plots.

Menu path:    /Variable/Edit attributes
Other access: Main window pop-up menu

# setobs Dataset

Variants:   setobs periodicity startobs
            setobs unitvar timevar
            setobs --labels=filename
Options:    --cross-section (interpret as cross section)
            --time-series (interpret as time series)
            --stacked-cross-section (interpret as panel data)
            --stacked-time-series (interpret as panel data)
            --panel-vars (use index variables, see below)
Examples:   setobs 4 1990:1 --time-series
            setobs 12 1978:03
            setobs 1 1 --cross-section
            setobs 20 1:1 --stacked-time-series
            setobs unit year --panel-vars

In its primary use, this command forces the program to interpret the current
data set as having a specified structure. A secondary use, with the --labels
flag, is to add observation labels to a dataset.

In the first form of the command the periodicity, which must be an integer,
represents frequency in the case of time-series data (1 = annual; 4 =
quarterly; 12 = monthly; 52 = weekly; 5, 6, or 7 = daily; 24 = hourly). In
the case of panel data the periodicity means the number of lines per data
block: this corresponds to the number of cross-sectional units in the case
of stacked cross-sections, or the number of time periods in the case of
stacked time series. In the case of simple cross-sectional data the
periodicity should be set to 1.

The starting observation represents the starting date in the case of time
series data. Years may be given with two or four digits; subperiods (for
example, quarters or months) should be separated from the year with a colon.
In the case of panel data the starting observation should be given as 1:1;
and in the case of cross-sectional data, as 1. Starting observations for
daily or weekly data should be given in the form YY/MM/DD or YYYY/MM/DD (or
simply as 1 for undated data).

The second form of the command (which requires the --panel-vars flag) may be
used to impose a panel interpretation when the data set contains variables
that uniquely identify the cross-sectional units and the time periods. The
data set will be sorted as stacked time series, by ascending values of the
units variable, unitvar.

If no explicit option flag is given to indicate the structure of the data
the program will attempt to guess the structure from the information given.

In the third form of the comman, with the --labels flag, the effect is not
to set the interpretation of the data structure, but rather to add labels
for the observations. The required filename parameter must give the name of
a plain text file that contains one label per line, with enough lines to
label all the observations.

Menu path:    /Data/Dataset structure
Menu path:    /Data/Observation markers

# setmiss Dataset

Arguments:  value [ varlist ] 
Examples:   setmiss -1
            setmiss 100 x2

Get the program to interpret some specific numerical data value (the first
parameter to the command) as a code for "missing", in the case of imported
data. If this value is the only parameter, as in the first example above,
the interpretation will be applied to all series in the data set. If "value"
is followed by a list of variables, by name or number, the interpretation is
confined to the specified variable(s). Thus in the second example the data
value 100 is interpreted as a code for "missing", but only for the variable
x2.

Menu path:    /Data/Set missing value code

# shell Utilities

Argument:   shellcommand 
Examples:   ! ls -al
            ! notepad
            launch notepad

A "!", or the keyword "launch", at the beginning of a command line is
interpreted as an escape to the user's shell. Thus arbitrary shell commands
can be executed from within gretl. When "!" is used, the external command is
executed synchronously. That is, gretl waits for it to complete before
proceeding. If you want to start another program from within gretl and not
wait for its completion (asynchronous operation), use "launch" instead.

For reasons of security this facility is not enabled by default. To activate
it, check the box titled "Allow shell commands" under the File, Preferences
menu in the GUI program. This also makes shell commands available in the
command-line program (and is the only way to do so).

# smpl Dataset

Variants:   smpl startobs endobs
            smpl +i -j
            smpl dumvar --dummy
            smpl condition --restrict
            smpl --no-missing [ varlist ]
            smpl --contiguous [ varlist ]
            smpl n --random
            smpl full
Options:    --dummy (argument is a dummy variable)
            --restrict (apply boolean restriction)
            --replace (replace any existing boolean restriction)
            --no-missing (restrict to valid observations)
            --contiguous (see below)
            --random (form random sub-sample)
            --balanced (panel data: try to retain balanced panel)
Examples:   smpl 3 10
            smpl 1960:2 1982:4
            smpl +1 -1
            smpl x > 3000 --restrict
            smpl y > 3000 --restrict --replace
            smpl 100 --random

Resets the sample range. The new range can be defined in several ways. In
the first alternate form (and the first two examples) above, startobs and
endobs must be consistent with the periodicity of the data. Either one may
be replaced by a semicolon to leave the value unchanged. In the second form,
the integers i and j (which may be positive or negative, and should be
signed) are taken as offsets relative to the existing sample range. In the
third form dummyvar must be an indicator variable with values 0 or 1 at each
observation; the sample will be restricted to observations where the value
is 1. The fourth form, using --restrict, restricts the sample to
observations that satisfy the given Boolean condition (which is specified
according to the syntax of the "genr" command).

With the --no-missing form, if varlist is specified observations are
selected on condition that all variables in varlist have valid values at
that observation; otherwise, if no varlist is given, observations are
selected on condition that all variables have valid (non-missing) values.

The --contiguous form of smpl is intended for use with time series data. The
effect is to trim any observations at the start and end of the current
sample range that contain missing values (either for the variables in
varlist, or for all data series if no varlist is given). Then a check is
performed to see if there are any missing values in the remaining range; if
so, an error is flagged.

With the --random flag, the specified number of cases are selected from the
current dataset at random (without replacement). If you wish to be able to
replicate this selection you should set the seed for the random number
generator first (see the "set" command).

The final form, smpl full, restores the full data range.

Note that sample restrictions are, by default, cumulative: the baseline for
any smpl command is the current sample. If you wish the command to act so as
to replace any existing restriction you can add the option flag --replace to
the end of the command. (But this option is not compatible with the
--contiguous option.)

The internal variable obs may be used with the --restrict form of smpl to
exclude particular observations from the sample. For example

	smpl obs!=4 --restrict

will drop just the fourth observation. If the data points are identified by
labels,

	smpl obs!="USA" --restrict

will drop the observation with label "USA".

One point should be noted about the --dummy, --restrict and --no-missing
forms of smpl: "structural" information in the data file (regarding the time
series or panel nature of the data) is likely to be lost when this command
is issued. You may reimpose structure with the "setobs" command. A related
option, for use with panel data, is the --balanced flag: this requests that
a balanced panel is reconstituted after sub-sampling, via the insertion of
"missing rows" if need be. But note that it is not always possible to comply
with this request.

Please see the Gretl User's Guide for further details.

Menu path:    /Sample

# spearman Statistics

Arguments:  var1 var2 
Option:     --verbose (print ranked data)

Prints Spearman's rank correlation coefficient for the series var1 and var2.
The variables do not have to be ranked manually in advance; the function
takes care of this.

The automatic ranking is from largest to smallest (i.e. the largest data
value gets rank 1). If you need to invert this ranking, create a new
variable which is the negative of the original. For example:

	genr altx = -x
	spearman altx y

Menu path:    /Model/Robust estimation/Rank correlation

# sprintf Printing

Arguments:  stringvar format , args 

This command works exactly like the "printf" command, printing the given
arguments under the control of the format string, except that the result is
written into the named string, stringvar.

To print the string variable, give its name preceded by @, as in

	sprintf myvar "%g", x
	print "myvar has value @myvar"

# square Transformations

Argument:   varlist 
Option:     --cross (generate cross-products as well as squares)

Generates new series which are squares of the series in varlist (plus
cross-products if the --cross option is given). For example, "square x y"
will generate sq_x = x squared, sq_y = y squared and (optionally) x_y = x
times y. If a particular variable is a dummy variable it is not squared
because we will get the same variable.

Menu path:    /Add/Squares of selected variables

# sscanf Programming

Arguments:  source , format , args 

Deprecated command-style version of the "sscanf" function.

# store Dataset

Arguments:  filename [ varlist ] 
Options:    --csv (use CSV format)
            --omit-obs (see below, on CSV format)
            --no-header (see below, on CSV format)
            --gnu-octave (use GNU Octave format)
            --gnu-R (use GNU R format)
            --traditional (use traditional ESL format)
            --gzipped (apply gzip compression)
            --jmulti (use JMulti ASCII format)
            --dat (use PcGive ASCII format)
            --database (use gretl database format)
            --overwrite (see below, on database format)
            --comment=string (see below)

Saves either the entire dataset or, if a varlist is supplied, a specified
subset of the series in the current dataset, to the file given by filename.

By default the data are saved in "native" gretl format, but the option flags
permit saving in several alternative formats. CSV (Comma-Separated Values)
data may be read into spreadsheet programs, and can also be manipulated
using a text editor. The formats of Octave, R and PcGive are designed for
use with the respective programs. Gzip compression may be useful for large
datasets. See the Gretl User's Guide for details on the various formats.

The option flags --omit-obs and --no-header are applicable only when saving
data in CSV format. By default, if the data are time series or panel, or if
the dataset includes specific observation markers, the CSV file includes a
first column identifying the observations (e.g. by date). If the --omit-obs
flag is given this column is omitted. The --no-header flag suppresses the
usual printing of the names of the variables at the top of the columns.

The option of saving in gretl database format is intended to help with the
construction of large sets of series, possibly having mixed frequencies and
ranges of observations. At present this option is available only for annual,
quarterly or monthly time-series data. If you save to a file that already
exists, the default action is to append the newly saved series to the
existing content of the database. In this context it is an error if one or
more of the variables to be saved has the same name as a variable that is
already present in the database. The --overwrite flag has the effect that,
if there are variable names in common, the newly saved variable replaces the
variable of the same name in the original dataset.

The --comment option is available when saving data as a database or in CSV
format. The required parameter is a double-quoted one-line string, attached
to the option flag with an equals sign. The string is inserted as a comment
into the database index file or at the top of the CSV output.

Menu path:    /File/Save data; /File/Export data

# summary Statistics

Variants:   summary [ varlist ]
            summary --matrix=matname
Options:    --simple (basic statistics only)
            --by=byvar (see below)

In its first form, this command prints summary statistics for the variables
in varlist, or for all the variables in the data set if varlist is omitted.
By default, output consists of the mean, standard deviation (sd),
coefficient of variation (= sd/mean), median, minimum, maximum, skewness
coefficient, and excess kurtosis. If the --simple option is given, output is
restricted to the mean, minimum, maximum and standard deviation.

If the --by option is given (in which case the parameter byvar should be the
name of a discrete variable), then statistics are printed for sub-samples
corresponding to the distinct values taken on by byvar. For example, if
byvar is a (binary) dummy variable, statistics are given for the cases byvar
= 0 and byvar = 1.

If the alternative form is given, using a named matrix, then summary
statistics are printed for each column of the matrix. The --by option is not
available in this case.

Menu path:    /View/Summary statistics
Other access: Main window pop-up menu

# system Estimation

Variants:   system method=estimator
            sysname <- system
Examples:   "Klein Model 1" <- system
            system method=sur
            system method=3sls
            See also klein.inp, kmenta.inp, greene14_2.inp

Starts a system of equations. Either of two forms of the command may be
given, depending on whether you wish to save the system for estimation in
more than one way or just estimate the system once.

To save the system you should assign it a name, as in the first example (if
the name contains spaces it must be surrounded by double quotes). In this
case you estimate the system using the "estimate" command. With a saved
system of equations, you are able to impose restrictions (including
cross-equation restrictions) using the "restrict" command.

Alternatively you can specify an estimator for the system using method=
followed by a string identifying one of the supported estimators: "ols"
(Ordinary Least Squares), "tsls" (Two-Stage Least Squares) "sur" (Seemingly
Unrelated Regressions), "3sls" (Three-Stage Least Squares), "fiml" (Full
Information Maximum Likelihood) or "liml" (Limited Information Maximum
Likelihood). In this case the system is estimated once its definition is
complete.

An equation system is terminated by the line "end system". Within the system
four sorts of statement may be given, as follows.

  "equation": specify an equation within the system. At least two such
  statements must be provided.

  "instr": for a system to be estimated via Three-Stage Least Squares, a
  list of instruments (by variable name or number). Alternatively, you can
  put this information into the "equation" line using the same syntax as in
  the "tsls" command.

  "endog": for a system of simultaneous equations, a list of endogenous
  variables. This is primarily intended for use with FIML estimation, but
  with Three-Stage Least Squares this approach may be used instead of giving
  an "instr" list; then all the variables not identified as endogenous will
  be used as instruments.

  "identity": for use with FIML, an identity linking two or more of the
  variables in the system. This sort of statement is ignored when an
  estimator other than FIML is used.

After estimation using the "system" or "estimate" commands the following
accessors can be used to retrieve additional information:

  $uhat: the matrix of residuals, one column per equation.

  $yhat: matrix of fitted values, one column per equation.

  $coeff: column vector of coefficients (all the coefficients from the first
  equation, followed by those from the second equation, and so on).

  $vcv: covariance matrix of the coefficients. If there are k elements in
  the $coeff vector, this matrix is k by k.

  $sigma: cross-equation residual covariance matrix.

  $sysGamma, $sysA and $sysB: structural-form coefficient matrices (see
  below).

If you want to retrieve the residuals or fitted values for a specific
equation as a data series, select a column from the $uhat or $yhat matrix
and assign it to a series, as in

	series uh1 = $uhat[,1]

The structural-form matrices correspond to the following representation of a
simultaneous equations model:

  Gamma y(t) = A y(t-1) + B x(t) + e(t)

If there are n endogenous variables and k exogenous variables, Gamma is an n
x n matrix and B is n x k. If the system contains no lags of the endogenous
variables then the A matrix is not present. If the maximum lag of an
endogenous regressor is p, the A matrix is n x np.

Menu path:    /Model/Simultaneous equations

# tabprint Printing

Argument:   [ -f filename ] 
Options:    --rtf (Produce RTF instead of LaTeX)
            --complete (Create a complete document)
            --format="f1|f2|f3|f4" (Specify a custom format)

Must follow the estimation of a model. Prints the estimated model in tabular
form -- by default as LaTeX, but as RTF if the --rtf flag is given. If a
filename is specified using the -f flag output goes to that file, otherwise
it goes to a file with a name of the form model_N.tex (or model_N.rtf),
where N is the number of models estimated to date in the current session.

The further options discussed below are available only when printing the
model as LaTeX.

If the --complete flag is given the LaTeX file is a complete document, ready
for processing; otherwise it must be included in a document.

If you wish alter the appearance of the tabular output, you can specify a
custom row format using the --format flag. The format string must be
enclosed in double quotes and must be tied to the flag with an equals sign.
The pattern for the format string is as follows. There are four fields,
representing the coefficient, standard error, t-ratio and p-value
respectively. These fields should be separated by vertical bars; they may
contain a printf-type specification for the formatting of the numeric value
in question, or may be left blank to suppress the printing of that column
(subject to the constraint that you can't leave all the columns blank). Here
are a few examples:

	--format="%.4f|%.4f|%.4f|%.4f"
	--format="%.4f|%.4f|%.3f|"
	--format="%.5f|%.4f||%.4f"
	--format="%.8g|%.8g||%.4f"

The first of these specifications prints the values in all columns using 4
decimal places. The second suppresses the p-value and prints the t-ratio to
3 places. The third omits the t-ratio. The last one again omits the t, and
prints both coefficient and standard error to 8 significant figures.

Once you set a custom format in this way, it is remembered and used for the
duration of the gretl session. To revert to the default format you can use
the special variant --format=default.

Menu path:    Model window, /LaTeX

# textplot Graphs

Argument:   varlist 
Options:    --time-series (plot by observation)
            --one-scale (force a single scale)
            --tall (use 40 rows)

Quick and simple ASCII graphics. Without the --time-series flag, varlist
must contain at least two series, the last of which is taken as the variable
for the x axis, and a scatter plot is produced. In this case the --tall
option may be used to produce a graph in which the y axis is represented by
40 rows of characters (the default is 20 rows).

With the --time-series, a plot by observation is produced. In this case the
option --one-scale may be used to force the use of a single scale; otherwise
if varlist contains more than one series the data may be scaled. Each line
represents an observation, with the data values plotted horizontally.

See also "gnuplot".

# tobit Estimation

Arguments:  depvar indepvars 
Options:    --llimit=lval (specify left bound)
            --rlimit=rval (specify right bound)
            --vcv (print covariance matrix)
            --robust (robust standard errors)
            --verbose (print details of iterations)

Estimates a Tobit model, which may be appropriate when the dependent
variable is "censored". For example, positive and zero values of purchases
of durable goods on the part of individual households are observed, and no
negative values, yet decisions on such purchases may be thought of as
outcomes of an underlying, unobserved disposition to purchase that may be
negative in some cases.

By default it is assumed that the dependent variable is censored at zero on
the left and is uncensored on the right. However you can use the options
--llimit and --rlimit to specify a different pattern of censoring. Note that
if you specify a right bound only, the assumption is then that the dependent
variable is uncensored on the left.

The Tobit model is a special case of interval regression, which is supported
via the "intreg" command.

Menu path:    /Model/Nonlinear models/Tobit

# tsls Estimation

Arguments:  depvar indepvars ; instruments 
Options:    --no-tests (don't do diagnostic tests)
            --vcv (print covariance matrix)
            --robust (robust standard errors)
            --liml (use Limited Information Maximum Likelihood)
            --gmm (use the Generalized Method of Moments)
Example:    tsls y1 0 y2 y3 x1 x2 ; 0 x1 x2 x3 x4 x5 x6

Computes Instrumental Variables (IV) estimates, by default using two-stage
least squares (TSLS) but see below for further options. The dependent
variable is depvar, indepvars is the list of regressors (which is presumed
to include at least one endogenous variable); and instruments is the list of
instruments (exogenous and/or predetermined variables). If the instruments
list is not at least as long as indepvars, the model is not identified.

In the above example, the ys are endogenous and the xs are the exogenous
variables. Note that exogenous regressors should appear in both lists.

Output for two-stage least squares estimates includes the Hausman test and,
if the model is over-identified, the Sargan over-identification test. In the
Hausman test, the null hypothesis is that OLS estimates are consistent, or
in other words estimation by means of instrumental variables is not really
required. A model of this sort is over-identified if there are more
instruments than are strictly required. The Sargan test is based on an
auxiliary regression of the residuals from the two-stage least squares model
on the full list of instruments. The null hypothesis is that all the
instruments are valid, and suspicion is thrown on this hypothesis if the
auxiliary regression has a significant degree of explanatory power. For a
good explanation of both tests see chapter 8 of Davidson and MacKinnon
(2004).

For both TSLS and LIML estimation, an additional test result is shown
provided that the model is estimated under the assumption of i.i.d. errors
(that is, the --robust option is not selected). This is a test for weakness
of the instruments. Weak instruments can lead to serious problems in IV
regression: biased estimates and/or incorrect size of hypothesis tests based
on the covariance matrix, with rejection rates well in excess of the nominal
significance level (Stock, Wright and Yogo, 2002). The test statistic is the
first-stage F-test if the model contains just one endogenous regressor,
otherwise it is the smallest eigenvalue of the matrix counterpart of the
first stage F. Critical values based on the Monte Carlo analysis of Stock
and Yogo (2003) are shown when available.

The R-squared value printed for models estimated via two-stage least squares
is the square of the correlation between the dependent variable and the
fitted values.

As alternatives to TSLS, the model may be estimated via Limited Information
Maximum Likelihood (the --liml option) or via the Generalized Method of
Moments (--gmm option). Note that if the model is just identified these
methods should produce the same results as TSLS, but if it is
over-identified the results will differ in general.

If GMM estimation is selected, the following additional options become
available:

  --two-step: perform two-step GMM rather than the default of one-step.

  --iterate: Iterate GMM to convergence.

  --weights=Wmat: specify a square matrix of weights to be used when
  computing the GMM criterion function. The dimension of this matrix must
  equal the number of instruments. The default is an appropriately sized
  identity matrix.

Menu path:    /Model/Other linear models/Two-Stage Least Squares

# var Estimation

Arguments:  order ylist [ ; xlist ] 
Options:    --nc (do not include a constant)
            --trend (include a linear trend)
            --seasonals (include seasonal dummy variables)
            --robust (robust standard errors)
            --robust-hac (HAC standard errors)
            --impulse-responses (print impulse responses)
            --variance-decomp (print variance decompositions)
            --lagselect (show information criteria for lag selection)
Examples:   var 4 x1 x2 x3 ; time mydum
            var 4 x1 x2 x3 --seasonals
            var 12 x1 x2 x3 --lagselect

Sets up and estimates (using OLS) a vector autoregression (VAR). The first
argument specifies the lag order -- or the maximum lag order in case the
--lagselect option is given (see below). The order may be given numerically,
or as the name of a pre-existing scalar variable. Then follows the setup for
the first equation. Don't include lags among the elements of ylist -- they
will be added automatically. The semi-colon separates the stochastic
variables, for which order lags will be included, from any exogenous
variables in xlist. Note that a constant is included automatically unless
you give the --nc flag, a trend can be added with the --trend flag, and
seasonal dummy variables may be added using the --seasonals flag.

A separate regression is reported for each variable in ylist. Output for
each equation includes F-tests for zero restrictions on all lags of each of
the variables, an F-test for the significance of the maximum lag, and, if
the --impulse-responses flag is given, forecast variance decompositions and
impulse responses.

Forecast variance decompositions and impulse responses are based on the
Cholesky decomposition of the contemporaneous covariance matrix, and in this
context the order in which the (stochastic) variables are given matters. The
first variable in the list is assumed to be "most exogenous" within-period.
The horizon for variance decompositions and impulse responses can be set
using the "set" command.

If the --robust option is given, standard errors are corrected for
heteroskedasticity. Alternatively, the --robust-hac option can be given to
produce standard errors that are robust with respect to both
heteroskedasticity and autocorrelation (HAC). In general the latter
correction should not be needed if the VAR includes sufficient lags.

If the --lagselect option is given, the first parameter to the var command
is taken as the maximum lag order. Output consists of a table showing the
values of the Akaike (AIC), Schwartz (BIC) and Hannan-Quinn (HQC)
information criteria computed from VARs of order 1 to the given maximum.
This is intended to help with the selection of the optimal lag order. The
usual VAR output is not presented. The table of information criteria may be
retrieved as a matrix via the $test accessor.

Menu path:    /Model/Time series/Vector autoregression

# varlist Dataset

Options:    --scalars (list scalars)
            --accessors (list accessor variables)

By default, prints a listing of the (series) variables currently available.
"list" and "ls" are synonyms.

If the --scalars option is given, prints a listing of any currently defined
scalar variables and their values. Otherwise, if the --accessors option is
given, prints a list of the internal variables currently available via
accessors such as "$nobs" and "$uhat".

# vartest Tests

Arguments:  var1 var2 

Calculates the F statistic for the null hypothesis that the population
variances for the variables var1 and var2 are equal, and shows its p-value.

Menu path:    /Model/Bivariate tests/Difference of variances

# vecm Estimation

Arguments:  order rank ylist [ ; xlist ] [ ; rxlist ] 
Options:    --nc (no constant)
            --rc (restricted constant)
            --crt (constant and restricted trend)
            --ct (constant and unrestricted trend)
            --seasonals (include centered seasonal dummies)
            --impulse-responses (print impulse responses)
            --variance-decomp (print variance decompositions)
Examples:   vecm 4 1 Y1 Y2 Y3
            vecm 3 2 Y1 Y2 Y3 --rc
            vecm 3 2 Y1 Y2 Y3 ; X1 --rc
            See also denmark.inp, hamilton.inp

A VECM is a form of vector autoregression or VAR (see "var"), applicable
where the variables in the model are individually integrated of order 1
(that is, are random walks, with or without drift), but exhibit
cointegration. This command is closely related to the Johansen test for
cointegration (see "coint2").

The order parameter to this command represents the lag order of the VAR
system. The number of lags in the VECM itself (where the dependent variable
is given as a first difference) is one less than order.

The rank parameter represents the cointegration rank, or in other words the
number of cointegrating vectors. This must be greater than zero and less
than or equal to (generally, less than) the number of endogenous variables
given in ylist.

ylist supplies the list of endogenous variables, in levels. The inclusion of
deterministic terms in the model is controlled by the option flags. The
default if no option is specified is to include an "unrestricted constant",
which allows for the presence of a non-zero intercept in the cointegrating
relations as well as a trend in the levels of the endogenous variables. In
the literature stemming from the work of Johansen (see for example his 1995
book) this is often referred to as "case 3". The first four options given
above, which are mutually exclusive, produce cases 1, 2, 4 and 5
respectively. The meaning of these cases and the criteria for selecting a
case are explained in the Gretl User's Guide.

The optional lists xlist and rxlist allow you to specify sets of exogenous
variables which enter the model either unrestrictedly (xlist) or restricted
to the cointegration space (rxlist). These lists are separated from ylist
and from each other by semicolons.

The --seasonals option, which may be combined with any of the other options,
specifies the inclusion of a set of centered seasonal dummy variables. This
option is available only for quarterly or monthly data.

The first example above specifies a VECM with lag order 4 and a single
cointegrating vector. The endogenous variables are Y1, Y2 and Y3. The second
example uses the same variables but specifies a lag order of 3 and two
cointegrating vectors; it also specifies a "restricted constant", which is
appropriate if the cointegrating vectors may have a non-zero intercept but
the Y variables have no trend.

Menu path:    /Model/Time series/VECM

# vif Tests

Must follow the estimation of a model which includes at least two
independent variables. Calculates and displays the Variance Inflation
Factors (VIFs) for the regressors. The VIF for regressor j is defined as

  1/(1 - Rj^2)

where R_j is the coefficient of multiple correlation between regressor j and
the other regressors. The factor has a minimum value of 1.0 when the
variable in question is orthogonal to the other independent variables.
Neter, Wasserman, and Kutner (1990) suggest inspecting the largest VIF as a
diagnostic for collinearity; a value greater than 10 is sometimes taken as
indicating a problematic degree of collinearity.

Menu path:    Model window, /Tests/Collinearity

# wls Estimation

Arguments:  wtvar depvar indepvars 
Options:    --vcv (print covariance matrix)
            --robust (robust standard errors)
            --quiet (suppress printing of results)

Computes weighted least squares (WLS) estimates using wtvar as the weight,
depvar as the dependent variable, and indepvars as the list of independent
variables. Let w denote the positive square root of wtvar; then WLS is
basically equivalent to an OLS regression of w * depvar on w * indepvars.
The R-squared, however, is calculated in a special manner, namely as

  R^2 = 1 - ESS / WTSS

where ESS is the error sum of squares (sum of squared residuals) from the
weighted regression and WTSS denotes the "weighted total sum of squares",
which equals the sum of squared residuals from a regression of the weighted
dependent variable on the weighted constant alone.

If wtvar is a dummy variable, WLS estimation is equivalent to eliminating
all observations with value zero for wtvar.

Menu path:    /Model/Other linear models/Weighted Least Squares

# xcorrgm Statistics

Arguments:  var1 var2 [ order ] 
Example:    xcorrgm x y 12

Prints and graphs the cross-correlogram for variables var1 and var2, which
may be specified by name or number. The values are the sample correlation
coefficients between the current value of var1 and successive leads and lags
of var2.

If an order value is specified the length of the cross-correlogram is
limited to at most that number of leads and lags, otherwise the length is
determined automatically, as a function of the frequency of the data and the
number of observations.

Menu path:    /View/Cross-correlogram
Other access: Main window pop-up menu (multiple selection)

# xtab Statistics

Arguments:  ylist [ ; xlist ] 
Options:    --row (display row percentages)
            --column (display column percentages)
            --zeros (display zero entries)
            --matrix=matname (use frequencies from named matrix)

Displays a contingency table or cross-tabulation for each combination of the
variables included in ylist; if a second list xlist is given, each variable
in ylist is cross-tabulated by row against each variable in xlist (by
column). Variables in these lists can be referenced by name or by number.
Note that all the variables must have been marked as discrete.
Alternatively, if the --matrix option is given, treat the named matrix as a
precomputed set of frequencies and display this as a cross-tabulation.

By default the cell entries are given as frequency counts. The --row and
--column options (which are mutually exclusive), replace the counts with the
percentages for each row or column, respectively. By default, cells with a
zero count are left blank; the --zeros option, which has the effect of
showing zero counts explicitly, may be useful for importing the table into
another program, such as a spreadsheet.

Pearson's chi-square test for independence is displayed if the expected
frequency under independence is at least 1.0e-7 for all cells. A common rule
of thumb for the validity of this statistic is that at least 80 percent of
cells should have expected frequencies of 5 or greater; if this criterion is
not met a warning is printed.

If the contingency table is 2 by 2, Fisher's Exact Test for independence is
computed. Note that this test is based on the assumption that the row and
column totals are fixed, which may or may not be appropriate depending on
how the data were generated. The left p-value should be used when the
alternative to independence is negative association (values tend to cluster
in the lower left and upper right cells); the right p-value should be used
if the alternative is positive association. The two-tailed p-value for this
test is calculated by method (b) in section 2.1 of Agresti (1992): it is the
sum of the probabilities of all possible tables having the given row and
column totals and having a probability less than or equal to that of the
observed table.