Re: [R] Compute correlation matrix for panel data with specific ordering

2009-06-29 Thread John Kane
Have a look at str(df). Those values are being interpreted as factors not numbers. I don't think this is what you want. --- On Mon, 6/29/09, Serguei Kaniovski wrote: > From: Serguei Kaniovski > Subject: Re: [R] Compute correlation matrix for panel data with specific > or

Re: [R] Compute correlation matrix for panel data with specific ordering

2009-06-29 Thread Serguei Kaniovski
I apologize for not being specific enough in my previous posting. Assume you have panel data in the form: df <- data.frame( cbind( rep( c( "AUT" , "BEL" , "DEN" , "GER" ) , 4) , cbind( rep( c( 1999 , 2000 , 2001 , 2002 ) , 4 ) ), sample( 10 , 16 , replace=T) ) ) names(df) <- c( "country" , "y

Re: [R] Compute correlation matrix for panel data with, specific ordering

2009-06-29 Thread Dieter Menne
Serguei Kaniovski wifo.ac.at> writes: > Ok I see how to sort the factors, but how do I compute the correlation > matrix in a repeated observations dataset (see the first part of my > question) "Repeated" observations? You must be more specific then. Which function are you using (lme? Error()

Re: [R] Compute correlation matrix for panel data with, specific ordering

2009-06-28 Thread Serguei Kaniovski
Ok I see how to sort the factors, but how do I compute the correlation matrix in a repeated observations dataset (see the first part of my question) Thanks again for your help! Serge __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

Re: [R] Compute correlation matrix for panel data with specific ordering

2009-06-27 Thread Dieter Menne
Serguei Kaniovski wifo.ac.at> writes: > > df <- > data.frame(cbind(rep(c("AUT","BEL","DEN","GER"),4), cbind(rep(c(1999,2000,2001,2002),4)),sample(10,16,replace=T))) > names(df) <- c("country","year","x") > > SORT <- c("GER","BEL","DEN","AUT") > > I need to compute the correlation between cou

[R] Compute correlation matrix for panel data with specific ordering

2009-06-27 Thread Serguei Kaniovski
Hello All, I have a panel date - here a small-scale example: df <- data.frame(cbind(rep(c("AUT","BEL","DEN","GER"),4),cbind(rep(c(1999,2000,2001,2002),4)),sample(10,16,replace=T))) names(df) <- c("country","year","x") SORT <- c("GER","BEL","DEN","AUT") I need to compute the correlation betwe