Skip to content
Prev 7931 / 398503 Next

Aggregate

Thank you to everyone involved in the R-project!
with dichotomous variables. There are 11 variables (columns) and around
1000 subjects (rows).  How do I aggregate my data, i.e. how do I make a
new dataset that includes the variable giving  the counts for rows with
the same configuration of responses? I know this is possible using the
package 'cfa' (configural frequency analysis, a contributed package in
R) but I can't coerce the output from the cfa command into a data
frame.

I'm not fully sure I understand.  You have a data frame, one row per
subject with 11 columns?  What's the response here?  If one of the
columns is the response (and it is dichotomous) then you can just use
logistic regression without any transformation.  To do a log-linear
analysis using a few of the variables as a joint response you can use
multinom from package nnet on the original data, and it will summarize
the data as you request en route.  To use loglin all you need to do is
use table on the data frame

do.call("table", dataset)

*BUT* I am not sure that is at all appropriate as an analysis.