FOCUS AREAS

SAS/ETS Examples

A Specification Test for Non-Nested Regression Models


Contents | Back to Example



SAS Program



/* A Specification Test for Non-Nested Models */

 data spec;
   input yr qr c y w;
     c_lag=lag(c);
     date = yyq( yr, qr );
     format date yyqc.;
 datalines;
1954 2  253  270  0
1954 3  257  274  17
1954 4  262  279  34
1955 1  268  282  51
1955 2  273  289  66
1955 3  276  294  82
1955 4  280  299  100
1956 1  280  300  118
1956 2  280  302  138
1956 3  281  303  160
1956 4  285  308  182
1957 1  287  308  205
1957 2  287  309  226
1957 3  289  311  249
1957 4  290  310  271
1958 1  286  307  291
1958 2  288  308  312
1958 3  292  315  333
1958 4  295  319  356
1959 1  302  323  380
1959 2  307  328  401
1959 3  310  326  422
1959 4  310  328  437
1960 1  314  332  455
1960 2  318  334  473
1960 3  316  334  489
1960 4  316  332  507
1961 1  316  334  522
1961 2  320  340  540
1961 3  324  345  559
1961 4  330  352  581
1962 1  333  355  603
1962 2  336  359  624
1962 3  340  360  647
1962 4  345  363  667
1963 1  349  367  685
1963 2  351  369  703
1963 3  356  374  721
1963 4  358  379  739
1964 1  366  387  760
1964 2  371  397  781
1964 3  379  402  807
1964 4  379  407  830
1965 1  388  411  858
1965 2  393  416  881
1965 3  400  430  904
1965 4  409  438  933
1966 1  415  442  962
1966 2  415  443  989
1966 3  421  450  1017
1966 4  421  454  1045
1967 1  424  459  1079
1967 2  430  463  1114
1967 3  432  468  1147
1967 4  434  472  1183
1968 1  445  480  1220
1968 2  448  486  1255
1968 3  458  488  1293
1968 4  460  491  1323
1969 1  466  492  1354
1969 2  469  496  1381
1969 3  470  504  1408
1969 4  472  508  1442
1970 1  474  511  1478
1970 2  478  522  1514
1970 3  481  528  1559
1970 4  478  524  1605
1971 1  490  535  1652
1971 2  494  541  1697
1971 3  498  542  1744
1971 4  504  547  1789
1972 1  513  552  1832
1972 2  523  559  1871
1972 3  531  567  1906
1972 4  542  584  1942
1973 1  553  599  1984
1973 2  554  602  2030
1973 3  555  605  2078
1973 4  546  606  2128
1974 1  540  594  2187
1974 2  543  587  2242
1974 3  547  587  2286
;
run;

proc autoreg data=spec ;
   model c = y w;
   output out=model1 p=chat1;
   model c = y c_lag;
   output out=model2 p=chat2;
run;

data spec2;
   set spec ;
   set model1;
   set model2;
run;

proc autoreg data=spec2;
   model c = y c_lag chat1;
   model c = y w chat2;
run;
quit;

proc gplot data=spec;
   plot y*date c*date / overlay cframe=ligr
                        haxis=axis1 vaxis=axis2;
   title 'Time-Series Plots';
   title2 'Income and Consumption';
   footnote1 c=blue ' --- Income'
             c=red  '  --- Consumption';
   symbol1 c=blue i=join v=star;
   symbol2 c=red  i=join v=circle;
   axis1 label=none;
   axis2 label=none;
run;
quit;