Skip to content

detecting autocorrelation structure in panel data

2 messages · Matteo Richiardi, Liviu Andronic

#
Hello,
I'm a newby in R. I have created a data.frame holding panel data, with
the following columns: "id","time","y", say:

periods = 100
numcases = 100
df = data.frame(
 id = rep(1:numcases,periods),
 time = rep(1:periods, each = numcases)
)
df = transform(df,y=c(rnorm(numcases*periods)+id)

I want to check whether "y" is autocorrelated. I came across the acf()
function, but I cannot understand how to specify that my time variable
is "time" and that individuals are identified by their "id". I have
also tried to convert my data.frame in a ts or a xts object, but got
really lost there. I'd really apreciate help...

Thank you,
Matteo
#
On Mon, Nov 28, 2011 at 3:54 AM, Matteo Richiardi
<matteo.richiardi at gmail.com> wrote:
Take a look at the 'plm' package and its vignette.

Regards
Liviu