########################################################### # Set up graphics output: par(ask=T) # on the screen #png(filename="ParticipationProject%d.png", width=700, height=700) # In a series of files ########################################################### # Read in current version of Participation Project spreadsheet PPcsv = "ParticipationProject11082014.csv" PP = read.csv(PPcsv) ########################################################### # Set up column names for convenient reference: colnames(PP) = c("Class", "Date", "Recorder", "Males", "Females", "Instructor", "Topic", "FComments", "FQuestions", "MComments", "MQuestions") # ########################################################### # Extract various vectors for more convenient reference: Females = PP[,"Females"]; Males = PP[,"Males"] FComments = PP[,"FComments"]; MComments = PP[,"MComments"] FQuestions = PP[,"FQuestions"]; MQuestions = PP[,"MQuestions"] FInterventions = FComments+FQuestions; MInterventions = MComments+MQuestions ############################################################## # Selectively remove rows with no comments or no questions or no interventions -- to avoid division by zero # in computing "proportion of female comments/question/interventiona Cnon0 = (FComments+MComments > 0); Cnon0[39] = FALSE Qnon0 = (FQuestions+MQuestions > 0); Qnon0[39] = FALSE Inon0 = (FComments+MComments + FQuestions+MQuestions > 0); Inon0[39] = FALSE ############################################################# # Calculate class sizes relative to the minimum and maximum QSize = (Females+Males)[Qnon0]; CSize = (Females+Males)[Cnon0]; ISize = (Females+Males)[Inon0] QMinSize = min(QSize); QMaxSize = max(QSize); QPSize = (QSize-QMinSize)/(QMaxSize-QMinSize); CMinSize = min(CSize); CMaxSize = max(CSize); CPSize = (CSize-CMinSize)/(CMaxSize-CMinSize); IMinSize = min(ISize); IMaxSize = max(ISize); IPSize = (ISize-IMinSize)/(IMaxSize-IMinSize); ######################################################### # Calculate overall proportions: PFComments = FComments[Cnon0]/(FComments[Cnon0]+MComments[Cnon0]) PFQuestions = FQuestions[Qnon0]/(FQuestions[Qnon0]+MQuestions[Qnon0]) PFInterventions = FInterventions[Inon0]/(FInterventions[Inon0]+MInterventions[Inon0]) NRows = dim(PP)[1] ######################################################### # Plot results across all class sessions surveyed: ################ PFemalesC = Females[Cnon0]/(Females[Cnon0]+Males[Cnon0]) plot(PFemalesC,PFComments, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Comments by Females", main="Comments: Overall as of 11/07") text(PFemalesC,PFComments, labels=(1:NRows)[Cnon0], col=rgb(1,0,0,0.5), cex=0.6+CPSize*1.5) abline(0,1) # PFemalesQ = Females[Qnon0]/(Females[Qnon0]+Males[Qnon0]) plot(PFemalesQ,PFQuestions, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Questions by Females", main="Questions: Overall as of 11/07") text(PFemalesQ,PFQuestions, labels=(1:NRows)[Qnon0], col=rgb(0,0,1,0.5), cex=0.6+QPSize*1.5) abline(0,1) # PFemalesI = Females[Inon0]/(Females[Inon0]+Males[Inon0]) plot(PFemalesI,PFInterventions, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Interventions by Females", main=sprintf("Interventions (= Questions+Comments): Overall as of 11/07\nObservations from %d classes",sum(Inon0))) text(PFemalesI,PFInterventions, labels=(1:NRows)[Inon0], col=rgb(1,0,1,0.5), cex=0.6+IPSize*1.5) abline(0,1) ####################################################### # Plot results for SEAS courses: SEAS = c(1,8,11,12,24,25,45,46,53,54,55,58,63,64,65,83,84) which = vector(mode="logical", length=NRows); which[SEAS]=TRUE # PSEASFComments = FComments[which&Cnon0]/(FComments[which&Cnon0]+MComments[which&Cnon0]) PSEASFQuestions = FQuestions[which&Qnon0]/(FQuestions[which&Qnon0]+MQuestions[which&Qnon0]) PSEASFInterventions = FInterventions[which&Inon0]/(FInterventions[which&Inon0]+MInterventions[which&Inon0]) # PSEASFemales = Females[which&Cnon0]/(Females[which&Cnon0]+Males[which&Cnon0]) plot(PFemalesC,PFComments, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Comments by Females", main="Comments: SEAS as of 11/07") text(PFemalesC,PFComments, labels=(1:NRows)[Cnon0], col="gray", cex=0.6+CPSize*1.5) points(PSEASFemales,PSEASFComments, type="p", pch="X", col="red") abline(0,1) # PFemales = Females[Qnon0]/(Females[Qnon0]+Males[Qnon0]) PSEASFemales = Females[which&Qnon0]/(Females[which&Qnon0]+Males[which&Qnon0]) plot(PFemalesQ,PFQuestions, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Questions by Females", main="Questions: SEAS as of 11/07") text(PFemalesQ,PFQuestions, labels=(1:NRows)[Qnon0], col="gray", cex=0.6+QPSize*1.5) points(PSEASFemales,PSEASFQuestions, type="p", pch="X", col="red") abline(0,1) # PSEASFemales = Females[which&Inon0]/(Females[which&Inon0]+Males[which&Inon0]) plot(PFemalesI,PFInterventions, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Interventions by Females", main="Interventions: SEAS as of 11/07") text(PFemalesI,PFInterventions, labels=(1:NRows)[Inon0], col="gray", cex=0.6+IPSize*1.5) points(PSEASFemales,PSEASFInterventions, type="p", pch="X", col="red") abline(0,1) ########################################################## # Plot results for MATH courses: MATH = c(4,5,20,21,33,34,37,39,47,50,57,60,70,71,72,80) which = vector(mode="logical", length=NRows); which[MATH]=TRUE # PMATHFComments = FComments[which&Cnon0]/(FComments[which&Cnon0]+MComments[which&Cnon0]) PMATHFQuestions = FQuestions[which&Qnon0]/(FQuestions[which&Qnon0]+MQuestions[which&Qnon0]) PMATHFInterventions = FInterventions[which&Inon0]/(FInterventions[which&Inon0]+MInterventions[which&Inon0]) # PMATHFemales = Females[which&Cnon0]/(Females[which&Cnon0]+Males[which&Cnon0]) plot(PFemalesC,PFComments, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Comments by Females", main="Comments: MATH as of 11/07") text(PFemalesC,PFComments, labels=(1:NRows)[Cnon0], col="gray", cex=0.6+CPSize*1.5) points(PMATHFemales,PMATHFComments, type="p", pch="X", col="red") abline(0,1) # PMATHFemales = Females[which&Qnon0]/(Females[which&Qnon0]+Males[which&Qnon0]) plot(PFemalesQ,PFQuestions, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Questions by Females", main="Questions: MATH as of 11/07") text(PFemalesQ,PFQuestions, labels=(1:NRows)[Qnon0], col="gray", cex=0.6+QPSize*1.5) points(PMATHFemales,PMATHFQuestions, type="p", pch="X", col="red") abline(0,1) # PMATHFemales = Females[which&Inon0]/(Females[which&Inon0]+Males[which&Inon0]) plot(PFemalesI,PFInterventions, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Interventions by Females", main="Interventions: MATH as of 11/07") text(PFemalesI,PFInterventions, labels=(1:NRows)[Inon0], col="gray", cex=0.6+IPSize*1.5) points(PMATHFemales,PMATHFInterventions, type="p", pch="X", col="red") abline(0,1) ########################################################## # Plot results for ECON courses: ECON = c(7,15,18,23,28,49,52,62,80,81) which = vector(mode="logical", length=NRows); which[ECON]=TRUE # PECONFComments = FComments[which&Cnon0]/(FComments[which&Cnon0]+MComments[which&Cnon0]) PECONFQuestions = FQuestions[which&Qnon0]/(FQuestions[which&Qnon0]+MQuestions[which&Qnon0]) PECONFInterventions = FInterventions[which&Inon0]/(FInterventions[which&Inon0]+MInterventions[which&Inon0]) # PECONFemales = Females[which&Cnon0]/(Females[which&Cnon0]+Males[which&Cnon0]) plot(PFemalesC,PFComments, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Comments by Females", main="Comments: ECON as of 11/07") text(PFemalesC,PFComments, labels=(1:NRows)[Cnon0], col="gray", cex=0.6+CPSize*1.5) points(PECONFemales,PECONFComments, type="p", pch="X", col="red") abline(0,1) # PECONFemales = Females[which&Qnon0]/(Females[which&Qnon0]+Males[which&Qnon0]) plot(PFemalesQ,PFQuestions, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Questions by Females", main="Questions: ECON as of 11/07") text(PFemalesQ,PFQuestions, labels=(1:NRows)[Qnon0], col="gray", cex=0.6+QPSize*1.5) points(PECONFemales,PECONFQuestions, type="p", pch="X", col="red") abline(0,1) # PECONFemales = Females[which&Inon0]/(Females[which&Inon0]+Males[which&Inon0]) plot(PFemalesI,PFInterventions, type="n", xlab="Proportion of Females in Class", ylab="Proportion of Interventions by Females", main="Interventions: ECON as of 11/07") text(PFemalesI,PFInterventions, labels=(1:NRows)[Inon0], col="gray", cex=0.6+IPSize*1.5) points(PECONFemales,PECONFInterventions, type="p", pch="X", col="red") abline(0,1) # ########################################################### # Look at results for BIOL, WRIT, etc. -- or results for individual coders, or whatever... # BIOL = c( etc.