Thank you very much for your help. Your help was very useful for me.
-
Login or Register
- Log in with
* Example generated by -dataex-. To install: ssc install dataex clear input int year long(pci_boston pci_newyork) 2001 64362 61332 2002 64223 61063 2003 65655 61044 2004 67421 62733 2005 68926 65390 2006 70115 67357 2007 71990 68173 2008 71445 65854 2009 69411 65627 2010 71696 67563 2011 72643 67187 2012 73815 68723 2013 72518 68421 2014 73595 69105 2015 74545 69971 end // CREATE AN OBSERVATION FOR 2016 isid year expand 2 if year == 2015 by year, sort: replace year = 2016 if _n == 2 replace pci_boston = . if year == 2016 replace pci_newyork = . if year == 2016 // NOW EXPAND DATA TO QUARTERLY expand 4 by year, sort: gen month = 3*_n gen quarterly_date = qofd(mdy(month, 1, year)) format quarterly_date %tq // REPLACE VALUES FOR QUARTERS OTHER THAN 2 WITH // MISSING replace pci_boston = . if inlist(month, 3, 9, 12) replace pci_newyork = . if inlist(month, 3, 9, 12) // INTERPOLATE/EXTRAPOLATE ipolate pci_boston quarterly_date, epolate generate(pci_boston_ep) ipolate pci_newyork quarterly_date, epolate generate(pci_newyork_ep)
Comment