# MATH 3330 Section B F01 # # Week 2 Part a # # Review of Week 1 # # Nova Scotia U admission data # # tot.app # tot.adm # prop.adm.gen <- 100 * tot.adm / tot.app # prop.adm.gen # applicants <- cbind( Arts = c(Male = 200, Female = 230), Nursing = c(20, 350), Eng = c(400, 30)) applicants prop.admit <- cbind( Arts = c(Male = .50, Female = .60), Nursing = c(.20 , .32), Eng = c( .58, .70)) prop.admit num.admit <- applicants * prop.admit num.admit tot.app <- apply( applicants, 1, sum) tot.app tot.adm <- apply( num.admit, 1, sum ) tot.adm prop.adm.gen <- tot.adm / tot.app prop.adm.gen plot( rep(c(0,1), 3) , c(prop.admit), xlim = c(-.5,1.5), ylim = c(0.1,.8) ) lines( c(0,1), prop.admit[ , 1]) lines( c(0,1), prop.admit[ , 2]) lines( c(0,1), prop.admit[ , 3]) text( .5, mean( prop.admit[ , 1]) , "Arts") text( .5, mean( prop.admit[ , 2]) , "Nursing") text( .5, mean( prop.admit[ , 3]) , "Eng") symbols( rep(c(0,1), 3), c(prop.admit), circles = sqrt(c(applicants)) , add = T) points( c(0,1) , prop.adm.gen, pch = '+') lines( c(0,1) , prop.adm.gen) text( .5, mean( prop.adm.gen), "Overall")