[R] Help with factors

Serguei Kaniovski Serguei.Kaniovski at wifo.ac.at
Wed May 14 11:46:02 CEST 2008


Hallo All,

I have difficulties understanding how factors work in R. Suppose a have 
data in the panel form below. I would to compute a correlation coefficient 
(actually apply a different function of two time series) in the V variable 
between members of the two sexes in each city over time. How can this be 
done?

Thank you in advance,
Serguei

city, year, sex, V
1, 1975, 1, 25.3044
1, 1975, 0, 16.5711
1, 1976, 0, 16.6072
1, 1976, 1, 24.2841
1, 1977, 0, 14.8838
1, 1977, 1, 24.8124
1, 1978, 1, 23.0570
1, 1978, 0, 14.5627
1, 1979, 1, 21.2071
1, 1979, 0, 13.5277
2, 1975, 1, 62.4457
2, 1975, 0, 26.9745
2, 1976, 1, 67.3025
2, 1976, 0, 31.4600
2, 1977, 1, 53.0577
2, 1977, 0, 25.1941
2, 1978, 0, 23.3694
2, 1978, 1, 40.1452
2, 1979, 1, 44.5686
2, 1979, 0, 23.4042



More information about the R-help mailing list