Skip to content
Prev 105827 / 398506 Next

Count cases by indicator

Dear Serguei and Andy,

I was away for a few days so I appologize for this late reply. I cannot help 
but noticing Serguei's problem is somewhat suited to the QCA package.
For example, the 2^k combinations can be created simply with:

library(QCA)
cmat <- createMatrix(9)


As to the problem itself, the solution would be:

m <- as.data.frame(matrix(df$x, ncol=9, byrow=TRUE))
rownames(m) <- levels(df$case)
m$OUT <- 0
truthTable(m, outcome="OUT", show.cases=TRUE)

The result seconds Andy's result.

If Serguei wants the entire matrix, then use the "inside" argument:
truthTable(df, outcome="OUT", inside=TRUE)

I hope it helps,
Adrian
On Monday 04 December 2006 15:24, Liaw, Andy wrote: