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: XTSET – by year or month or how?


From   Ivan Png <[email protected]>
To   [email protected]
Subject   st: XTSET – by year or month or how?
Date   Fri, 25 Mar 2011 06:48:27 +0800

Dear STATA-list:

Greetings.  Can you please assist me with advice on the below?

My research question: How do factors such as gasoline prices and age
of the car affect the cumulative mileage of a car over time?  I have
data from various car service shops.  Each record includes an
identifier of the car and the dates and cumulative mileage at each
service.  Cars go for service several times a year at different times.

I would like to investigate the research question using individual car
fixed effects to control for non-time-varying heterogeneity in cars.
My problem: How to organize the data-set?

(a) XTSET by car and year.  Using this approach, I must drop many
observations – in the case of a car that goes for service more than
once in a year, STATA thinks that the the multiple services in the
same year are duplicates.  So, with XTSET, I must drop the all but one
of the observations for that year.  This would imply dropping a
substantial part of the data.  Further, since the cars go for service
at different times in the year, treating each observation as an annual
observation would introduce noise.

(b) XTSET by car and month.  Using this approach, there would be many
missing observations.  In the case of a car that goes for service
twice a year, there would be ten missing months.

Please advise me how to set up the panel.




--
Skype: ipng00
T: +65 6516 6807

*
*   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