I am trying to link the volume sold on a service to the price of it. However, the timing differs as the service gets paid months in advance. Consequently, a lag is required.
However, as my data on volume starts on Januar 2005 (first row), I need price data from 2004 (e.g. October 2004 for price and January 2005 for volume in case of a 3 months time lag).
I am thinking about creating a new variable (call it 3mLag or so), where I simply move the pricing data by 3 lines (copy paste) while putting in the missing data for 2004.
Is there probably a faster way that may help as my procedure is only simple in case of a small number of lags to be implemented?
Related Posts with Efficient lags? Is copy and paste better?
Clean DataHello all, I have a paneldataset of 18 years and 505 companies and 25 variables (one of those is fi…
Question on tsfilterI am a beginner with tsfilter in stata and have strange behavior when trying. I have a dataset with …
question about categorizing variableHi. I'm beginer with STATA. I'm having a problem with categorizing variable. I wanted to categorize …
How to stop the loop from terminating due to missing variables?Hi Statalist, Please consider the following sample data: Code: * Example generated by -dataex-. To…
How to know the fractional polynomial used in twoway fpfitciGreetings Stata Users & experts, I'm currently reviewing some of the methods to graph relations…
Subscribe to:
Post Comments (Atom)
0 Response to Efficient lags? Is copy and paste better?
Post a Comment