[R] pattern of panel waves using R

Sebastián Daza sebastian.daza at gmail.com
Sat Mar 19 05:08:42 CET 2011


Finally, I solved my problem using the following procedure and a 
database called ej

ej$a <- 1

head(ej)

    ano nunico a
1 2008      1 1
2 2009      1 1
3 2008      2 1
4 2009      2 1
5 2008      3 1
6 2009      3 1

library(reshape)
dej <- cast(ej, nunico ~ ano, sum, margins = FALSE)

head(dej)

   nunico 2008 2009 2010
1      1    1    1    0
2      2    1    1    0
3      3    1    1    0
4      4    1    1    1
5      5    1    0    1
6      6    1    1    1

dej[dej==0] <- NA

library(Hmisc)
na.pattern(dej[,c(2:4)])


pattern
  000  001  010  011  110
3385 1073  203  338  573

That way I can review the pattern of my panel data.

Sebastian



More information about the R-help mailing list