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]

re: st: How can I fill in missing values for the month or quarter in this


From   Christopher Baum <[email protected]>
To   "[email protected]" <[email protected]>
Subject   re: st: How can I fill in missing values for the month or quarter in this
Date   Wed, 14 Nov 2012 20:02:29 +0000

<>
clear all
input year str8 state quarter expenditure
1998   Illinois         1       1000
1998   Illinois         3       3000
1998   Illinois         4       4000
1998   Illinois         2       2000
2000   Illinois         1       5000
2000   Illinois         4      11000
2000   Illinois         2       6000
2000   Illinois         3       8000
2001   Illinois         2       1575
2002   Illinois         4       5600
1998   Missouri         3       2100
1998   Missouri         4       2100
1998   Missouri         1       1900
1998   Missouri         2       1900
2000   Missouri         1       8500
2001   Missouri         1       8000
2001   Missouri         2       9800
2001   Missouri         3       7500
2001   Missouri         4       1800
2002   Missouri         3       1400
end
g yq = yq(year, quarter)
encode state, gen(stateid)
tsset stateid yq, quarterly
tsfill
l

Kit Baum   |   Boston College Economics and DIW Berlin   |   http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming   |   http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata   |   http://www.stata-press.com/books/imeus.html


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


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