[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: Newey west
"Nick Cox" <email@example.com>
RE: st: Newey west
Wed, 10 Dec 2008 17:44:22 -0000
I don't see how your rephrasing is consistent with your previous statement about months being missing from the data.
A non-standard date variable can be coped with by mapping to standard Stata date before attempting to -tsset-. That is better practice than using -egen, group()- because interpretation of results will be easier.
Let me rephrase then. Say my date is numerical, and indicates year and
month in the form yyyymo. Then the last two digits of this number
ranges from 1 to 12. This causes the tsset to choke. That's when I use
my trick. Sorry for the confusion.
Nick Cox wrote:
> This is more than just a computational trick. It amounts to saying that all time steps between data points are to be treated as equal. Whether the context is environment, economy, society, medicine or astrology, that is going to be _wrong_ to a greater or lesser extent.
> Thus to put it very simply times 1, 3, 4 (say) are mapped to 1, 2, 3 and the time step of 2 is to be treated as exactly equivalent to the time step of 1. That is what your trick implies.
> I've had this problem when I have panel data of firms over time (say
> monthly data), and there is one month missing from the sample. I get
> around the problem in the following manner. Say the firm variable is
> "firm" and the monthly time variable is "date". Then:
> egen date_count=group(date)
> tsset firm date_count
> This creates a continuous variable for the date with no skips. Keep in
> mind I'm a novice myself, so there may be a better way, but this works
> for me.
>> I am trying to use the command -newey- using panel data and I include fixed effects. However this does not work (Stata tells me that my year variable is not regularly spaced).
>> Any suggestions? What does the error message mean? My sample is however balanced over time so I have the same number of observations in each year.
* For searches and help try: