Re: [R] pattern of panel waves using R

From: Sebastián Daza <sebastian.daza_at_gmail.com>
Date: Fri, 18 Mar 2011 23:08:42 -0500

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_at_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. Received on Sat 19 Mar 2011 - 04:13:38 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 19 Mar 2011 - 05:00:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive