FOCUS AREAS

SAS/ETS Examples

Estimating a Consumption-Based Asset Pricing Model


Contents | Back to Example

SAS Program

/* Estimating a Consumption-Based Asset Pricing Model */

data harvey;
  input date gb cb d1 d10 conrat cinst rinst @@;
datalines;
1947.06    -0.00310     0.00062    -0.12675     0.01471     0.017045     0.016256    -0.003672
1947.09    -0.00869    -0.03633     0.06840    -0.01245    -0.001926    -0.025896    -0.040917
1947.12    -0.06751    -0.04553     0.00864     0.00978    -0.018072    -0.007701    -0.016500
1948.03    -0.00421     0.00344     0.03023    -0.02645    -0.001629     0.012736     0.002337
1948.06    -0.00054    -0.01422     0.13383     0.10463     0.005196    -0.012251    -0.025284
1948.09    -0.01100    -0.00777    -0.13444    -0.07535    -0.013959    -0.019869    -0.014344
1948.12     0.02108     0.03133    -0.04471     0.01529     0.005990     0.017017     0.019280
1949.03     0.03512     0.02262     0.05600     0.01774    -0.000507    -0.004825     0.012646
1949.06     0.03453     0.02916    -0.08463    -0.02076    -0.001652    -0.017189     0.001495
1949.09     0.02439     0.02685     0.15334     0.12509    -0.010370    -0.021049     0.002643
1949.12     0.01288    -0.00219     0.15341     0.10326     0.007154     0.013413     0.012539
1950.03     0.00412     0.01401     0.10568     0.04903     0.007602     0.003081     0.005577
1950.06     0.00012    -0.00297    -0.02531     0.03353     0.008199     0.000568    -0.008369
1950.09    -0.02880    -0.02188     0.19672     0.07448     0.012355     0.016397    -0.021693
1950.12    -0.02058    -0.01414     0.18876     0.05425    -0.024751    -0.026534    -0.019443
1951.03    -0.05680    -0.06523    -0.00792     0.00821     0.022376     0.032054    -0.027774
1951.06    -0.02572    -0.01824    -0.07057     0.00160    -0.014189    -0.011432    -0.000184
1951.09     0.01907     0.02967     0.09966     0.12430     0.017456     0.006295    -0.003804
1951.12    -0.02834    -0.02458    -0.03688     0.01377     0.007281     0.003242    -0.010054
1952.03     0.01200     0.01556     0.00826     0.03554    -0.010871    -0.001310     0.010150
1952.06     0.01396     0.00430    -0.03144     0.02550     0.017831     0.010140    -0.003623
1952.09    -0.02505     0.00280    -0.02234    -0.02243     0.010027     0.005749    -0.002916
1952.12     0.00122     0.00222     0.03878     0.08756     0.007760     0.011063     0.004095
1953.03    -0.00980    -0.00875     0.07306    -0.02292     0.006283     0.004730     0.009921
1953.06    -0.00012    -0.01388    -0.04422    -0.02836    -0.001886    -0.012611    -0.002333
1953.09     0.02980     0.03118    -0.08326    -0.01555    -0.010181    -0.013068    -0.001474
1953.12     0.02649     0.03610     0.02195     0.08595    -0.003896    -0.004705     0.005798
1954.03     0.03571     0.03306     0.13233     0.10428     0.002750     0.006060     0.002582
1954.06     0.01453    -0.00461     0.05120     0.08997    -0.007105    -0.006309    -0.000495
1954.09     0.01213     0.01315     0.15268     0.09571     0.009991     0.010435     0.005614
1954.12     0.01118     0.01490     0.22346     0.13046     0.011793     0.008902     0.005919
1955.03    -0.02331    -0.00689     0.09789     0.02777     0.003299     0.003299     0.002653
1955.06    -0.00030     0.00099     0.05084     0.13764     0.012257     0.012257     0.003454
1955.09    -0.00261    -0.00034     0.03842     0.03710     0.004449    -0.000542    -0.000784
1955.12     0.01691     0.01447     0.04720     0.06286     0.015555     0.013451     0.006584
1956.03    -0.01022    -0.00507     0.04605     0.08192     0.005879     0.009222     0.005640
1956.06     0.00377    -0.01790    -0.04364    -0.01998    -0.007540    -0.009995    -0.006211
1956.09    -0.04686    -0.04132    -0.03898    -0.05182    -0.005589     0.000081    -0.001690
1956.12    -0.02882    -0.03098    -0.00469     0.04717     0.002977    -0.005512    -0.001610
1957.03     0.02472     0.02438     0.00627    -0.04826    -0.000057     0.002379     0.000128
1957.06    -0.04810    -0.05188     0.05203     0.08732     0.000084    -0.005444    -0.004448
1957.09    -0.00585    -0.01194    -0.08196    -0.10327     0.009562     0.012004     0.000940
1957.12     0.07673     0.10079    -0.13546    -0.06090    -0.007921    -0.008297     0.004527
1958.03    -0.00392    -0.01110     0.15404     0.03423    -0.014712    -0.013120    -0.009033
1958.06     0.00245     0.01558     0.14382     0.08049     0.004008     0.000534    -0.001265
1958.09    -0.07819    -0.05303     0.16860     0.11633     0.012819     0.009684     0.003025
1958.12     0.01066     0.01855     0.14914     0.11626     0.007088     0.003961     0.005177
1959.03    -0.00403    -0.00789     0.12125    -0.00003     0.004745     0.014135     0.006123
1959.06    -0.01424    -0.02713     0.00503     0.06836     0.000986    -0.002825    -0.000273
1959.09    -0.00688    -0.00983    -0.01857    -0.01785     0.001246    -0.000253     0.002893
1959.12    -0.01897     0.01411     0.01318     0.05659     0.000452     0.003158     0.005507
1960.03     0.06415     0.04638    -0.01324    -0.06939    -0.004959    -0.007994     0.009680
1960.06     0.00592     0.00056    -0.01960     0.02820     0.007836     0.009056    -0.000863
1960.09     0.03438     0.02805    -0.04136    -0.05700    -0.010240    -0.008358     0.003441
1960.12     0.01212    -0.00190    -0.01936     0.08797    -0.003503    -0.003094    -0.000590
1961.03    -0.00070     0.02694     0.22991     0.11198    -0.000125     0.005880     0.005354
1961.06     0.00534    -0.00879     0.01088     0.00720     0.006963    -0.000168     0.004419
1961.09     0.00654     0.01056    -0.04240     0.03803    -0.006576    -0.006168    -0.000666
1961.12    -0.01040     0.00988     0.06276     0.07988     0.008993     0.012005     0.005276
1962.03     0.03443     0.02854     0.06937    -0.02968     0.006227     0.001769     0.002020
1962.06    -0.00079     0.00558    -0.23689    -0.21368    -0.001104     0.002621     0.004397
1962.09     0.01075     0.01878     0.04032     0.03830     0.005121     0.000356    -0.000644
1962.12     0.01106     0.01239     0.07036     0.13304     0.004379     0.009555     0.009086
1963.03     0.00151     0.01083     0.11793     0.05855     0.002153    -0.001140     0.003776
1963.06    -0.00287    -0.00190     0.05289     0.04206    -0.003604    -0.002115     0.002846
1963.09    -0.00016    -0.00184     0.01531     0.04021     0.003533     0.005018     0.003534
1963.12    -0.00105     0.00008    -0.03447     0.05549    -0.002502    -0.003929     0.004210
1964.03    -0.00454     0.00205     0.12779     0.05485     0.014060     0.018837     0.007646
1964.06     0.01669     0.01457     0.00320     0.04335     0.015608     0.012327     0.005300
1964.09     0.00772     0.01104     0.10436     0.03178     0.015460     0.012190     0.005387
1964.12     0.00613     0.01053     0.00007     0.01457    -0.000639    -0.002043     0.004658
1965.03     0.00790     0.00732     0.12246     0.00901     0.007197     0.009014     0.008350
1965.06    -0.00125    -0.00975    -0.04011    -0.02020     0.006460     0.007245    -0.000933
1965.09    -0.00530    -0.00303     0.11151     0.06473     0.012574     0.014372     0.008494
1965.12    -0.01958    -0.02428     0.18202     0.00753     0.026211     0.028399     0.003639
1966.03    -0.02025    -0.02858     0.07050    -0.05241     0.002302     0.006842     0.001699
1966.06    -0.02184    -0.00654    -0.09246    -0.04678     0.006462     0.006442     0.003013
1966.09     0.00268    -0.03322    -0.14419    -0.08527     0.005737     0.000940     0.001380
1966.12     0.04074     0.03616     0.00206     0.04834    -0.006681    -0.003639     0.007445
1967.03     0.00992     0.03318     0.33282     0.11698     0.005932     0.005592     0.008758
1967.06    -0.06560    -0.05644     0.12409     0.00206     0.002384    -0.002978     0.001172
1967.09    -0.01274     0.00205     0.17652     0.05462    -0.003489    -0.002776    -0.000529
1967.12    -0.04837    -0.05011     0.09710     0.00376     0.004104     0.003150     0.001907
1968.03    -0.00295     0.00880     0.00142    -0.07028     0.017510     0.016246    -0.000046
1968.06     0.03714     0.00716     0.26956     0.08467     0.006235     0.007609     0.001370
1968.09     0.00770     0.03910     0.14060     0.01818     0.012934     0.012665     0.002701
1968.12    -0.08627    -0.07248     0.07007    -0.00206    -0.004302    -0.003922     0.000564
1969.03    -0.02285    -0.02961    -0.08379    -0.01412     0.007385    -0.000040    -0.000444
1969.06    -0.00217    -0.00140    -0.10410    -0.03214     0.002187     0.001457    -0.000374
1969.09    -0.06598    -0.04005    -0.08429    -0.05267    -0.000393     0.000696     0.002955
1969.12    -0.00528    -0.05708    -0.07087    -0.00432     0.003184    -0.002328     0.002334
1970.03     0.03681     0.03755     0.00834    -0.03984     0.008653     0.006512     0.003810
1970.06    -0.05304    -0.05205    -0.30498    -0.18259    -0.001065    -0.004846     0.000481
1970.09     0.04606     0.07342     0.25299     0.15179     0.003937     0.000681     0.005647
1970.12     0.04624     0.07471     0.01139     0.09243     0.001995     0.000056    -0.000167
1971.03     0.08531     0.03844     0.33826     0.08829    -0.000532    -0.004083     0.004250
1971.06    -0.05517    -0.04007    -0.08902    -0.01069    -0.000426    -0.003084    -0.004668
1971.09     0.05952     0.03032    -0.04535    -0.01675    -0.006132    -0.000595     0.006623
1971.12     0.00734     0.04479    -0.01141     0.04631     0.001352     0.002966     0.003736
1972.03    -0.01459     0.00087     0.12046     0.04967     0.006413     0.008009     0.000792
1972.06     0.01643     0.00626    -0.06650     0.01167     0.019733     0.018274     0.000783
1972.09     0.00716     0.00454    -0.05424     0.04306     0.010332     0.009503    -0.000175
1972.12     0.01158     0.02371     0.00415     0.06831     0.014920     0.017086     0.002734
1973.03    -0.04338    -0.01971    -0.12833    -0.05420     0.006098     0.007940    -0.006378
1973.06    -0.03843    -0.03394    -0.18760    -0.07389    -0.012396    -0.001215    -0.004431
1973.09    -0.00078    -0.00498     0.13917     0.00427     0.002949     0.006003    -0.002997
1973.12    -0.03974    -0.04204    -0.24000    -0.11530    -0.009832     0.003385    -0.003471
1974.03    -0.09018    -0.08585     0.15989    -0.09603    -0.023372    -0.002152    -0.014961
1974.06    -0.03693    -0.07858    -0.18882    -0.09556    -0.001475     0.000991    -0.005168
1974.09    -0.02440    -0.05252    -0.20138    -0.27899     0.004667    -0.004777    -0.011096
1974.12     0.07431     0.06898    -0.10187     0.07954    -0.011869    -0.013738    -0.006708
1975.03    -0.00520     0.03362     0.73524     0.17903     0.002460     0.000555    -0.001053
1975.06     0.02000     0.02396     0.16372     0.13649     0.013846     0.007791    -0.004783
1975.09    -0.04861    -0.05611    -0.18364    -0.13697     0.000101     0.006023    -0.003620
1975.12     0.06119     0.07667    -0.00409     0.06415    -0.000154    -0.002154    -0.001900
1976.03     0.03204     0.04213     0.47937     0.13412     0.019369     0.012066     0.004868
1976.06     0.00327    -0.00013    -0.04809     0.02137     0.010445    -0.001846    -0.003137
1976.09     0.03260     0.04414    -0.03203     0.01382     0.007481     0.003868    -0.001387
1976.12     0.06664     0.06519     0.12953     0.00808     0.010936     0.010461     0.002267
1977.03    -0.04782    -0.03656     0.00940    -0.09099     0.007429    -0.000890    -0.011212
1977.06     0.01614     0.01836     0.05949     0.00840    -0.004434    -0.004780    -0.008531
1977.09    -0.00085     0.00038    -0.02152    -0.03666    -0.001423    -0.003024     0.000862
1977.12    -0.02959    -0.02130     0.06669    -0.02037     0.014413     0.016339     0.003416
1978.03    -0.02108    -0.01123     0.13073    -0.07017     0.004146    -0.003388    -0.004406
1978.06    -0.04170    -0.03994     0.10078     0.04848     0.001976     0.002780    -0.013233
1978.09     0.00433     0.00984     0.14379     0.05894     0.002934     0.004490    -0.001988
1978.12    -0.03160    -0.03776    -0.22909    -0.04716     0.013965     0.012743     0.002648
1979.03    -0.00765    -0.01064     0.20627     0.02834    -0.002654    -0.006105    -0.006977
1979.06     0.01019     0.00910     0.06064    -0.01476    -0.007861    -0.005938    -0.008765
1979.09    -0.05515    -0.05152     0.04940     0.03263     0.002032     0.001270    -0.009649
1979.12    -0.07449    -0.10201    -0.04863    -0.02349     0.004997     0.001777    -0.000705
1980.03    -0.17179    -0.16225    -0.18308    -0.05320    -0.008297    -0.018495    -0.013333
1980.06     0.21403     0.22104     0.13223     0.09400    -0.012014    -0.019827    -0.005361
1980.09    -0.13235    -0.13020     0.19048     0.07628    -0.004471     0.001494     0.002721
1980.12    -0.00725    -0.01303    -0.01142     0.08201    -0.000733    -0.001852     0.005713
1981.03    -0.04473    -0.03782     0.12274    -0.05115     0.000087     0.002181     0.007384
1981.06    -0.02332    -0.03471     0.05666    -0.04801    -0.000845    -0.011372     0.012521
1981.09    -0.09650    -0.10316    -0.14824    -0.10428    -0.002621    -0.020134     0.008383
1981.12     0.13701     0.11890     0.08098     0.05485    -0.002025    -0.000683     0.023733
1982.03     0.03842     0.02778    -0.03892    -0.08530    -0.003576    -0.001152     0.021436
1982.06     0.01645     0.02342    -0.00282    -0.00426     0.002945    -0.021955     0.005152
1982.09     0.18746     0.20003     0.10171     0.09437     0.003094     0.005870     0.014000
1982.12     0.09094     0.10981     0.27496     0.15940     0.004864     0.012974     0.022240
1983.03     0.01154     0.04119     0.23687     0.10018     0.007603     0.000192     0.016027
1983.06    -0.01398     0.00049     0.22292     0.08739     0.009716     0.006639     0.004756
1983.09    -0.00567    -0.00963    -0.02387    -0.00268     0.010550     0.005017     0.010256
1983.12    -0.00550    -0.00582     0.00377     0.00032     0.005590     0.004830     0.016350
1984.03    -0.02102    -0.02505    -0.00744    -0.02724     0.000061    -0.000809     0.009529
1984.06    -0.05101    -0.04940    -0.06995    -0.02085     0.014589     0.007334     0.012492
1984.09     0.13030     0.12849     0.03379     0.09004    -0.000892    -0.008251     0.012902
1984.12     0.07118     0.08444    -0.06136     0.00719    -0.000622     0.001892     0.020656
1985.03     0.01070     0.01492     0.17053     0.08108     0.006300     0.000589     0.007984
1985.06     0.12020     0.11404     0.00595     0.05970     0.003548     0.002934     0.008407
1985.09     0.00259     0.01425    -0.01522    -0.04174     0.005585     0.001557     0.011002
1985.12     0.12296     0.11104     0.14416     0.16117     0.007026     0.007373     0.010167
1986.03     0.20729     0.11693     0.12310     0.14037     0.011952     0.007884     0.021302
1986.06     0.01226     0.01990     0.01523     0.07580     0.009786    -0.009103     0.009583
1986.09    -0.02073     0.01133    -0.09401    -0.07461    -0.001967    -0.001463     0.007306
1986.12     0.04848     0.04897     0.02106     0.04778     0.001825     0.004692     0.010726
1987.03    -0.00478     0.00003     0.17421     0.18540     0.003077     0.007087    -0.001250
1987.06    -0.06592    -0.05850     0.03540     0.03122    -0.002387     0.004138     0.000566
1987.09    -0.07786    -0.06902     0.06747     0.05374    -0.000190    -0.003850     0.001210
1987.12     0.07621     0.07874    -0.33453    -0.22612    -0.004024    -0.000738     0.009586
;
run;

title 'Consumption-Based Asset Pricing Model';

proc model data=harvey;

   endogenous conrat;
   exogenous gb cb d1 d10 ;
   parms beta 1.0 alpha 1.0;

/* set up lags for use as instruments */
   lc1 = lag(cinst);
   lc2 = lag2(cinst);
   lc3 = lag3(cinst);
   lc4 = lag4(cinst);
   ltb1 = lag(rinst);
   ltb2 = lag2(rinst);
   ltb3 = lag3(rinst);
   ltb4 = lag4(rinst);

/* moment conditions */
   eq.h1 = beta * (1+conrat)**(-alpha) * (1+gb) - 1 ;
   eq.h2 = beta * (1+conrat)**(-alpha) * (1+cb) - 1 ;
   eq.h3 = beta * (1+conrat)**(-alpha) * (1+d1) - 1 ;
   eq.h4 = beta * (1+conrat)**(-alpha) * (1+d10) - 1 ;

   fit h1-h4 / itgmm kernel=(parzen,1,0);
   instruments lc1-lc4 ltb1-ltb4 ;

run;
quit;


proc gplot data=harvey;
   plot conrat*date / cframe=ligr;
   title 'Consumption Ratio';
   symbol1 c=blue value=star;
run;
quit;