### Install the package catnet aand plyr, if prompted just select 0-cloud install.packages("plyr") library(plyr) install.packages("catnet") library(catnet) install.packages("bnlearn") library(bnlearn) ###Read the simulated data data=read.csv("simulated bundled data.csv") #### Prepare counts of the various combinations of variables datacounts=ddply(data,(1:13),nrow) ### Finally, lets do a log-linear regression using the counts column as output ### and lets include all pairwise interactions model=glm(datacounts[,14]~.*.,data=datacounts[,(1:13)],family=poisson) ### Now look into the model summary(model) ### Check to see whether what you got is correct