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

______________________________________________
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.

Reply via email to