Autocorrelation versus ordinary correlation for Gini coefficents and discussion topics? I have a data structure like this:
countryA: 2004, 2007, 2010,...
countryB: 1999, 2005, ....

I would like to compute the correlation between the increasing of the Gini coefficient and the percentage a certain topic is discussed in the public.
I do not think that my data is balanced. 
I know that most of the time people use time series cross-sectional models to compute a correlation between a Gini coefficient and a discussion topic. Yet, I have read some articles that make an appealing case for using multilevel regression models in such cases. 
I am applying in Stata the following command: 
xtmixed topicA gini || country:

Here are my questions:


*

*How should I check whether my data is autocorrelated and is there a way to account for autocorrelation in those multi level models?

*Does it make sense to check for autocorrelation when I have very few cases (total over all countries 126 and within countries between 3 and 10) when the time distance between the data points is kind of random?
 A: *

*Given the nature of your data, and the persistence of the GINI indicator over time, it is reasonable to expect the idiosyncratic error to have serial correlation.


You can test this manually with the following code:
xtmixed topicA gini || country: // runs the model
predict res if e(sample) , residuals // predict in-sample residuals
regress res L.res if country == x, robust // test AR(1) for country x (repeat for other countries, or use by())

You can try more elaborated structure of errors.
As you model is equivalent to a panel data model with two levels, you an also run your model using xtreg, re. In this case, take a look at the user-written comman xtserial. Also, look into xtregar command, integrated in Stata, where you can do both at once. The good thing of the latter is that you can test different lag structures.
My experience is that people do not worry to much about testing serial correlation. In xtmixed and the other commands I mention you have the option of adding vce(robust) or vce(cluter id), in which case the software will internally adjust any possible autocorrelation and heteroskedasticity. Personally, there is no much information obtained from knowing that your data has serial correlation. That is pretty common. So you just need to run robust estimators.


*The time pattern indicates your data is highly unbalanced. It still makes sense to account for serial correlation though. Some countries might have more balanced data than other and you don't want to manually decide which one to worry about.

