# Analyzing unbalanced panel / Autocorrelation

**URL:** <https://discourse.julialang.org/t/analyzing-unbalanced-panel-autocorrelation/29407>\
**Category:** General Usage\
**Created:** [October 2, 2019, 1:23pm UTC](https://discourse.julialang.org/t/analyzing-unbalanced-panel-autocorrelation/29407 "2019-10-02T13:23:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dom-DC](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@Dom-DC](https://discourse.julialang.org/u/Dom-DC)\
**Post date:** [October 2, 2019, 1:23pm UTC](https://discourse.julialang.org/t/analyzing-unbalanced-panel-autocorrelation/29407/1 "2019-10-02T13:23:32Z")

</div>

Hi,  
I have a DataFrame containing an unbalanced panel data set with individual-year observations characterized by an :id and :year. I would like to compute the autocorrelation of variable X at the individual :id level but so far could not figure out a way to do it.  
For those familiar with Stata, what I’d like to do is something like:  
tsset id year  
cor X L.X

Any tips are appreciated!
