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 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.