Skip to content
Prev 178345 / 398506 Next

omit empty cells in crosstab?

On Fri, 2009-04-24 at 13:12 -0700, sjaffe wrote:
Hi Steve

In your only 3 cells > 0
b.1
b        (0,1] (1,2] (2,3] (3,4] (4,5] (5,6] (6,7] (7,8] (8,9] (9,10]
  (0,1]      0     0     0     0     0     0     0     0     0      0
  (1,2]      0     1     0     0     0     0     0     0     0      0
  (2,3]      0     0     1     0     0     0     0     0     0      0
  (3,4]      0     0     0     0     0     0     0     0     0      0
  (4,5]      0     0     0     0     0     0     0     0     0      0
  (5,6]      0     0     0     0     0     0     0     0     0      0
  (6,7]      0     0     0     0     0     0     0     0     0      0
  (7,8]      0     0     0     0     0     0     0     0     0      0
  (8,9]      0     0     0     0     0     0     0     0     0      0
  (9,10]     0     0     0     0     0     0     0     0     0      1

If you desire use simple code to find only cell>0 use this

 table(interaction(c,drop=T))

  (1,2].(1,2]   (2,3].(2,3] (9,10].(9,10] 
            1             1             1