## Read the data: ## or = read.table('../../Data/symphony.txt', header=FALSE, skip=4, col.names=c('name', 'total', 'violin_m', 'violin f', 'viola m', 'viola_f', 'cello_m', 'cell_f', 'bass_m', 'bass_f')) ##print(or) no = dim(or)[1] F = c(or[, 4], or[, 6], or[, 8], or[, 10]) ## Female counts ##print(F) M = c(or[, 3], or[, 5], or[, 7], or[, 9]) ## Male counts ##print(M) inst = rep(c('violin', 'viola', 'cello', 'bass'), each=no) name = rep(or[, 1], 4) size = or[, 2] orch = data.frame(cbind(F, M, size, inst, name)) orch$size = as.numeric(as.character (orch$size)) ##print(orch) resp = cbind(orch$F, orch$M) ## ## Study if the proportion of women changes depending on the instrument type: ## inst = orch$inst print(inst) logit_model = glm(resp ~ inst, family=binomial()) print(summary(logit_model)) ## Study if the size is a useful covariate: ## logit_model = glm(resp ~ orch$size, family=binomial()) print(summary(logit_model)) ## Study if name is a useful covariate: ## logit_model = glm(resp ~ orch$name, family=binomial()) print(summary(logit_model))