Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: How to test heterokedasticity for 120 periods

 From Nick Cox To statalist@hsphsun2.harvard.edu Subject Re: st: How to test heterokedasticity for 120 periods Date Wed, 20 Feb 2013 10:02:08 +0000

```Like Roberto, I don't know why you are doing this, but I do wonder
what the strategy is here.

Roberto sketches out code for what you ask, but what are you going to
with all the test results?

1. With 120 tests, some fraction is going to show up as significant at
conventional levels, even if the null is always right. This problem is
widely discussed under various headings, one of which is multiplicity.

2. If  some tests come out significant and the rest not, what do you
intend to do?

3. Even if cross-sectional regressions make sense, the pattern of
results over time has to make sense too.

4. Heteroscedasticity could mean different things, most obviously
outliers as well as more systematic inconstancy of variance. The test
results are going to be silent on why it occurs.

I'd -collapse- the data to period, mean of response and variance of
response, look at that as time series and as a scatter plot. It might
well be that such exploration exposes the need for some transformation
or link function and that side-steps all that *scedasticity stuff.
Most simply, it may even be that working on a logarithmic scale makes
more sense. Of course, you could be in a field that regards looking at
the data as strange or suspect.

Nick

On Wed, Feb 20, 2013 at 7:57 AM, Roberto Liebscher
<roberto.liebscher@ku.de> wrote:

> although I do not know exactly but why are you testing for
> heteroskedasticity for each period separately (Is it appropriate in your
> case to estimate your model for each period subsample separately?) you could
> loop over the regressions using a command like this
>
> forval i = num1/num2 {
> quietly reg depvar indepvar if period == `i'
> quietly estat hettest
> display "Period " "`i'"
> display `r(p)'
> }
>
> If you want to conduct an ANOVA for the period groups this link might be
> http://www.stata.com/capabilities/anova-ancova/

Xixi Lin [edited]

>> I am trying to test test heteroskedasticity for 120 periods. I randomly
>> tested for 3 periods, using White tests, and the result shows it is
>> homoskedasticity. But I want to make sure that all 120 periods show
>> homoskedasticity. Does anyone knows how to write a loop to test it? As
>> a result, I hope it tells me which period or if any periods are not
>> homoskedastic.
*
*   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/
```