Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Using the command "lncom" repeatedly with results from last lncom


From   Tor Øyvind Jakobsen <[email protected]>
To   [email protected]
Subject   st: Using the command "lncom" repeatedly with results from last lncom
Date   Sat, 19 May 2012 18:59:06 +0200

Dear Statalist!

I am using an asymmetric error correction model with the two following
steps (standard approach in the literature of gasoline markets and
asymmetric responses)

Step 1: Longrun equilibrium between retail price of gasoline and the
respective spot price:
reg pris produktpris
predict res, r
gen resmin1=l1.res
gen resmin1posdummy=resmin1>0 & resmin1<.
gen resmin1pos=resmin1posdummy*resmin1

Step 2: Dynamic specification
6 lags of spot price first differences (for increases, a dummy=1 for
increases, times first difference), and 6 lags of retail price first
differences (for increases, a dummy=1 for increases, times first
difference):

reg prisdiff0 produktprisdiff0 produktprisdiff1 ... produktprisdiff6
produktprisdiff0pos produktprisdiff1pos ... produktprisdiff6pos
prisdiff1 prisdiff2 ... prisdiff6 prisdiff1pos prisdiff2pos ...
prisdiff6pos resmin1 resmin1pos , noconstant

Now the tricky part: I would like to estimate the cumulative response
functions (CRF's) for increases and decreases in product price. D
(negative CRF's) explains the change in retail price for each period
after a negative shock in spot price. Corresponding interpretation of
I (positive CRF's). The command nlcom gives the expected value and
corresponding t-value for each CRF (not necessary to interpret the
combinations of variables below, just take them as given).

nlcom (D0: _b[produktprisdiff0])
nlcom (D1: _b[D0]+_b[produktprisdiff1]+_b[resmin1]*(_b[D0]-1)+_b[prisdiff1]*_b[D0])
nlcom (D2: _b[D1]+_b[produktprisdiff2]+_b[resmin1]*(_b[D1]-1)+_b[prisdiff1]*(_b[D1]-_b[D0])+_b[prisdiff2]*_b[D0])
nlcom (D3: _b[D2]+_b[produktprisdiff3]+_b[resmin1]*(_b[D2]-1)+_b[prisdiff1]*(_b[D2]-_b[D1])+_b[prisdiff2]*(_b[D1]-_b[D0])+_b[prisdiff3]*_b[D0])
nlcom (D4: _b[D3]+_b[produktprisdiff4]+_b[resmin1]*(_b[D3]-1)+_b[prisdiff1]*(_b[D3]-_b[D2])+_b[prisdiff2]*(_b[D2]-_b[D1])+_b[prisdiff3]*(_b[D1]-_b[D0])+_b[prisdiff4]*_b[D0])
nlcom (D5: _b[D4]+_b[produktprisdiff5]+_b[resmin1]*(_b[D4]-1)+_b[prisdiff1]*(_b[D4]-_b[D3])+_b[prisdiff2]*(_b[D3]-_b[D2])+_b[prisdiff3]*(_b[D2]-_b[D1])+_b[prisdiff4]*(_b[D1]-_b[D0])+_b[prisdiff5]*_b[D0])
nlcom (D6: _b[D5]+_b[produktprisdiff6]+_b[resmin1]*(_b[D5]-1)+_b[prisdiff1]*(_b[D5]-_b[D4])+_b[prisdiff2]*(_b[D4]-_b[D3])+_b[prisdiff3]*(_b[D3]-_b[D2])+_b[prisdiff4]*(_b[D2]-_b[D1])+_b[prisdiff5]*(_b[D1]-_b[D0])+_b[prisdiff6]*_b[D0])

nlcom (I0: (_b[produktprisdiff0]+_b[produktprisdiff0pos]))
nlcom (I1: _b[I0]+(_b[produktprisdiff1]+_b[produktprisdiff1pos])+_b[resmin1pos]*(_b[I0]-1)+(_b[prisdiff1]+_b[prisdiff1pos])*_b[I0])
nlcom (I2: _b[I1]+(_b[produktprisdiff2]+_b[produktprisdiff2pos])+_b[resmin1pos]*(_b[I1]-1)+(_b[prisdiff1]+_b[prisdiff1pos])*(_b[I1]-_b[I0])+(_b[prisdiff2]+_b[prisdiff2pos])*_b[I0])
nlcom (I3: _b[I2]+(_b[produktprisdiff3]+_b[produktprisdiff3pos])+_b[resmin1pos]*(_b[I2]-1)+(_b[prisdiff1]+_b[prisdiff1pos])*(_b[I2]-_b[I1])+(_b[prisdiff2]+_b[prisdiff2pos])*(_b[I1]-_b[I0])+(_b[prisdiff3]+_b[prisdiff3pos])*_b[I0])
nlcom (I4: _b[I3]+(_b[produktprisdiff4]+_b[produktprisdiff4pos])+_b[resmin1pos]*(_b[I3]-1)+(_b[prisdiff1]+_b[prisdiff1pos])*(_b[I3]-_b[I2])+(_b[prisdiff2]+_b[prisdiff2pos])*(_b[I2]-_b[I1])+(_b[prisdiff3]+_b[prisdiff3pos])*(_b[I1]-_b[I0])+(_b[prisdiff4]+_b[prisdiff4pos])*_b[I0])
nlcom (I5: _b[I4]+(_b[produktprisdiff5]+_b[produktprisdiff5pos])+_b[resmin1pos]*(_b[I4]-1)+(_b[prisdiff1]+_b[prisdiff1pos])*(_b[I4]-_b[I3])+(_b[prisdiff2]+_b[prisdiff2pos])*(_b[I3]-_b[I2])+(_b[prisdiff3]+_b[prisdiff3pos])*(_b[I2]-_b[I1])+(_b[prisdiff4]+_b[prisdiff4pos])*(_b[I1]-_b[I0])+(_b[prisdiff5]+_b[prisdiff5pos])*_b[I0])
nlcom (I6: _b[I5]+(_b[produktprisdiff6]+_b[produktprisdiff6pos])+_b[resmin1pos]*(_b[I5]-1)+(_b[prisdiff1]+_b[prisdiff1pos])*(_b[I5]-_b[I4])+(_b[prisdiff2]+_b[prisdiff2pos])*(_b[I4]-_b[I3])+(_b[prisdiff3]+_b[prisdiff3pos])*(_b[I3]-_b[I2])+(_b[prisdiff4]+_b[prisdiff4pos])*(_b[I2]-_b[I1])+(_b[prisdiff5]+_b[prisdiff5pos])*(_b[I1]-_b[I0])+(_b[prisdiff6]+_b[prisdiff6pos])*_b[I0])

I started out as following: Wrote ",post" after the D0 command. I then
calulated D1, but then Stata "forgot" all estimation results from step
2, and just "remembered" D0. An alternative solution is to to put D0
to D5 inside D6, and then calculate D6. I then got the error message
"expression too long r(130);". Because D6 is dependent on D0 to D5 it
is not easy to break up the expression in smaller parts. I have no
idea how to solve this problem.

Any solutions or even hints is greatly appreciated


Best regards,

Tor Jakobsen

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index