diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b6a065 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata diff --git a/class5.Rproj b/class5.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/class5.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX diff --git a/lesson1.csv b/lesson1.csv new file mode 100644 index 0000000..8318254 --- /dev/null +++ b/lesson1.csv @@ -0,0 +1,8634 @@ +"time","answer","id" +"1455646926649","load(file = file.choose())","Gemy" +"1455646932933","dim(acupun)","Gemy" +"1455646936271","View(acupun)","Gemy" +"1455646936482","View(acupun)","Gemy" +"1455647007588","acuT <- acupun[acupun$group == 1,]","Gemy" +"1455647007604","dim(acuT)","Gemy" +"1455647009813","View(acuT)","Gemy" +"1455647010037","View(acuT)","Gemy" +"1455647127158","acuC <- acupun[acupun$group == 0,]","Gemy" +"1455647127163","dim(acuC)","Gemy" +"1455647227885","View(acupun)","Gemy" +"1455647348766","View(acupun)","Gemy" +"1455647350033","View(acuC)","Gemy" +"1455647477470","View(acupun)","Gemy" +"1455647479131","View(acuC)","Gemy" +"1455647480882","View(acuT)","Gemy" +"1455647482161","View(acupun)","Gemy" +"1455648103703","trtd <- read.table(file = nsw_treated.txt, head = FALSE, sep = )","Gemy" +"1455648103719","trtd <- read.table(file = Dropbox/Teaching/Causal Inference/03 Simple Randomized Experiments/nsw_treated.txt,","Gemy" +"1455648103720","head = FALSE, sep = )","Gemy" +"1455648103724","head(trtd)","Gemy" +"1455648280502","trtd <- read.table(file = nsw_treated.txt, head = FALSE, sep = )","Gemy" +"1455648429180","trtd <- read.table(file = nsw_treated.txt, head = FALSE, sep = )","Gemy" +"1455648429187","trtd <- read.table(file = /Users/Gemy/Desktop/HUDM 5133,","Gemy" +"1455648429187","head = FALSE, sep = )","Gemy" +"1455648429194","head(trtd)","Gemy" +"1455648429196","trtd <- trtd[,c(3, 5, 7, 9, 11, 13, 15, 17, 19)]","Gemy" +"1455648429197","head(trtd)","Gemy" +"1455648429197","trtd <- data.frame(trtd)","Gemy" +"1455993130328","> ","Gemy" +"1455993130336","> ","Gemy" +"1455993130336","> ","Gemy" +"1455993130337","> ","Gemy" +"1455993130338","> ","Gemy" +"1455993130338","> trtd <- read.table(file = nsw_treated.txt, head = FALSE, sep = )","Gemy" +"1455993130338","> trtd <- read.table(file = /Users/Gemy/Desktop/HUDM 5133/nsw_treated.txt,","Gemy" +"1455993130339","+ head = FALSE, sep = )","Gemy" +"1455993130339","> head(trtd)","Gemy" +"1455993198562","","Gemy" +"1455993198563","","Gemy" +"1455993198564","","Gemy" +"1455993198564","","Gemy" +"1455993198564","","Gemy" +"1455993198565","trtd <- read.table(file = nsw_treated.txt, head = FALSE, sep = )","Gemy" +"1455993198577","trtd <- read.table(file = /Users/Gemy/Desktop/HUDM 5133/nsw_treated.txt,","Gemy" +"1455993198578","head = FALSE, sep = )","Gemy" +"1455993198595","head(trtd)","Gemy" +"1455993198623","trtd <- trtd[,c(3, 5, 7, 9, 11, 13, 15, 17, 19)]","Gemy" +"1455993198625","head(trtd)","Gemy" +"1455993198634","trtd <- data.frame(trtd)","Gemy" +"1455993439690","load(file = file.choose())","Gemy" +"1455993449352","dim(acupun)","Gemy" +"1455993449353","","Gemy" +"1455993449353","acuT <- acupun[acupun$group == 1,]","Gemy" +"1455993449354","dim(acuT)","Gemy" +"1455993449354","","Gemy" +"1455993449355","acuC <- acupun[acupun$group == 0,]","Gemy" +"1455993449355","dim(acuC)","Gemy" +"1455993459662","load(file = file.choose())","Gemy" +"1455993467486","dim(acupun)","Gemy" +"1455993467488","","Gemy" +"1455993467489","acuT <- acupun[acupun$group == 1,]","Gemy" +"1455993467491","dim(acuT)","Gemy" +"1455993467492","","Gemy" +"1455993467492","acuC <- acupun[acupun$group == 0,]","Gemy" +"1455993467495","dim(acuC)","Gemy" +"1455993529118","View(acuC)","Gemy" +"1455993533447","View(acupun)","Gemy" +"1455993538713","View(trtd)","Gemy" +"1455993542670","View(acuT)","Gemy" +"1455993797340","x<-1","Gemy" +"1455993803151","print(x)","Gemy" +"1455993819465","x","Gemy" +"1455993836292","msg <- hello","Gemy" +"1455993855168","","Gemy" +"1455993864505","","Gemy" +"1455993871066","","Gemy" +"1455993872298","x","Gemy" +"1455993877924","y <- 5","Gemy" +"1455993879056","y","Gemy" +"1455994073346","x<- 2","Gemy" +"9","","Gemy" +"1455994075834","x","Gemy" +"1455994483335","x<-c(1.7,a)","Gemy" +"1455994495293","y","Gemy" +"1455994776179","y<- matrix(nrow=4, ncol=6)","Gemy" +"1455994779084","y","Gemy" +"1455994787553","dim(y)","Gemy" +"1455995128113","z<- factor(c(female, male))","Gemy" +"1455995131001","z","Gemy" +"1455995136985","table z","Gemy" +"1456013822902","View(acupun)","Gemy" +"1456013828500","View(acuT)","Gemy" +"1456013830539","View(trtd)","Gemy" +"1456013833099","View(acuC)","Gemy" +"1456013836148","View(acuT)","Gemy" +"1456013838846","View(acuC)","Gemy" +"1456013841818","View(acuT)","Gemy" +"1456013845532","View(acuC)","Gemy" +"1456114819360","","Gemy" +"1456114819376","load(file = file.choose())","Gemy" +"1456114828829","dim(acupun)","Gemy" +"1456114828830","","Gemy" +"1456114828830","acuT <- acupun[acupun$group == 1,]","Gemy" +"1456114828831","dim(acuT)","Gemy" +"1456114828832","","Gemy" +"1456114828832","acuC <- acupun[acupun$group == 0,]","Gemy" +"1456114828833","dim(acuC)","Gemy" +"1456114828833","","Gemy" +"1456114828834","","Gemy" +"1456114828834","","Gemy" +"1456114828834","","Gemy" +"1456114828835","","Gemy" +"1456114828835","","Gemy" +"1456114828835","","Gemy" +"1456114828835","","Gemy" +"1456114828836","","Gemy" +"1456114828836","","Gemy" +"1456114828836","","Gemy" +"1456114828837","","Gemy" +"1456114828837","","Gemy" +"1456114828837","","Gemy" +"1456114828837","","Gemy" +"1456114828838","","Gemy" +"1456114828838","","Gemy" +"1456114837785","View(acuC)","Gemy" +"1456114931907","","Gemy" +"1456114957909","head(acupun)","Gemy" +"1456114984963","names(acupun)","Gemy" +"1456115022457","","Gemy" +"1456115034977","summary(acuT$age)","Gemy" +"1456115083936","summary(acuC$age)","Gemy" +"1456115083938","var(acuT$age)","Gemy" +"1456115083942","var(acuC$age)","Gemy" +"1456115181087","","Gemy" +"1456115181087","(mean(acuT$age) - mean(acuC$age)) /","Gemy" +"1456115181091","sqrt( ((var(acuT$age) + var(acuC$age)) / 2) )","Gemy" +"1456115181093","","Gemy" +"1456115181093","var(acuT$age)/var(acuC$age)","Gemy" +"1456115181094","","Gemy" +"1456115181094","par(mfrow = c(2,1))","Gemy" +"1456115181111","range(acupun$age)","Gemy" +"1456115181111","hist(acuT$age, breaks = seq(12, 60, 2), xlab = Age, main = Treated Cases,","Gemy" +"1456115181112","freq = FALSE)","Gemy" +"1456115181114","d1 <- density(acuT$age)","Gemy" +"1456115181119","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456115181121","hist(acuC$age, breaks = seq(12, 60, 2), xlab = Age, main = Control Cases,","Gemy" +"1456115181122","freq = FALSE)","Gemy" +"1456115181124","d2 <- density(acuC$age)","Gemy" +"1456115181126","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456115181127","par(mfrow = c(1,1))","Gemy" +"1456115397022","","Gemy" +"1456115397022","par(mfrow = c(2,1))","Gemy" +"1456115397027","range(acupun$age)","Gemy" +"1456115397027","hist(acuTage, breaks = seq(12, 60, 2), xlab = age, main = pk1,","Gemy" +"1456115397028","freq = FALSE)","Gemy" +"1456115397028","d1 <- density(acuT$age)","Gemy" +"1456115397030","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456115397032","hist(acuC$age, breaks = seq(12, 60, 2), xlab = age, main = pk1,","Gemy" +"1456115397032","freq = FALSE)","Gemy" +"1456115397034","d2 <- density(acuC$age)","Gemy" +"1456115397036","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456115397037","par(mfrow = c(1,1))","Gemy" +"1456115440629","par(mfrow = c(2,1))","Gemy" +"1456115440630","range(acupun$age)","Gemy" +"1456115440634","hist(acuT$age, breaks = seq(12, 60, 2), xlab = age, main = pk1,","Gemy" +"1456115440635","freq = FALSE)","Gemy" +"1456115455030","View(acuC)","Gemy" +"1456115460182","View(acuT)","Gemy" +"1456115496670","par(mfrow = c(2,1))","Gemy" +"1456115496671","range(acupun$age)","Gemy" +"1456115496676","hist(acuT$age, breaks = seq(18, 65, 2), xlab = age, main = pk1,","Gemy" +"1456115496677","freq = FALSE)","Gemy" +"1456115496679","d1 <- density(acuT$age)","Gemy" +"1456115496680","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456115496682","hist(acuC$age, breaks = seq(18, 65, 2), xlab = age, main = pk1,","Gemy" +"1456115496683","freq = FALSE)","Gemy" +"1456115496709","d2 <- density(acuC$age)","Gemy" +"1456115496711","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456115496712","par(mfrow = c(1,1))","Gemy" +"1456115548027","par(mfrow = c(2,1))","Gemy" +"1456115548028","range(acupun$age)","Gemy" +"1456115548032","hist(acuT$age, breaks = seq(18, 65, 2), xlab = age, main = pk1,","Gemy" +"1456115548033","freq = FALSE)","Gemy" +"1456115548038","d1 <- density(acuT$age)","Gemy" +"1456115548040","lines(d1, col = 2, lwd = 1, lty = 2)","Gemy" +"1456115548041","hist(acuC$age, breaks = seq(18, 65, 2), xlab = age, main = pk1,","Gemy" +"1456115548041","freq = FALSE)","Gemy" +"1456115548061","d2 <- density(acuC$age)","Gemy" +"1456115548063","lines(d2, col = 4, lwd = 2, lty = 1)","Gemy" +"1456115548064","par(mfrow = c(1,1))","Gemy" +"1456115585031","View(acuT)","Gemy" +"1456115587228","View(acupun)","Gemy" +"1456115628818","","Gemy" +"1456115628819","par(mfrow = c(2,1))","Gemy" +"1456115628824","range(acupun$age)","Gemy" +"1456115628825","hist(acupun$age, breaks = seq(18, 65, 2), xlab = age, main = pk1,","Gemy" +"1456115628825","freq = FALSE)","Gemy" +"1456115628828","d1 <- density(acupun$age)","Gemy" +"1456115628830","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456115628831","hist(acupun$age, breaks = seq(18, 65, 2), xlab = age, main = pk1,","Gemy" +"1456115628832","freq = FALSE)","Gemy" +"1456115628834","d2 <- density(acupun$age)","Gemy" +"1456115628836","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456115628837","par(mfrow = c(1,1))","Gemy" +"1456115775900","> par(mfrow = c(2,1))","Gemy" +"1456115775901","> range(acupun$age)","Gemy" +"1456115775915","[1] 18 65","Gemy" +"1456115775915","> hist(acuT$age, breaks = seq(18, 65, 2), xlab = age, main = pk1,","Gemy" +"1456115775915","+ freq = FALSE)","Gemy" +"1456115775916","Error in hist.default(acuT$age, breaks = seq(18, 65, 2), xlab = age, ","Gemy" +"1456115775916","some x not counted; maybe breaks do not span range of x","Gemy" +"1456115775917","> d1 <- density(acuT$age)","Gemy" +"1456115775917","> lines(d1, col = 2, lwd = 1, lty = 2)","Gemy" +"1456115775918","> hist(acuC$age, breaks = seq(18, 65, 2), xlab = age, main = pk1,","Gemy" +"1456115775918","+ freq = FALSE)","Gemy" +"1456115775919","> d2 <- density(acuC$age)","Gemy" +"1456115775919","> lines(d2, col = 4, lwd = 2, lty = 1)","Gemy" +"1456115775920","> par(mfrow = c(1,1))","Gemy" +"1456115828943","","Gemy" +"1456115828944","par(mfrow = c(2,1))","Gemy" +"1456115828948","range(acupun$age)","Gemy" +"1456115828949","hist(acuT$age, breaks = seq(18, 65, 2), xlab = age, main = pk1,","Gemy" +"1456115828949","freq = FALSE)","Gemy" +"1456115828951","d1 <- density(acuT$age)","Gemy" +"1456115828952","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456115828953","hist(acuC$age, breaks = seq(18, 65, 2), xlab = age, main = pk1,","Gemy" +"1456115828954","freq = FALSE)","Gemy" +"1456115828982","d2 <- density(acuC$age)","Gemy" +"1456115828984","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456115828985","par(mfrow = c(1,1))","Gemy" +"1456115886348","par(mfrow = c(2,1))","Gemy" +"1456115886348","range(acupun$age)","Gemy" +"1456115886353","hist(acuT$age, breaks = seq(18, 65, 2), xlab = age, main = pk2,","Gemy" +"1456115886353","freq = FALSE)","Gemy" +"1456115886355","d1 <- density(acuT$age)","Gemy" +"1456115886356","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456115886357","hist(acuC$age, breaks = seq(18, 65, 2), xlab = age, main = pk2,","Gemy" +"1456115886358","freq = FALSE)","Gemy" +"1456115886390","d2 <- density(acuC$age)","Gemy" +"1456115886394","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456115886395","par(mfrow = c(1,1))","Gemy" +"1456115915545","","Gemy" +"1456115915546","par(mfrow = c(2,1))","Gemy" +"1456115915550","range(acupun$age)","Gemy" +"1456115915551","hist(acupun$age, breaks = seq(18, 65, 2), xlab = age, main = pk2,","Gemy" +"1456115915552","freq = FALSE)","Gemy" +"1456115915555","d1 <- density(acupun$age)","Gemy" +"1456115915556","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456115915558","hist(acupun$age, breaks = seq(18, 65, 2), xlab = age, main = pk2,","Gemy" +"1456115915558","freq = FALSE)","Gemy" +"1456115915562","d2 <- density(acupun$age)","Gemy" +"1456115915565","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456115915566","par(mfrow = c(1,1))","Gemy" +"1456115951492","","Gemy" +"1456115951492","t.test(x = acuT$age, y = acuC$age, alternative = two.sided,","Gemy" +"1456115951507","var.equal = FALSE)","Gemy" +"1456115951512","","Gemy" +"1456115951512","ks.test(x = acuT$age, y = acuC$age, alternative = two.sided)","Gemy" +"1456116075941","","Gemy" +"1456116075942","","Gemy" +"1456116075967","","Gemy" +"1456116075967","summary(acuT$sex)","Gemy" +"1456116075970","summary(acuC$sex)","Gemy" +"1456116075972","var(acuT$sex)","Gemy" +"1456116075973","var(acuC$sex)","Gemy" +"1456116075974","","Gemy" +"1456116075974","(mean(acuT$educ) - mean(acuC$educ)) /","Gemy" +"1456116075974","sqrt(((var(acuT$educ) + var(acuC$educ)) / 2))","Gemy" +"1456116075976","","Gemy" +"1456116075977","var(acuT$educ)/var(acuC$educ)","Gemy" +"1456116144568","","Gemy" +"1456116144569","(mean(acuT$sex) - mean(acuC$sex)) /","Gemy" +"1456116144593","sqrt(((var(acuT$sex) + var(acuC$sex)) / 2))","Gemy" +"1456116144594","","Gemy" +"1456116144595","var(acuT$sex)/var(acuC$sex)","Gemy" +"1456116711770","par(mfrow = c(2,1))","Gemy" +"1456116711786","range(acupun$sex)","Gemy" +"1456116711787","hist(trtd$educ, breaks = seq(2, 17, 1), xlab = Age, main = Treated Cases,","Gemy" +"1456116711788","freq = FALSE)","Gemy" +"1456116711789","d1 <- density(trtd$educ)","Gemy" +"1456116711789","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456116711791","hist(ctrl$educ, breaks = seq(2, 17, 1), xlab = Age, main = Control Cases,","Gemy" +"1456116711792","freq = FALSE)","Gemy" +"1456116711792","d2 <- density(ctrl$educ)","Gemy" +"1456116711793","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456116711794","par(mfrow = c(1,1))","Gemy" +"1456116713404","","Gemy" +"1456116713405","par(mfrow = c(2,1))","Gemy" +"1456116713420","range(acupun$age)","Gemy" +"1456116713420","hist(acuT$age, breaks = seq(15, 70, 5), xlab = Age, main = Treated Case,","Gemy" +"1456116713421","freq = FALSE)","Gemy" +"1456116713448","d1 <- density(acuT$age)","Gemy" +"1456116713450","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456116713451","hist(acuC$age, breaks = seq(15, 70, 5), xlab = Age, main = Control Cases,","Gemy" +"1456116713451","freq = FALSE)","Gemy" +"1456116713465","d2 <- density(acuC$age)","Gemy" +"1456116713467","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456116713468","par(mfrow = c(1,1))","Gemy" +"1456116871094","summary(acuT$chronicity)","Gemy" +"1456116871097","summary(acuC$chronicity)","Gemy" +"1456116871099","var(acuT$chronicity)","Gemy" +"1456116871099","var(acuC$chronicity)","Gemy" +"1456116940312","par(mfrow = c(2,1))","Gemy" +"1456116940313","range(acupun$chronicity)","Gemy" +"1456116979327","par(mfrow = c(2,1))","Gemy" +"1456116979328","range(acupun$chronicity)","Gemy" +"1456116979332","hist(acuT$chronicity, breaks = seq(0, 56, 2), xlab = Age, main = Treated Case,","Gemy" +"1456116979332","freq = FALSE)","Gemy" +"1456116979367","d1 <- density(acuT$chronicity)","Gemy" +"1456116979369","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456116979370","hist(acuC$chronicity, breaks = seq(0, 56, 2), xlab = Age, main = Control Cases,","Gemy" +"1456116979370","freq = FALSE)","Gemy" +"1456116979384","d2 <- density(acuC$chronicity)","Gemy" +"1456116979385","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456116979387","par(mfrow = c(1,1))","Gemy" +"1456117000575","par(mfrow = c(2,1))","Gemy" +"1456117000575","range(acupun$chronicity)","Gemy" +"1456117000580","hist(acuT$chronicity, breaks = seq(0, 56, 4), xlab = Age, main = Treated Case,","Gemy" +"1456117000580","freq = FALSE)","Gemy" +"1456117000615","d1 <- density(acuT$chronicity)","Gemy" +"1456117000617","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456117000618","hist(acuC$chronicity, breaks = seq(0, 56, 4), xlab = Age, main = Control Cases,","Gemy" +"1456117000618","freq = FALSE)","Gemy" +"1456117000634","d2 <- density(acuC$chronicity)","Gemy" +"1456117000636","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456117000637","par(mfrow = c(1,1))","Gemy" +"1456117219008","summary(acuT$sex)","Gemy" +"1456117219009","summary(acuC$sex)","Gemy" +"1456117219014","var(acuT$sex)","Gemy" +"1456117219014","var(acuC$sex)","Gemy" +"1456117219015","","Gemy" +"1456117219016","(mean(acuT$sex) - mean(acuC$sex)) /","Gemy" +"1456117219016","sqrt(((var(acuT$sex) + var(acuC$sex)) / 2))","Gemy" +"1456117219017","","Gemy" +"1456117219017","var(acuT$sex)/var(acuC$sex)","Gemy" +"1456117219018","par(mfrow = c(2,1))","Gemy" +"1456117219019","(t1 <- table(acuT$sex) / sum(table(acuT$sex)))","Gemy" +"1456117219020","barplot(t1)","Gemy" +"1456117219050","(t2 <- table(acuC$sex) / sum(table(acuC$sex)))","Gemy" +"1456117219052","barplot(t2)","Gemy" +"1456117219060","par(mfrow = c(1,1))","Gemy" +"1456117219061","","Gemy" +"1456117219061","(tt1 <- with(data = acupun, table(treat, sex)))","Gemy" +"1456117219063","prop.table(tt1, margin = 2)","Gemy" +"1456117219064","chisq.test(tt1)","Gemy" +"1456117219066","","Gemy" +"1456117219066","fisher.test(tt1)","Gemy" +"1456117256996","","Gemy" +"1456117256996","(tt1 <- with(data = acupun, table(pk2, sex)))","Gemy" +"1456117257023","prop.table(tt1, margin = 2)","Gemy" +"1456117257031","chisq.test(tt1)","Gemy" +"1456117257036","","Gemy" +"1456117257037","fisher.test(tt1)","Gemy" +"1456117332848","","Gemy" +"1456117332849","load(file = file.choose())","Gemy" +"1456117339107","dim(acupun)","Gemy" +"1456117339108","","Gemy" +"1456117339108","acuT <- acupun[acupun$group == 1,]","Gemy" +"1456117339109","dim(acuT)","Gemy" +"1456117339109","","Gemy" +"1456117339110","acuC <- acupun[acupun$group == 0,]","Gemy" +"1456117339111","dim(acuC)","Gemy" +"1456117339111","","Gemy" +"1456117339112","","Gemy" +"1456117339112","summary(acuT$age)","Gemy" +"1456117339118","summary(acuC$age)","Gemy" +"1456117339120","var(acuT$age)","Gemy" +"1456117339122","var(acuC$age)","Gemy" +"1456117339123","","Gemy" +"1456117339123","(mean(acuT$age) - mean(acuC$age)) /","Gemy" +"1456117339123","sqrt( ((var(acuT$age) + var(acuC$age)) / 2) )","Gemy" +"1456117339124","","Gemy" +"1456117339125","var(acuT$age)/var(acuC$age)","Gemy" +"1456117339126","","Gemy" +"1456117339126","par(mfrow = c(2,1))","Gemy" +"1456117339147","range(acupun$age)","Gemy" +"1456117339147","hist(acuT$age, breaks = seq(15, 70, 5), xlab = Age, main = Treated Case,","Gemy" +"1456117339148","freq = FALSE)","Gemy" +"1456117339175","d1 <- density(acuT$age)","Gemy" +"1456117339178","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456117339180","hist(acuC$age, breaks = seq(15, 70, 5), xlab = Age, main = Control Cases,","Gemy" +"1456117339180","freq = FALSE)","Gemy" +"1456117339194","d2 <- density(acuC$age)","Gemy" +"1456117339195","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456117339196","par(mfrow = c(1,1))","Gemy" +"1456117339197","","Gemy" +"1456117339198","t.test(x = acuT$age, y = acuC$age, alternative = two.sided,","Gemy" +"1456117339198","var.equal = FALSE)","Gemy" +"1456117339202","","Gemy" +"1456117339202","ks.test(x = acuT$age, y = acuC$age, alternative = two.sided)","Gemy" +"1456117339206","","Gemy" +"1456117339206","summary(acuT$chronicity)","Gemy" +"1456117339208","summary(acuC$chronicity)","Gemy" +"1456117339210","var(acuT$chronicity)","Gemy" +"1456117339210","var(acuC$chronicity)","Gemy" +"1456117339211","","Gemy" +"1456117339212","(mean(acuT$chronicity) - mean(acuC$chronicity)) /","Gemy" +"1456117339212","sqrt( ((var(acuT$chronicity) + var(acuC$chronicity)) / 2) )","Gemy" +"1456117339213","","Gemy" +"1456117339213","var(acuT$chronicity)/var(acuC$chronicity)","Gemy" +"1456117339214","","Gemy" +"1456117339215","par(mfrow = c(2,1))","Gemy" +"1456117339215","range(acupun$chronicity)","Gemy" +"1456117339216","hist(acuT$chronicity, breaks = seq(0, 56, 4), xlab = Age, main = Treated Case,","Gemy" +"1456117339216","freq = FALSE)","Gemy" +"1456117339260","d1 <- density(acuT$chronicity)","Gemy" +"1456117339261","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456117339262","hist(acuC$chronicity, breaks = seq(0, 56, 4), xlab = Age, main = Control Cases,","Gemy" +"1456117339263","freq = FALSE)","Gemy" +"1456117339276","d2 <- density(acuC$chronicity)","Gemy" +"1456117339278","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456117339279","par(mfrow = c(1,1))","Gemy" +"1456117339280","","Gemy" +"1456117339280","t.test(x = acuT$chronicity, y = acuC$chronicity, alternative = two.sided,","Gemy" +"1456117339281","var.equal = FALSE)","Gemy" +"1456117339284","","Gemy" +"1456117339284","ks.test(x = acuT$chronicity, y = acuC$chronicity, alternative = two.sided)","Gemy" +"1456117339287","","Gemy" +"1456117339287","summary(acuT$sex)","Gemy" +"1456117339289","summary(acuC$sex)","Gemy" +"1456117339290","var(acuT$sex)","Gemy" +"1456117339291","var(acuC$sex)","Gemy" +"1456117339292","","Gemy" +"1456117339292","(mean(acuT$sex) - mean(acuC$sex)) /","Gemy" +"1456117339292","sqrt(((var(acuT$sex) + var(acuC$sex)) / 2))","Gemy" +"1456117339293","","Gemy" +"1456117339293","var(acuT$sex)/var(acuC$sex)","Gemy" +"1456117339294","par(mfrow = c(2,1))","Gemy" +"1456117339295","(t1 <- table(acuT$sex) / sum(table(acuT$sex)))","Gemy" +"1456117339296","barplot(t1)","Gemy" +"1456117339328","(t2 <- table(acuC$sex) / sum(table(acuC$sex)))","Gemy" +"1456117339332","barplot(t2)","Gemy" +"1456117339340","par(mfrow = c(1,1))","Gemy" +"1456117339341","","Gemy" +"1456117339341","(tt1 <- with(data = acupun, table(pk2, sex)))","Gemy" +"1456117339350","prop.table(tt1, margin = 2)","Gemy" +"1456117339364","chisq.test(tt1)","Gemy" +"1456117339367","","Gemy" +"1456117339367","fisher.test(tt1)","Gemy" +"1456118620144","","Gemy" +"1456118620147","load(file = file.choose())","Gemy" +"1456118625206","dim(acupun)","Gemy" +"1456118625208","","Gemy" +"1456118625209","acuT <- acupun[acupun$group == 1,]","Gemy" +"1456118625210","dim(acuT)","Gemy" +"1456118625211","","Gemy" +"1456118625211","acuC <- acupun[acupun$group == 0,]","Gemy" +"1456118625212","dim(acuC)","Gemy" +"1456118625213","","Gemy" +"1456118625214","","Gemy" +"1456118625214","summary(acuT$age)","Gemy" +"1456118625223","summary(acuC$age)","Gemy" +"1456118625226","var(acuT$age)","Gemy" +"1456118625230","var(acuC$age)","Gemy" +"1456118625231","","Gemy" +"1456118625231","(mean(acuT$age) - mean(acuC$age)) /","Gemy" +"1456118625232","sqrt( ((var(acuT$age) + var(acuC$age)) / 2) )","Gemy" +"1456118625233","","Gemy" +"1456118625233","var(acuT$age)/var(acuC$age)","Gemy" +"1456118625234","","Gemy" +"1456118625234","par(mfrow = c(2,1))","Gemy" +"1456118625259","range(acupun$age)","Gemy" +"1456118625260","hist(acuT$age, breaks = seq(15, 70, 5), xlab = Age, main = Treated Case,","Gemy" +"1456118625260","freq = FALSE)","Gemy" +"1456118625289","d1 <- density(acuT$age)","Gemy" +"1456118625294","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456118625295","hist(acuC$age, breaks = seq(15, 70, 5), xlab = Age, main = Control Cases,","Gemy" +"1456118625296","freq = FALSE)","Gemy" +"1456118625310","d2 <- density(acuC$age)","Gemy" +"1456118625312","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456118625313","par(mfrow = c(1,1))","Gemy" +"1456118625314","","Gemy" +"1456118625314","t.test(x = acuT$age, y = acuC$age, alternative = two.sided,","Gemy" +"1456118625315","var.equal = FALSE)","Gemy" +"1456118625326","","Gemy" +"1456118625326","ks.test(x = acuT$age, y = acuC$age, alternative = two.sided)","Gemy" +"1456118625331","","Gemy" +"1456118625333","summary(acuT$chronicity)","Gemy" +"1456118625335","summary(acuC$chronicity)","Gemy" +"1456118625337","var(acuT$chronicity)","Gemy" +"1456118625338","var(acuC$chronicity)","Gemy" +"1456118625338","","Gemy" +"1456118625339","(mean(acuT$chronicity) - mean(acuC$chronicity)) /","Gemy" +"1456118625339","sqrt( ((var(acuT$chronicity) + var(acuC$chronicity)) / 2) )","Gemy" +"1456118625340","","Gemy" +"1456118625341","var(acuT$chronicity)/var(acuC$chronicity)","Gemy" +"1456118625342","","Gemy" +"1456118625342","par(mfrow = c(2,1))","Gemy" +"1456118625343","range(acupun$chronicity)","Gemy" +"1456118625343","hist(acuT$chronicity, breaks = seq(0, 56, 4), xlab = Age, main = Treated Case,","Gemy" +"1456118625343","freq = FALSE)","Gemy" +"1456118625387","d1 <- density(acuT$chronicity)","Gemy" +"1456118625389","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456118625390","hist(acuC$chronicity, breaks = seq(0, 56, 4), xlab = Age, main = Control Cases,","Gemy" +"1456118625391","freq = FALSE)","Gemy" +"1456118625407","d2 <- density(acuC$chronicity)","Gemy" +"1456118625408","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456118625410","par(mfrow = c(1,1))","Gemy" +"1456118625411","","Gemy" +"1456118625411","t.test(x = acuT$chronicity, y = acuC$chronicity, alternative = two.sided,","Gemy" +"1456118625411","var.equal = FALSE)","Gemy" +"1456118625414","","Gemy" +"1456118625414","ks.test(x = acuT$chronicity, y = acuC$chronicity, alternative = two.sided)","Gemy" +"1456118625418","","Gemy" +"1456118625418","summary(acuT$sex)","Gemy" +"1456118625420","summary(acuC$sex)","Gemy" +"1456118625422","var(acuT$sex)","Gemy" +"1456118625423","var(acuC$sex)","Gemy" +"1456118625424","","Gemy" +"1456118625424","(mean(acuT$sex) - mean(acuC$sex)) /","Gemy" +"1456118625424","sqrt(((var(acuT$sex) + var(acuC$sex)) / 2))","Gemy" +"1456118625425","","Gemy" +"1456118625426","var(acuT$sex)/var(acuC$sex)","Gemy" +"1456118625427","par(mfrow = c(2,1))","Gemy" +"1456118625427","(t1 <- table(acuT$sex) / sum(table(acuT$sex)))","Gemy" +"1456118625429","barplot(t1)","Gemy" +"1456118625467","(t2 <- table(acuC$sex) / sum(table(acuC$sex)))","Gemy" +"1456118625471","barplot(t2)","Gemy" +"1456118625479","par(mfrow = c(1,1))","Gemy" +"1456118625480","","Gemy" +"1456118625481","(tt1 <- with(data = acupun, table(pk2, sex)))","Gemy" +"1456118625488","prop.table(tt1, margin = 2)","Gemy" +"1456118625498","chisq.test(tt1)","Gemy" +"1456118625503","","Gemy" +"1456118625503","fisher.test(tt1)","Gemy" +"1456122139767","load(file = file.choose())","Gemy" +"1456122144738","dim(acupun)","Gemy" +"1456122144739","","Gemy" +"1456122144739","acuT <- acupun[acupun$group == 1,]","Gemy" +"1456122144740","dim(acuT)","Gemy" +"1456122144741","","Gemy" +"1456122144741","acuC <- acupun[acupun$group == 0,]","Gemy" +"1456122144743","dim(acuC)","Gemy" +"1456122186276","View(acupun)","Gemy" +"1456122225279","summary(acuT$pk2)","Gemy" +"1456122225285","summary(acuC$pk2)","Gemy" +"1456122225287","var(acuT$pk2)","Gemy" +"1456122225289","var(acuC$pk2)","Gemy" +"1456122225290","","Gemy" +"1456122225290","(mean(acuT$pk2) - mean(acuC$pk2)) / sqrt(((var(acuT$pk2) + var(acuC$pk2)) / 2))","Gemy" +"1456122225292","","Gemy" +"1456122225292","var(acuT$pk2)/var(acuC$pk2)","Gemy" +"1456122271327","par(mfrow = c(2,1))","Gemy" +"1456122271351","range(acupun$pk2)","Gemy" +"1456122271351","hist(acuT$pk2, breaks = seq(0, 64000, 4000), xlab = pk2, main = Treated Cases,","Gemy" +"1456122271351","freq = FALSE)","Gemy" +"1456122271385","d1 <- density(acuT$pk2)","Gemy" +"1456122271393","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456122271395","hist(acuC$pk2, breaks = seq(0, 64000, 4000), xlab = pk2, main = Control Cases,","Gemy" +"1456122271395","freq = FALSE)","Gemy" +"1456122271413","d2 <- density(acuC$pk2)","Gemy" +"1456122271414","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456122271416","par(mfrow = c(1,1))","Gemy" +"1456122313818","par(mfrow = c(2,1))","Gemy" +"1456122313853","range(acupun$pk2)","Gemy" +"1456122313854","hist(acuT$pk2, breaks = seq(0, 100, 5), xlab = pk2, main = Treated Cases,","Gemy" +"1456122313855","freq = FALSE)","Gemy" +"1456122313887","d1 <- density(acuT$pk2)","Gemy" +"1456122313889","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456122313891","hist(acuC$pk2, breaks = seq(0, 100, 5), xlab = pk2, main = Control Cases,","Gemy" +"1456122313892","freq = FALSE)","Gemy" +"1456122313909","d2 <- density(acuC$pk2)","Gemy" +"1456122313911","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456122313913","par(mfrow = c(1,1))","Gemy" +"1456122360415","par(mfrow = c(2,1))","Gemy" +"1456122360420","range(acupun$pk2)","Gemy" +"1456122360420","hist(acuT$pk2, breaks = seq(0, 200, 5), xlab = pk2, main = Treated Cases,","Gemy" +"1456122360421","freq = FALSE)","Gemy" +"1456122360447","d1 <- density(acuT$pk2)","Gemy" +"1456122360449","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456122360450","hist(acuC$pk2, breaks = seq(0, 200, 5), xlab = pk2, main = Control Cases,","Gemy" +"1456122360450","freq = FALSE)","Gemy" +"1456122360464","d2 <- density(acuC$pk2)","Gemy" +"1456122360466","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456122360467","par(mfrow = c(1,1))","Gemy" +"1456122432653","summary(acuT$pk1)","Gemy" +"1456122432659","summary(acuC$pk1)","Gemy" +"1456122432661","var(acuT$pk1)","Gemy" +"1456122432661","var(acuC$pk1)","Gemy" +"1456122432662","","Gemy" +"1456122432662","(mean(acuT$pk1) - mean(acuC$pk1)) / sqrt(((var(acuT$pk1) + var(acuC$pk1)) / 2))","Gemy" +"1456122432663","","Gemy" +"1456122432663","var(acuT$pk1)/var(acuC$pk1)","Gemy" +"1456122432664","","Gemy" +"1456122432664","par(mfrow = c(2,1))","Gemy" +"1456122432664","range(acupun$pk1)","Gemy" +"1456122432665","hist(acuT$pk1, breaks = seq(0, 64000, 4000), xlab = pk1, main = Treated Cases,","Gemy" +"1456122432665","freq = FALSE)","Gemy" +"1456122432708","d1 <- density(acuT$pk1)","Gemy" +"1456122432710","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456122432711","hist(acuC$pk2, breaks = seq(0, 64000, 4000), xlab = pk1, main = Control Cases,","Gemy" +"1456122432711","freq = FALSE)","Gemy" +"1456122432730","d2 <- density(acuC$pk1)","Gemy" +"1456122432732","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456122432733","par(mfrow = c(1,1))","Gemy" +"1456122501551","par(mfrow = c(2,1))","Gemy" +"1456122501556","range(acupun$pk1)","Gemy" +"1456122501557","hist(acuT$pk1, breaks = seq(0, 200, 5), xlab = pk1, main = Treated Cases,","Gemy" +"1456122501557","freq = FALSE)","Gemy" +"1456122501583","d1 <- density(acuT$pk1)","Gemy" +"1456122501585","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456122501586","hist(acuC$pk2, breaks = seq(0, 200, 5), xlab = pk1, main = Control Cases,","Gemy" +"1456122501586","freq = FALSE)","Gemy" +"1456122501599","d2 <- density(acuC$pk1)","Gemy" +"1456122501601","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456122501603","par(mfrow = c(1,1))","Gemy" +"1456122597922","lm1 <- lm(pk2 ~ treat, data = acupun)","Gemy" +"1456122597932","summary(lm1)","Gemy" +"1456122597932","","Gemy" +"1456122597933","t.test(x = acuT$pk2, y = acuC$pk2, alternative = two.sided,","Gemy" +"1456122597933","var.equal = FALSE)","Gemy" +"1456122597942","","Gemy" +"1456122597942","","Gemy" +"1456122597942","t.test(x = acuT$pk2, y = acuC$pk2, alternative = two.sided,","Gemy" +"1456122597942","var.equal = TRUE)","Gemy" +"1456122597945","","Gemy" +"1456122597945","lm2 <- lm(pk2 ~ treat + pk1 + age + chronicity, data = acupun)","Gemy" +"1456122597947","summary(lm2)","Gemy" +"1456122597948","lm3 <- lm(pk2 ~ treat + pk1 + sex + migrane , data = acupun)","Gemy" +"1456122597950","summary(lm3)","Gemy" +"1456122667275","lm1 <- lm(pk2 ~ pk2, data = acupun)","Gemy" +"1456122667282","summary(lm1)","Gemy" +"1456122722999","","Gemy" +"1456122723000","t.test(x = acuT$pk2, y = acuC$pk2, alternative = two.sided,","Gemy" +"1456122723004","var.equal = FALSE)","Gemy" +"1456122723007","","Gemy" +"1456122723007","","Gemy" +"1456122723008","t.test(x = acuT$pk2, y = acuC$pk2, alternative = two.sided,","Gemy" +"1456122723008","var.equal = TRUE)","Gemy" +"1456122723012","","Gemy" +"1456122723012","lm2 <- lm(pk2 ~ pk2 + pk1 + age + chronicity, data = acupun)","Gemy" +"1456122723016","summary(lm2)","Gemy" +"1456122723030","lm3 <- lm(pk2 ~ pk2 + pk1 + sex + migrane , data = acupun)","Gemy" +"1456122723036","summary(lm3)","Gemy" +"1456122723037","","Gemy" +"1456122723037","wilcox.test(pk2 ~ pk2, data = acupun)","Gemy" +"1456122723040","","Gemy" +"1456122723041","","Gemy" +"1456122723041","library(coin)","Gemy" +"1456122723043","independence_test(pk2 ~ treat, data = acupun)","Gemy" +"1456122844897","summary(acuT$migraine)","Gemy" +"1456122844937","summary(acuC$migraine)","Gemy" +"1456122844940","var(acuT$migraine)","Gemy" +"1456122844941","var(acuC$migraine)","Gemy" +"1456122844943","","Gemy" +"1456122844943","(mean(acuT$migraine) - mean(acuC$migraine)) /","Gemy" +"1456122844944","sqrt(((var(acuT$migraine) + var(acuC$migraine)) / 2))","Gemy" +"1456122844945","","Gemy" +"1456122844946","var(acuT$migraine)/var(acuC$migraine)","Gemy" +"1456122911152","summary(acuT$age)","Gemy" +"1456122911169","summary(acuC$age)","Gemy" +"1456122911170","var(acuT$age)","Gemy" +"1456122911171","var(acuC$age)","Gemy" +"1456122911172","","Gemy" +"1456122911172","(mean(acuT$age) - mean(acuC$age)) /","Gemy" +"1456122911172","sqrt( ((var(acuT$age) + var(acuC$age)) / 2) )","Gemy" +"1456122911173","","Gemy" +"1456122911173","var(acuT$age)/var(acuC$age)","Gemy" +"1456122911174","","Gemy" +"1456122911174","par(mfrow = c(2,1))","Gemy" +"1456122911175","range(acupun$age)","Gemy" +"1456122911175","hist(acuT$age, breaks = seq(15, 70, 5), xlab = Age, main = Treated Case,","Gemy" +"1456122911175","freq = FALSE)","Gemy" +"1456122911223","d1 <- density(acuT$age)","Gemy" +"1456122911225","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456122911227","hist(acuC$age, breaks = seq(15, 70, 5), xlab = Age, main = Control Cases,","Gemy" +"1456122911227","freq = FALSE)","Gemy" +"1456122911242","d2 <- density(acuC$age)","Gemy" +"1456122911244","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456122911245","par(mfrow = c(1,1))","Gemy" +"1456123314514","","Gemy" +"1456123314530","t.test(x = acuT$age, y = acuC$age, alternative = two.sided,","Gemy" +"1456123314531","var.equal = FALSE)","Gemy" +"1456123314535","","Gemy" +"1456123314535","ks.test(x = acuT$age, y = acuC$age, alternative = two.sided)","Gemy" +"1456123392732","","Gemy" +"1456123392732","summary(acuT$chronicity)","Gemy" +"1456123392758","summary(acuC$chronicity)","Gemy" +"1456123392760","var(acuT$chronicity)","Gemy" +"1456123392760","var(acuC$chronicity)","Gemy" +"1456123392761","","Gemy" +"1456123392762","(mean(acuT$chronicity) - mean(acuC$chronicity)) /","Gemy" +"1456123392762","sqrt( ((var(acuT$chronicity) + var(acuC$chronicity)) / 2) )","Gemy" +"1456123392763","","Gemy" +"1456123392764","var(acuT$chronicity)/var(acuC$chronicity)","Gemy" +"1456123458739","","Gemy" +"1456123458740","par(mfrow = c(2,1))","Gemy" +"1456123458744","range(acupun$chronicity)","Gemy" +"1456123458745","hist(acuT$chronicity, breaks = seq(0, 56, 4), xlab = Age, main = Treated Case,","Gemy" +"1456123458745","freq = FALSE)","Gemy" +"1456123458797","d1 <- density(acuT$chronicity)","Gemy" +"1456123458799","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456123458801","hist(acuC$chronicity, breaks = seq(0, 56, 4), xlab = Age, main = Control Cases,","Gemy" +"1456123458802","freq = FALSE)","Gemy" +"1456123458822","d2 <- density(acuC$chronicity)","Gemy" +"1456123458824","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456123458825","par(mfrow = c(1,1))","Gemy" +"1456123479900","","Gemy" +"1456123479901","t.test(x = acuT$chronicity, y = acuC$chronicity, alternative = two.sided,","Gemy" +"1456123479916","var.equal = FALSE)","Gemy" +"1456123479920","","Gemy" +"1456123479921","ks.test(x = acuT$chronicity, y = acuC$chronicity, alternative = two.sided)","Gemy" +"1456123543588","summary(acuT$sex)","Gemy" +"1456123543590","summary(acuC$sex)","Gemy" +"1456123543645","var(acuT$sex)","Gemy" +"1456123543646","var(acuC$sex)","Gemy" +"1456123543647","","Gemy" +"1456123543648","(mean(acuT$sex) - mean(acuC$sex)) /","Gemy" +"1456123543648","sqrt(((var(acuT$sex) + var(acuC$sex)) / 2))","Gemy" +"1456123543650","","Gemy" +"1456123543651","var(acuT$sex)/var(acuC$sex)","Gemy" +"1456123543652","par(mfrow = c(2,1))","Gemy" +"1456123543653","(t1 <- table(acuT$sex) / sum(table(acuT$sex)))","Gemy" +"1456123543655","barplot(t1)","Gemy" +"1456123543719","(t2 <- table(acuC$sex) / sum(table(acuC$sex)))","Gemy" +"1456123543721","barplot(t2)","Gemy" +"1456123543735","par(mfrow = c(1,1))","Gemy" +"1456123543736","","Gemy" +"1456123543737","(tt1 <- with(data = acupun, table(pk2, sex)))","Gemy" +"1456123543750","prop.table(tt1, margin = 2)","Gemy" +"1456123543904","chisq.test(tt1)","Gemy" +"1456123543910","","Gemy" +"1456123543911","fisher.test(tt1)","Gemy" +"1456124049104","load(file = file.choose())","Gemy" +"1456124053920","dim(acupun)","Gemy" +"1456124053921","","Gemy" +"1456124053945","acuT <- acupun[acupun$group == 1,]","Gemy" +"1456124053946","dim(acuT)","Gemy" +"1456124053946","","Gemy" +"1456124053947","acuC <- acupun[acupun$group == 0,]","Gemy" +"1456124053947","dim(acuC)","Gemy" +"1456124138931","","Gemy" +"1456124138932","t.test(x = acuT$chronicity, y = acuC$chronicity, alternative = two.sided,","Gemy" +"1456124138977","var.equal = FALSE)","Gemy" +"1456124138984","","Gemy" +"1456124138985","ks.test(x = acuT$chronicity, y = acuC$chronicity, alternative = two.sided)","Gemy" +"1456124366488","","Gemy" +"1456124366489","var(acuT$sex)/var(acuC$sex)","Gemy" +"1456124366493","par(mfrow = c(2,1))","Gemy" +"1456124366506","(t1 <- table(acuT$sex) / sum(table(acuT$sex)))","Gemy" +"1456124366508","barplot(t1)","Gemy" +"1456124366527","(t2 <- table(acuC$sex) / sum(table(acuC$sex)))","Gemy" +"1456124366528","barplot(t2)","Gemy" +"1456124366539","par(mfrow = c(1,1))","Gemy" +"1456124425098","summary(acuT$migraine)","Gemy" +"1456124425101","summary(acuC$migraine)","Gemy" +"1456124425103","var(acuT$migraine)","Gemy" +"1456124425104","var(acuC$migraine)","Gemy" +"1456124425105","","Gemy" +"1456124425105","(mean(acuT$migraine) - mean(acuC$migraine)) /","Gemy" +"1456124425106","sqrt(((var(acuT$migraine) + var(acuC$migraine)) / 2))","Gemy" +"1456124425107","","Gemy" +"1456124425107","var(acuT$migraine)/var(acuC$migraine)","Gemy" +"1456124425108","par(mfrow = c(2,1))","Gemy" +"1456124425108","(t1 <- table(acuT$migraine) / sum(table(acuT$migraine)))","Gemy" +"1456124425110","barplot(t1)","Gemy" +"1456124425148","(t2 <- table(acuC$migraine) / sum(table(acuC$migraine)))","Gemy" +"1456124425149","barplot(t2)","Gemy" +"1456124425157","par(mfrow = c(1,1))","Gemy" +"1456124480723","","Gemy" +"1456124480723","par(mfrow = c(2,1))","Gemy" +"1456124480738","range(acupun$pk2)","Gemy" +"1456124480739","hist(acuT$pk2, breaks = seq(0, 100, 2), xlab = pk2, main = Treated Cases,","Gemy" +"1456124480739","freq = FALSE)","Gemy" +"1456124480781","d1 <- density(acuT$pk2)","Gemy" +"1456124480786","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456124480787","hist(acuC$pk2, breaks = seq(0, 100, 2), xlab = pk2, main = Control Cases,","Gemy" +"1456124480788","freq = FALSE)","Gemy" +"1456124480804","d2 <- density(acuC$pk2)","Gemy" +"1456124480806","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456124480807","par(mfrow = c(1,1))","Gemy" +"1456124535872","","Gemy" +"1456124535873","par(mfrow = c(2,1))","Gemy" +"1456124535888","range(acupun$pk1)","Gemy" +"1456124535888","hist(acuT$pk1, breaks = seq(0, 100, 2), xlab = pk1, main = Treated Cases,","Gemy" +"1456124535889","freq = FALSE)","Gemy" +"1456124535926","d1 <- density(acuT$pk1)","Gemy" +"1456124535929","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456124535930","hist(acuC$pk2, breaks = seq(0, 100, 2), xlab = pk1, main = Control Cases,","Gemy" +"1456124535931","freq = FALSE)","Gemy" +"1456124535948","d2 <- density(acuC$pk1)","Gemy" +"1456124535951","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456124535952","par(mfrow = c(1,1))","Gemy" +"1456124574023","lm1 <- lm(pk2 ~ pk2, data = acupun)","Gemy" +"1456124574029","summary(lm1)","Gemy" +"1456124597540","lm1 <- lm(pk2 ~ pk1, data = acupun)","Gemy" +"1456124597543","summary(lm1)","Gemy" +"1456124635066","t.test(x = acuT$pk2, y = acuC$pk2, alternative = two.sided,","Gemy" +"1456124635067","var.equal = FALSE)","Gemy" +"1456124694423","","Gemy" +"1456124694428","t.test(x = acuT$pk2, y = acuC$pk2, alternative = two.sided,","Gemy" +"1456124694428","var.equal = TRUE)","Gemy" +"1456254636760","","Gemy" +"1456254636764","load(file = file.choose())","Gemy" +"1456254647046","dim(acupun)","Gemy" +"1456254647047","","Gemy" +"1456254647048","acuT <- acupun[acupun$group == 1,]","Gemy" +"1456254647049","dim(acuT)","Gemy" +"1456254647050","","Gemy" +"1456254647050","acuC <- acupun[acupun$group == 0,]","Gemy" +"1456254647051","dim(acuC)","Gemy" +"1456254658968","View(acupun)","Gemy" +"1456255657742","","Gemy" +"1456255657747","n <- 1000","Gemy" +"1456255657748","P <- runif(n, 0, 10) + rnorm(n)","Gemy" +"1456255657750","","Gemy" +"1456255657750","probD <- ( exp(-2 + .2*P) / (1 + exp(-2 + .2*P)) )","Gemy" +"1456255657751","hist(probD, breaks = 25)","Gemy" +"1456255657801","","Gemy" +"1456255657802","compares <- runif(n)","Gemy" +"1456255657803","D <- ifelse(probD >= compares, 1, 0)","Gemy" +"1456255657804","","Gemy" +"1456255657805","cor(D, P)","Gemy" +"1456255717695","","Gemy" +"1456255717700","set.seed(249834)","Gemy" +"1456255717701","","Gemy" +"1456255717702","n <- 1000","Gemy" +"1456255717702","P <- runif(n, 0, 10) + rnorm(n)","Gemy" +"1456255717703","","Gemy" +"1456255717703","probD <- ( exp(-2 + .2*P) / (1 + exp(-2 + .2*P)) )","Gemy" +"1456255717704","hist(probD, breaks = 25)","Gemy" +"1456255717738","","Gemy" +"1456255717738","compares <- runif(n)","Gemy" +"1456255717739","D <- ifelse(probD >= compares, 1, 0)","Gemy" +"1456255717740","","Gemy" +"1456255717740","cor(D, P)","Gemy" +"1456255717742","","Gemy" +"1456255717742","","Gemy" +"1456255717743","Y <- 100 + 8*D + 2*P + rnorm(n, mean = 0, sd = 3)","Gemy" +"1456255717744","","Gemy" +"1456255717744","cor(Y, D)","Gemy" +"1456255717745","cor(Y, P)","Gemy" +"1456255717746","","Gemy" +"1456255717747","mnD1 <- mean(Y[D == 1])","Gemy" +"1456255717747","mnD0 <- mean(Y[D == 0])","Gemy" +"1456255717748","(tau_naive <- mnD1 - mnD0)","Gemy" +"1456255717748","","Gemy" +"1456255717749","","Gemy" +"1456255717750","df <- data.frame(cbind(D, Y, P))","Gemy" +"1456255717752","","Gemy" +"1456255717753","dfOrd <- df[order(P),]","Gemy" +"1456255717754","head(dfOrd)","Gemy" +"1456255717758","","Gemy" +"1456255717759","","Gemy" +"1456255717759","","Gemy" +"1456255717759","(withinStrata <-","Gemy" +"1456255717760","by(data <- dfOrd,","Gemy" +"1456255717760","INDICES <- factor(rep(1","Gemy" +"10, each = 100)),","","Gemy" +"1456255717760","FUN <- function(dat) mean(dat$Y[dat$D == 1]) - mean(dat$Y[dat$D == 0]) ) )","Gemy" +"1456255717767","mean(withinStrata)","Gemy" +"1456255717767","","Gemy" +"1456255717768","","Gemy" +"1456255717768","","Gemy" +"1456255717769","","Gemy" +"1456255717769","","Gemy" +"1456255717770","lm1 <- lm(Y ~ D)","Gemy" +"1456255717780","summary(lm1)","Gemy" +"1456255717859","","Gemy" +"1456255717860","","Gemy" +"1456255717860","lm2 <- lm(Y ~ D + P)","Gemy" +"1456255717863","summary(lm2)","Gemy" +"1456255717869","","Gemy" +"1456260593180","","Gemy" +"1456260593183","","Gemy" +"1456260593183","summary(acuT$age)","Gemy" +"1456260593189","summary(acuC$age)","Gemy" +"1456260593191","var(acuT$age)","Gemy" +"1456260593192","var(acuC$age)","Gemy" +"1456260593193","","Gemy" +"1456260593194","(mean(acuT$age) - mean(acuC$age)) /","Gemy" +"1456260593194","sqrt( ((var(acuT$age) + var(acuC$age)) / 2) )","Gemy" +"1456260593196","","Gemy" +"1456260593196","var(acuT$age)/var(acuC$age)","Gemy" +"1456260593197","","Gemy" +"1456260593198","par(mfrow = c(2,1))","Gemy" +"1456260593217","range(acupun$age)","Gemy" +"1456260593218","hist(acuT$age, breaks = seq(15, 70, 5), xlab = Age, main = Treated Case,","Gemy" +"1456260593218","freq = FALSE)","Gemy" +"1456260593244","d1 <- density(acuT$age)","Gemy" +"1456260593250","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456260593252","hist(acuC$age, breaks = seq(15, 70, 5), xlab = Age, main = Control Cases,","Gemy" +"1456260593252","freq = FALSE)","Gemy" +"1456260593267","d2 <- density(acuC$age)","Gemy" +"1456260593269","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456260593270","par(mfrow = c(1,1))","Gemy" +"1456260593270","","Gemy" +"1456260593271","t.test(x = acuT$age, y = acuC$age, alternative = two.sided,","Gemy" +"1456260593271","var.equal = FALSE)","Gemy" +"1456260593282","","Gemy" +"1456260593283","ks.test(x = acuT$age, y = acuC$age, alternative = two.sided)","Gemy" +"1456260793580","","Gemy" +"1456260793606","summary(acuT$chronicity)","Gemy" +"1456260793609","summary(acuC$chronicity)","Gemy" +"1456260793611","var(acuT$chronicity)","Gemy" +"1456260793612","var(acuC$chronicity)","Gemy" +"1456260793612","","Gemy" +"1456260793613","(mean(acuT$chronicity) - mean(acuC$chronicity)) /","Gemy" +"1456260793613","sqrt( ((var(acuT$chronicity) + var(acuC$chronicity)) / 2) )","Gemy" +"1456260793614","","Gemy" +"1456260793614","var(acuT$chronicity)/var(acuC$chronicity)","Gemy" +"1456260793615","","Gemy" +"1456260793615","par(mfrow = c(2,1))","Gemy" +"1456260793616","range(acupun$chronicity)","Gemy" +"1456260793617","hist(acuT$chronicity, breaks = seq(0, 56, 4), xlab = Age, main = Treated Case,","Gemy" +"1456260793617","freq = FALSE)","Gemy" +"1456260793658","d1 <- density(acuT$chronicity)","Gemy" +"1456260793659","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456260793660","hist(acuC$chronicity, breaks = seq(0, 56, 4), xlab = Age, main = Control Cases,","Gemy" +"1456260793661","freq = FALSE)","Gemy" +"1456260793676","d2 <- density(acuC$chronicity)","Gemy" +"1456260793678","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456260793679","par(mfrow = c(1,1))","Gemy" +"1456260793680","","Gemy" +"1456260793680","t.test(x = acuT$chronicity, y = acuC$chronicity, alternative = two.sided,","Gemy" +"1456260793680","var.equal = FALSE)","Gemy" +"1456260793683","","Gemy" +"1456260793683","ks.test(x = acuT$chronicity, y = acuC$chronicity, alternative = two.sided)","Gemy" +"1456260974652","","Gemy" +"1456260974679","par(mfrow = c(2,1))","Gemy" +"1456260974680","range(acupun$chronicity)","Gemy" +"1456260974681","hist(acuT$chronicity, breaks = seq(0, 56, 4), xlab = Chronicity, main = Treated Case,","Gemy" +"1456260974682","freq = FALSE)","Gemy" +"1456260974729","d1 <- density(acuT$chronicity)","Gemy" +"1456260974730","lines(d1, col = 5, lwd = 3, lty = 2)","Gemy" +"1456260974731","hist(acuC$chronicity, breaks = seq(0, 56, 4), xlab = Chronicity, main = Control Cases,","Gemy" +"1456260974731","freq = FALSE)","Gemy" +"1456260974744","d2 <- density(acuC$chronicity)","Gemy" +"1456260974745","lines(d2, col = 6, lwd = 3, lty = 2)","Gemy" +"1456260974747","par(mfrow = c(1,1))","Gemy" +"1456261853416","","Gemy" +"1456261853431","summary(acuT$sex)","Gemy" +"1456261853434","summary(acuC$sex)","Gemy" +"1456261853435","var(acuT$sex)","Gemy" +"1456261853436","var(acuC$sex)","Gemy" +"1456261853438","","Gemy" +"1456261853438","(mean(acuT$sex) - mean(acuC$sex)) /","Gemy" +"1456261853438","sqrt(((var(acuT$sex) + var(acuC$sex)) / 2))","Gemy" +"1456261853440","","Gemy" +"1456261853440","var(acuT$sex)/var(acuC$sex)","Gemy" +"1456261853441","par(mfrow = c(2,1))","Gemy" +"1456261853442","(t1 <- table(acuT$sex) / sum(table(acuT$sex)))","Gemy" +"1456261853444","barplot(t1)","Gemy" +"1456261853479","(t2 <- table(acuC$sex) / sum(table(acuC$sex)))","Gemy" +"1456261853481","barplot(t2)","Gemy" +"1456261853489","par(mfrow = c(1,1))","Gemy" +"1456261853490","","Gemy" +"1456261853490","(tt1 <- with(data = acupun, table(pk2, sex)))","Gemy" +"1456261853501","prop.table(tt1, margin = 2)","Gemy" +"1456261853518","chisq.test(tt1)","Gemy" +"1456261853523","","Gemy" +"1456261853523","fisher.test(tt1)","Gemy" +"1456262012476","par(mfrow = c(2,1))","Gemy" +"1456262012579","(t1 <- table(acuT$sex) / sum(table(acuT$sex)))","Gemy" +"1456262012580","barplot(t1)","Gemy" +"1456262012596","(t2 <- table(acuC$sex) / sum(table(acuC$sex)))","Gemy" +"1456262012598","barplot(t2)","Gemy" +"1456262012605","par(mfrow = c(1,1))","Gemy" +"1456262054680","par(mfrow = c(2,1))","Gemy" +"1456262054694","(t1 <- table(acuT$sex) / sum(table(acuT$sex)))","Gemy" +"1456262054697","barplot(t1)","Gemy" +"1456262054711","(t2 <- table(acuC$sex) / sum(table(acuC$sex)))","Gemy" +"1456262054713","barplot(t2)","Gemy" +"1456262054720","par(mfrow = c(1,1))","Gemy" +"1456262258708","","Gemy" +"1456262258708","(tt1 <- with(data = acupun, table(pk2, sex)))","Gemy" +"1456262258753","prop.table(tt1, margin = 2)","Gemy" +"1456262258764","chisq.test(tt1)","Gemy" +"1456262442060","","Gemy" +"1456262442061","summary(acuT$migrane)","Gemy" +"1456262442086","summary(acuC$migrane)","Gemy" +"1456262442087","var(acuT$migrane)","Gemy" +"1456262442088","var(acuC$migrane)","Gemy" +"1456262442089","","Gemy" +"1456262442090","(mean(acuT$migrane) - mean(acuC$migrane)) /","Gemy" +"1456262442090","sqrt(((var(acuT$migrane) + var(acuC$migrane)) / 2))","Gemy" +"1456262442092","","Gemy" +"1456262442092","var(acuT$migrane)/var(acuC$migrane)","Gemy" +"1456262442093","par(mfrow = c(2,1))","Gemy" +"1456262442094","(t1 <- table(acuT$migrane) / sum(table(acuT$migrane)))","Gemy" +"1456262442095","barplot(t1)","Gemy" +"1456262442122","(t2 <- table(acuC$migrane) / sum(table(acuC$migrane)))","Gemy" +"1456262442124","barplot(t2)","Gemy" +"1456262442126","par(mfrow = c(1,1))","Gemy" +"1456262503702","summary(acuT$migraine)","Gemy" +"1456262503706","summary(acuC$migraine)","Gemy" +"1456262503707","var(acuT$migraine)","Gemy" +"1456262503708","var(acuC$migraine)","Gemy" +"1456262503711","","Gemy" +"1456262503711","(mean(acuT$migraine) - mean(acuC$migraine)) /","Gemy" +"1456262503712","sqrt(((var(acuT$migraine) + var(acuC$migraine)) / 2))","Gemy" +"1456262503713","","Gemy" +"1456262503713","var(acuT$migraine)/var(acuC$migraine)","Gemy" +"1456262503714","par(mfrow = c(2,1))","Gemy" +"1456262503715","(t1 <- table(acuT$migraine) / sum(table(acuT$migraine)))","Gemy" +"1456262503717","barplot(t1)","Gemy" +"1456262503753","(t2 <- table(acuC$migraine) / sum(table(acuC$migraine)))","Gemy" +"1456262503754","barplot(t2)","Gemy" +"1456262503762","par(mfrow = c(1,1))","Gemy" +"1456262503763","","Gemy" +"1456262503763","(tt1 <- with(data = acupun, table(pk2, migraine)))","Gemy" +"1456262503771","prop.table(tt1, margin = 2)","Gemy" +"1456262503783","chisq.test(tt1)","Gemy" +"1456263063156","","Gemy" +"1456263063163","","Gemy" +"1456263063163","","Gemy" +"1456263063163","","Gemy" +"1456263063164","lm1 <- lm(pk2 ~ treat, data = acupun)","Gemy" +"1456263063172","summary(lm1)","Gemy" +"1456263063189","","Gemy" +"1456263063189","t.test(x = acuT$pk2, y = acuC$pk2, alternative = two.sided,","Gemy" +"1456263063190","var.equal = FALSE)","Gemy" +"1456263063194","","Gemy" +"1456263063195","","Gemy" +"1456263063195","t.test(x = acuT$pk2, y = acuC$pk2, alternative = two.sided,","Gemy" +"1456263063195","var.equal = TRUE)","Gemy" +"1456263063198","","Gemy" +"1456263063198","lm2 <- lm(pk2 ~ treat + pk1 + age + chronicity, data = acupun)","Gemy" +"1456263063201","summary(lm2)","Gemy" +"1456263063206","lm3 <- lm(pk2 ~ treat + pk1 + sex + migrane , data = acupun)","Gemy" +"1456263063209","summary(lm3)","Gemy" +"1456263108784","","Gemy" +"1456263108785","lm1 <- lm(pk2 ~ pk1, data = acupun)","Gemy" +"1456263108796","summary(lm1)","Gemy" +"1456263172945","","Gemy" +"1456263172950","lm1 <- lm(pk2 ~ group, data = acupun)","Gemy" +"1456263172953","summary(lm1)","Gemy" +"1456263389203","","Gemy" +"1456263389204","lm2 <- lm(pk2 ~ group + pk1 + age + chronicity, data = acupun)","Gemy" +"1456263389211","summary(lm2)","Gemy" +"1456263389218","lm3 <- lm(pk2 ~ group + pk1 + sex + migrane , data = acupun)","Gemy" +"1456263389221","summary(lm3)","Gemy" +"1456263405320","","Gemy" +"1456263405321","lm2 <- lm(pk2 ~ group + pk1 + age + chronicity, data = acupun)","Gemy" +"1456263405337","summary(lm2)","Gemy" +"1456263405343","lm3 <- lm(pk2 ~ group + pk1 + sex + migraine , data = acupun)","Gemy" +"1456263405347","summary(lm3)","Gemy" +"1456263825301","","Gemy" +"1456263825306","t.test(x = acuT$pk2, y = acuC$pk2, alternative = two.sided,","Gemy" +"1456263825307","var.equal = FALSE)","Gemy" +"1456263825309","","Gemy" +"1456263825309","","Gemy" +"1456263825309","t.test(x = acuT$pk2, y = acuC$pk2, alternative = two.sided,","Gemy" +"1456263825310","var.equal = TRUE)","Gemy" +"1456264179772","","Gemy" +"1456264179773","t.test(x = acuT$pk1, y = acuC$pk1, alternative = two.sided,","Gemy" +"1456264179777","var.equal = FALSE)","Gemy" +"1456264179780","","Gemy" +"1456264179780","","Gemy" +"1456264179781","t.test(x = acuT$pk1, y = acuC$pk1, alternative = two.sided,","Gemy" +"1456264179781","var.equal = TRUE)","Gemy" +"1459815199766","","Gemy" +"1459815199773","load(file = file.choose())","Gemy" +"1459815244798","dim(datAn2) ","Gemy" +"1459815272403","head(datAn2)","Gemy" +"1459815550409","datAn2$C6R4MSCL <- NULL","Gemy" +"1459815565001","head(datAn2)","Gemy" +"1459816071190","","Gemy" +"1459816071205","(cov_names <- names(datAn2)[-(16","Gemy" +"17)])","","Gemy" +"1459816077590","View(datAn2)","Gemy" +"1459816077839","View(datAn2)","Gemy" +"1459816275948","","Gemy" +"1459816275983","","Gemy" +"1459816275983","smd_vr_DF(covars = cov_names, dat = datAn2, trt = datAn2$F5SPECS, plot = TRUE)","Gemy" +"1459816573524","","Gemy" +"1459816573530","smd_vr <- function(trt, covar, wts = rep(1, lenght(cov)))","Gemy" +"1459816573530","{","Gemy" +"1459816596623","","Gemy" +"1459816596624","smd_vr <- function(trt, covar, wts = rep(1, lenght(cov)))","Gemy" +"1459816600561","}","Gemy" +"1459816602337","","Gemy" +"1459816602337","smd_vr <- function(trt, covar, wts = rep(1, lenght(cov)))","Gemy" +"1459816610479","clear","Gemy" +"1459816677936","smd_vr_DF(covars = cov_names, dat = datAn2, trt = datAn2$F5SPECS, plot = TRUE)","Gemy" +"1459816921019","","Gemy" +"1459816921025","smds <- smd_vr_DF(covars = cov_names,","Gemy" +"1459816921025","dat = datAn2,","Gemy" +"1459816921025","trt = datAn2$F5SPECS, plot = TRUE)","Gemy" +"1459816921026","smds","Gemy" +"1459816940512","View(smd_vr)","Gemy" +"1459817294853","smds","Gemy" +"1459817366841","","Gemy" +"1459817366842","smd_vr <- function(trt, covar, wts = rep(1, lenght(cov)))","Gemy" +"1459817366846","{","Gemy" +"1459817366846","","Gemy" +"1459817366847","","Gemy" +"1459817366847","","Gemy" +"1459817366847","","Gemy" +"1459817366848","trt_ind <- trt == 1","Gemy" +"1459817366848","ctrl_ind <- trt == 0","Gemy" +"1459817366849","","Gemy" +"1459817366849","nt <- sum(trt == 1)","Gemy" +"1459817366850","nc <- sum(trt == 0)","Gemy" +"1459817366850","","Gemy" +"1459817366851","out <- NULL","Gemy" +"1459817366851","","Gemy" +"1459817366852","out[1] <- (mean(covar[trt_ind]) - mean(covar[ctrl_ind])) /","Gemy" +"1459817366852","sqrt( ( (nt - 1)*var(covar[trt_ind]) + (nc - 1)*var(covar[ctrl_ind]) ) /","Gemy" +"1459817366853","(nt + nc - 2) )","Gemy" +"1459817366853","","Gemy" +"1459817366854","out[2] <- var(covar[trt_ind]) / var(covar[ctrl_ind])","Gemy" +"1459817366854","out <- t(out)","Gemy" +"1459817366855","colnames(out) <- c(St Mean Diff, Var Ratio)","Gemy" +"1459817366855","return(out)","Gemy" +"1459817366856","}","Gemy" +"1459817366856","smd_vr <- function(covar, trt, wts = rep(1, length(covar)))","Gemy" +"1459817366857","{","Gemy" +"1459817366857","","Gemy" +"1459817366857","","Gemy" +"1459817366858","","Gemy" +"1459817366858","covar <- as.numeric(as.character(covar)) ","Gemy" +"1459817366859","covar.by.sel <- split(covar, trt)","Gemy" +"1459817366859","wts.by.sel <- split(wts, trt)","Gemy" +"1459817366859","wtmn.0 <- weighted.mean(covar.by.sel[[1]], w = wts.by.sel[[1]], na.rm = TRUE)","Gemy" +"1459817366859","wtmn.1 <- weighted.mean(covar.by.sel[[2]], w = wts.by.sel[[2]], na.rm = TRUE)","Gemy" +"1459817366860","wt.mn.diff <- wtmn.1 - wtmn.0","Gemy" +"1459817366860","wtvar.0 <- cov.wt(matrix(covar.by.sel[[1]], length(covar.by.sel[[1]]), 1), wt = wts.by.sel[[1]])[[1]]","Gemy" +"1459817366861","wtvar.1 <- cov.wt(matrix(covar.by.sel[[2]], length(covar.by.sel[[2]]), 1), wt = wts.by.sel[[2]])[[1]]","Gemy" +"1459817366861","pooled.wt.var <- (wtvar.0*sum(wts.by.sel[[1]]) + wtvar.1*sum(wts.by.sel[[2]]))/sum(wts)","Gemy" +"1459817366862","smds <- (wt.mn.diff)/sqrt(pooled.wt.var)","Gemy" +"1459817366862","out <- t(c(smds, wtvar.1/wtvar.0))","Gemy" +"1459817366863","colnames(out) <- c(St Mean Diff, Var Ratio)","Gemy" +"1459817366863","out","Gemy" +"1459817366864","}","Gemy" +"1459817366865","smd_vr_DF <- function(covars, dat, trt, wts = rep(1, length(trt)), plot = FALSE)","Gemy" +"1459817366866","{","Gemy" +"1459817366866","","Gemy" +"1459817366866","","Gemy" +"1459817366867","","Gemy" +"1459817366867","","Gemy" +"1459817366868","output <- matrix(0, length(covars), 2)","Gemy" +"1459817366868","colnames(output) <- c(St Mean Diff, Var Ratio)","Gemy" +"1459817366868","","Gemy" +"1459817366869","for(i in 1","Gemy" +"length(covars)) {","","Gemy" +"1459817366869","output[i,] <- smd_vr(trt = trt, covar = dat[,covars[i]], wts = wts)","Gemy" +"1459817366870","}","Gemy" +"1459817366870","rownames(output) <- covars","Gemy" +"1459817366871","","Gemy" +"1459817366872","if(plot) {","Gemy" +"1459817366872","plot(output, pch = 19, xlim = c(-1, 1), ylim = c(0, 3.5))","Gemy" +"1459817366872","abline(v = c(-.1, .1), lwd = 2, lty = 2)","Gemy" +"1459817366873","abline(h = c(4/5, 5/4), lwd = 2, lty = 2)","Gemy" +"1459817366873","lbls <- rownames(output)","Gemy" +"1459817366874","for (i in 1","Gemy" +"length(lbls)) {","","Gemy" +"1459817366874","if(output[i,2] < 5/4 & output[i,2] > .8 & output[i,1] < .1 & output[i,1] > -.1) {","Gemy" +"1459817366875","lbls[i] <- ","Gemy" +"1459817366875","}","Gemy" +"1459817366876","}","Gemy" +"1459817366877","text(output, labels = lbls, adj = c(0, -.3))","Gemy" +"1459817366877","}","Gemy" +"1459817366878","output","Gemy" +"1459817366878","}","Gemy" +"1459817366879","","Gemy" +"1459817366880","ovlp <- function(trt, lps)","Gemy" +"1459817366880","{","Gemy" +"1459817366880","","Gemy" +"1459817366880","require(optmatch)","Gemy" +"1459817366881","","Gemy" +"1459817366881","","Gemy" +"1459817366881","tt <- t.test(x = lps[trt==1], y = lps[trt==0], alternative = two.sided,","Gemy" +"1459817366882","var.equal = FALSE)$p.value","Gemy" +"1459817366882","","Gemy" +"1459817366882","ks <- ks.test(x = lps[trt==1], y = lps[trt==0], alternative = two.sided)$p.value","Gemy" +"1459817366884","par(mfrow = c(2,1))","Gemy" +"1459817366885","rc <- range(lps)","Gemy" +"1459817366885","brks <- seq(from = rc[1] - diff(rc)/30, to = rc[2] + diff(rc)/30, by = diff(rc)/30)","Gemy" +"1459817366886","hist(lps[trt==1], breaks = brks, xlab = , main = Treated Cases,","Gemy" +"1459817366886","freq = FALSE)","Gemy" +"1459817366887","d1 <- density(lps[trt==1])","Gemy" +"1459817366888","lines(d1, col = 2, lwd = 1, lty = 1)","Gemy" +"1459817366889","abline(v = c(range(lps[trt==1])), col = 3, lwd = 3)","Gemy" +"1459817366890","hist(lps[trt==0], breaks = brks, xlab = , main = Control Cases,","Gemy" +"1459817366890","freq = FALSE)","Gemy" +"1459817366891","d2 <- density(lps[trt==0])","Gemy" +"1459817366892","lines(d2, col = 2, lwd = 1, lty = 1)","Gemy" +"1459817366892","abline(v = c(range(lps[trt==0])), col = 3, lwd = 3)","Gemy" +"1459817366893","par(mfrow = c(1,1))","Gemy" +"1459817366894","}","Gemy" +"1459817366895","","Gemy" +"1459817366895","ovlp_ind <- function(trt, lps, caliper = 0.1)","Gemy" +"1459817366896","{","Gemy" +"1459817366896","nt <- sum(trt == 1); nc <- sum(trt == 0)","Gemy" +"1459817366896","SDpool <- sqrt( ( (nt - 1)*var(lps[trt == 1]) + (nc - 1)*var(lps[trt == 0]) ) /","Gemy" +"1459817366897","(nt + nc - 2) )","Gemy" +"1459817366897","","Gemy" +"1459817366897","diffs <- match_on(trt ~ lps, method = euclidean)","Gemy" +"1459817366898","smds <- diffs/SDpool ","Gemy" +"1459817366898","fun <- function(vec) {min(vec) <= caliper}","Gemy" +"1459817366898","trtOvlp <- apply(smds, 1, fun) ","Gemy" +"1459817366899","ctrlOvlp <- apply(smds, 2, fun) ","Gemy" +"1459817366899","drop1 <- which(trt==1)[!trtOvlp]","Gemy" +"1459817366900","drop0 <- which(trt==0)[!ctrlOvlp]","Gemy" +"1459817366900","ind <- !logical(length(lps))","Gemy" +"1459817366901","ind[c(drop1, drop0)] <- FALSE","Gemy" +"1459817366901","ind","Gemy" +"1459817366902","}","Gemy" +"1459817366903","var_wt <- function(x, wt)","Gemy" +"1459817366903","{","Gemy" +"1459817366904","wt_m <- x %*% wt / sum(wt)","Gemy" +"1459817366904","wt_var <- x^2 %*% wt / sum(wt) - m^2","Gemy" +"1459817366904","out <- c(wt_m, wt_var)","Gemy" +"1459817366905","out","Gemy" +"1459817366905","}","Gemy" +"1459817420100","","Gemy" +"1459817420108","","Gemy" +"1459817420109","smd_vr_DF(covars = cov_names, dat = datAn2, trt = datAn2$F5SPECS, plot = TRUE)","Gemy" +"1459817802058","","Gemy" +"1459817802059","","Gemy" +"1459817802060","smds <- smd_vr_DF(covars = cov_names,","Gemy" +"1459817802060","dat = datAn2,","Gemy" +"1459817802061","trt = datAn2$F5SPECS, plot = TRUE)","Gemy" +"1459817802239","smds","Gemy" +"1459817802240","","Gemy" +"1459817802241","lm1 <- lm(C6R4MSCL ~ F5SPECS, data = datAn2)","Gemy" +"1459817802246","summary(lm1)","Gemy" +"1459817970072","","Gemy" +"1459817970087","> lm1 <- lm(C6R4MSCL ~ F5SPECS, data = datAn2)","Gemy" +"1459817970088","Error in eval(expr, envir, enclos) ","Gemy" +" object C6R4RSCL not found","","Gemy" +"1459817970089","> summary(lm1)","Gemy" +"1459818167893","pfe1 <- lm(C6R4RSCL ~ F5SPECS, data = datAn2)","Gemy" +"1459818167920","summary(pfe1)","Gemy" +"1459818167925","pfe2 <- t.test(x = with(datAn2, C6R4RSCL[F5SPECS == 0]),","Gemy" +"1459818167926","y = with(datAn2, C6R4RSCL[F5SPECS == 1]),","Gemy" +"1459818167926","var.equal = TRUE)","Gemy" +"1459818167930","diff(pfe2$estimate)","Gemy" +"1459818167931","pfe2$p.value","Gemy" +"1459818167932","pfe3 <- t.test(x = with(datAn2, C6R4RSCL[F5SPECS == 0]),","Gemy" +"1459818167932","y = with(datAn2, C6R4RSCL[F5SPECS == 1]),","Gemy" +"1459818167933","var.equal = FALSE)","Gemy" +"1459818167935","diff(pfe3$estimate)","Gemy" +"1459818167936","pfe3$p.value","Gemy" +"1459818167936","boxplot(C6R4RSCL ~ F5SPECS, data = datAn2, main = Reading Scale Scores for Non-Special Ed (=0) and Special Ed (=1) Students)","Gemy" +"1459818167993","with(datAn2, by(C6R4RSCL, INDICES = F5SPECS, FUN = var))","Gemy" +"1459818590891","","Gemy" +"1459818590892","lm1 <- lm(C6R4RSCL ~ ., data = datAn2)","Gemy" +"1459818590919","summary(lm1)","Gemy" +"1459818590931","","Gemy" +"1459818590932","","Gemy" +"1459818590932","plot(C6R4RSCL ~ MIRT, data = datAn2)","Gemy" +"1459818591164","plot(C6R4RSCL ~ RIRT, data = datAn2)","Gemy" +"1459818591442","","Gemy" +"1459818591442","lm2 <- update(lm1, . ~ . + I(MIRT^2))","Gemy" +"1459818591473","summary(lm2)","Gemy" +"1459818591487","lm3 <- update(lm1, . ~ . + I(RIRT^2))","Gemy" +"1459818591924","summary(lm3)","Gemy" +"1459818591950","lm4 <- update(lm2, . ~ . + I(RIRT^2))","Gemy" +"1459818591983","summary(lm4)","Gemy" +"1459818591995","","Gemy" +"1459818591995","","Gemy" +"1459818591995","summary(lm2)","Gemy" +"1459818788479","","Gemy" +"1459818788480","dat1 <- subset(datAn2, subset = datAn2$F5SPECS == 1)","Gemy" +"1459818788486","dim(dat1)","Gemy" +"1459818788486","","Gemy" +"1459818788486","dat0 <- subset(datAn2, subset = datAn2$F5SPECS == 0)","Gemy" +"1459818788495","dim(dat0)","Gemy" +"1459818788495","","Gemy" +"1459818788496","lmY1 <- lm(C6R4RSCL ~ . - F5SPECS, data = dat1)","Gemy" +"1459818788502","summary(lmY1)","Gemy" +"1459818788509","","Gemy" +"1459818788510","lmY0 <- lm(C6R4RSCL ~ . - F5SPECS, data = dat0)","Gemy" +"1459818788540","summary(lmY0)","Gemy" +"1459818788548","","Gemy" +"1459818788548","","Gemy" +"1459818788549","Y1hats <- predict(lmY1, newdata = datAn2)","Gemy" +"1459818788557","Y0hats <- predict(lmY0, newdata = datAn2)","Gemy" +"1459818788568","(ATE_RE <- mean(Y1hats - Y0hats))","Gemy" +"1459818788570","","Gemy" +"1459818788571","Y0hatsATT <- predict(lmY0, newdata = dat1)","Gemy" +"1459818788575","(ATT_RE <- mean(dat1$C6R4RSCL - Y0hatsATT))","Gemy" +"1459818788576","","Gemy" +"1459818788576","","Gemy" +"1459818788576","","Gemy" +"1459818788577","","Gemy" +"1459818788577","library(boot)","Gemy" +"1459818788614","boot_fun <- function(dat, ind) {","Gemy" +"1459818788615","datB <- dat[ind,]","Gemy" +"1459818788615","dat1 <- subset(datB, subset = dat$F5SPECS == 1)","Gemy" +"1459818788615","dat0 <- subset(datB, subset = dat$F5SPECS == 0)","Gemy" +"1459818788616","lmY1 <- lm(C6R4RSCL ~ . - F5SPECS, data = dat1)","Gemy" +"1459818788616","lmY0 <- lm(C6R4RSCL ~ . - F5SPECS, data = dat0)","Gemy" +"1459818788617","Y1hats <- predict(lmY1, newdata = dat)","Gemy" +"1459818788617","Y0hats <- predict(lmY0, newdata = dat)","Gemy" +"1459818788617","ATE <- mean(Y1hats - Y0hats)","Gemy" +"1459818788618","ATE","Gemy" +"1459818788618","}","Gemy" +"1459818788619","boot_out <- boot(data = datAn2, statistic = boot_fun, R = 1000)","Gemy" +"1459818837687","boot_out","Gemy" +"1459818837691","","Gemy" +"1459819672232","","Gemy" +"1459819672233","glm1 <- glm(F5SPECS ~ . - C6R4RSCL, data = datAn2, family = binomial)","Gemy" +"1459819672399","ps1 <- predict(glm1, type = response)","Gemy" +"1459819672401","lin_ps1 <- log(ps1/(1 - ps1))","Gemy" +"1459819672402","","Gemy" +"1459819672402","ovlp(trt = datAn2$F5SPECS, lps = lin_ps1)","Gemy" +"1459819672485","","Gemy" +"1459819672485","library(optmatch)","Gemy" +"1459819672487","ovlp_ind1 <- ovlp_ind(trt = datAn2$F5SPECS, lps = lin_ps1, caliper = 0.1) ","Gemy" +"1459819672491","sum(ovlp_ind1)","Gemy" +"1459819672491","table(ovlp_ind1, datAn2$F5SPECS)","Gemy" +"1459819672492","","Gemy" +"1459819672492","ovlp(trt = datAn2$F5SPECS[ovlp_ind1], lps = lin_ps1[ovlp_ind1])","Gemy" +"1459819672494","","Gemy" +"1459819672495","","Gemy" +"1459819672495","","Gemy" +"1459819672495","","Gemy" +"1459819672496","","Gemy" +"1459819672496","eclsO <- datAn2[ovlp_ind1,]","Gemy" +"1459819672497","","Gemy" +"1459819672498","glm2 <- glm(F5SPECS ~ . - C6R4RSCL, data = eclsO, family = binomial)","Gemy" +"1459819672500","ps2 <- predict(glm2, type = response)","Gemy" +"1459819672500","lin_ps2 <- log(ps2/(1 - ps2))","Gemy" +"1459819672501","","Gemy" +"1459819672501","ovlp(trt = eclsO$F5SPECS, lps = lin_ps2)","Gemy" +"1459819672504","","Gemy" +"1459819672505","fm1 <- fullmatch(match_on(glm2), data = eclsO)","Gemy" +"1459819672505","summary(fm1) ","Gemy" +"1459819672506","table(fm1) ","Gemy" +"1459819672507","","Gemy" +"1459819672507","length(table(fm1)) ","Gemy" +"1459819672507","(frq <- table(fm1, eclsO$F5SPECS)) ","Gemy" +"1459819672508","matched(fm1) ","Gemy" +"1459819672509","","Gemy" +"1459819672509","","Gemy" +"1459819672509","","Gemy" +"1459819672509","","Gemy" +"1459819672510","(O <- table(eclsO$F5SPECS, fm1)) ","Gemy" +"1459819672510","(E <- outer(table(eclsO$F5SPECS), table(fm1)) / sum(O)) ","Gemy" +"1459819672511","(W <- E / O) ","Gemy" +"1459819672512","mtch_wts <- W[cbind(eclsO$F5SPECS + 1, fm1)] ","Gemy" +"1459819672512","cov_names <- names(datAn2)[-c(16","Gemy" +"17)] ","","Gemy" +"1459819672513","smds_fm <- smd_vr_DF(covars = cov_names, dat = eclsO,","Gemy" +"1459819672513","trt = eclsO$F5SPECS, wts = mtch_wts, plot = TRUE)","Gemy" +"1459819672514","","Gemy" +"1459819672514","","Gemy" +"1459819672515","","Gemy" +"1459819672515","","Gemy" +"1459819672515","summary(lm(C6R4RSCL ~ F5SPECS, data = eclsO, weights = mtch_wts))","Gemy" +"1459819672518","","Gemy" +"1459819672519","summary(lm(C6R4RSCL ~ F5SPECS + MIRT + RIRT, data = eclsO, weights = mtch_wts))","Gemy" +"1459819672523","","Gemy" +"1459819672524","summary(lm(C6R4RSCL ~ F5SPECS + MIRT + I(MIRT^2), data = eclsO, weights = mtch_wts))","Gemy" +"1459819672530","ATE_mtch <- lm(C6R4RSCL ~ F5SPECS, data = eclsO, weights = mtch_wts)","Gemy" +"1459819672532","summary(ATE_mtch)","Gemy" +"1459819672533","","Gemy" +"1459819672535","","Gemy" +"1459819672536","","Gemy" +"1459819672536","","Gemy" +"1459819672536","","Gemy" +"1459819672537","","Gemy" +"1459819672537","","Gemy" +"1459819672537","","Gemy" +"1459819672538","","Gemy" +"1459819672538","","Gemy" +"1459819672539","pm1 <- pairmatch(lin_ps2, z = eclsO$F5SPECS, data = eclsO)","Gemy" +"1459819672539","table(pm1, eclsO$F5SPECS, useNA = always)","Gemy" +"1459819672540","","Gemy" +"1459819672540","matched_dat <- eclsO[matched(pm1), ]","Gemy" +"1459819672541","dim(matched_dat)","Gemy" +"1459819672541","","Gemy" +"1459819672542","smds_pm <- smd_vr_DF(covars = cov_names, dat = matched_dat,","Gemy" +"1459819672542","trt = matched_dat$F5SPECS,","Gemy" +"1459819672542","wts = rep(1, nrow(matched_dat)), plot = TRUE)","Gemy" +"1459819672543","","Gemy" +"1459819672544","","Gemy" +"1459819672544","","Gemy" +"1459819672544","","Gemy" +"1459819672545","","Gemy" +"1459819672545","","Gemy" +"1459819672545","glmMIRT <- glm(F5SPECS ~ . - C6R4RSCL + I(MIRT^2), data = datAn2, family = binomial)","Gemy" +"1459819672748","psMIRT <- predict(glmMIRT, type = response)","Gemy" +"1459819672749","lin_psMIRT <- log(psMIRT/(1 - psMIRT))","Gemy" +"1459819672750","","Gemy" +"1459819672750","ovlp(trt = datAn2$F5SPECS, lps = lin_psMIRT)","Gemy" +"1459819672820","","Gemy" +"1459819672821","ovlpMIRT <- ovlp_ind(trt = datAn2$F5SPECS, lps = lin_psMIRT, caliper = 0.1) ","Gemy" +"1459819672822","sum(ovlpMIRT)","Gemy" +"1459819672823","table(ovlpMIRT, datAn2$F5SPECS)","Gemy" +"1459819672824","","Gemy" +"1459819672824","ovlp(trt = datAn2$F5SPECS[ovlpMIRT], lps = lin_ps3[ovlpMIRT])","Gemy" +"1459819672827","","Gemy" +"1459819672827","eclsMIRT <- datAn2[ovlpMIRT,]","Gemy" +"1459819672828","","Gemy" +"1459819672829","glm4 <- glm(F5SPECS ~ . - C6R4RSCL + I(MIRT^2), data = eclsMIRT, family = binomial)","Gemy" +"1459819672831","ps4 <- predict(glm4, type = response)","Gemy" +"1459819672832","lin_ps4 <- log(ps4/(1 - ps4))","Gemy" +"1459819672833","ovlp(trt = eclsO4$F5SPECS, lps = lin_ps4) ","Gemy" +"1459819672835","","Gemy" +"1459819672835","pm3 <- pairmatch(lin_ps4, z = eclsMIRT$F5SPECS, data = eclsMIRT)","Gemy" +"1459819672836","matched_dat4 <- eclsMIRT[matched(pm3),]","Gemy" +"1459819672836","dim(matched_dat4)","Gemy" +"1459819672837","","Gemy" +"1459819672837","smds_pm <- smd_vr_DF(covars = cov_names, dat = matched_dat4,","Gemy" +"1459819672838","trt = matched_dat4$F5SPECS,","Gemy" +"1459819672838","wts = rep(1, nrow(matched_dat4)), plot = TRUE)","Gemy" +"1459819672840","","Gemy" +"1459819672840","","Gemy" +"1459819672840","","Gemy" +"1459819672841","ATT_mtch <- lm(C6R4RSCL ~ F5SPECS, data = matched_dat4)","Gemy" +"1459819672843","summary(ATT_mtch)","Gemy" +"1459820061487","library(optmatch)","Gemy" +"1459820171108","library(optmatch)","Gemy" +"1459820436259","install.packages(optmatch)","Gemy" +"1459820451359","library(optmatch)","Gemy" +"1459820473723","","Gemy" +"1459820473729","glm1 <- glm(F5SPECS ~ . - C6R4RSCL, data = datAn2, family = binomial)","Gemy" +"1459820473874","ps1 <- predict(glm1, type = response)","Gemy" +"1459820473875","lin_ps1 <- log(ps1/(1 - ps1))","Gemy" +"1459820473876","","Gemy" +"1459820473876","ovlp(trt = datAn2$F5SPECS, lps = lin_ps1)","Gemy" +"1459820473948","","Gemy" +"1459820473949","library(optmatch)","Gemy" +"1459820473949","ovlp_ind1 <- ovlp_ind(trt = datAn2$F5SPECS, lps = lin_ps1, caliper = 0.1) ","Gemy" +"1459820475686","sum(ovlp_ind1)","Gemy" +"1459820475687","table(ovlp_ind1, datAn2$F5SPECS)","Gemy" +"1459820475697","","Gemy" +"1459820475697","ovlp(trt = datAn2$F5SPECS[ovlp_ind1], lps = lin_ps1[ovlp_ind1])","Gemy" +"1459820475796","","Gemy" +"1459820475796","","Gemy" +"1459820475797","","Gemy" +"1459820475797","","Gemy" +"1459820475797","","Gemy" +"1459820475798","eclsO <- datAn2[ovlp_ind1,]","Gemy" +"1459820475803","","Gemy" +"1459820475803","glm2 <- glm(F5SPECS ~ . - C6R4RSCL, data = eclsO, family = binomial)","Gemy" +"1459820476022","ps2 <- predict(glm2, type = response)","Gemy" +"1459820476023","lin_ps2 <- log(ps2/(1 - ps2))","Gemy" +"1459820476024","","Gemy" +"1459820476024","ovlp(trt = eclsO$F5SPECS, lps = lin_ps2)","Gemy" +"1459820476092","","Gemy" +"1459820476092","fm1 <- fullmatch(match_on(glm2), data = eclsO)","Gemy" +"1459820484736","summary(fm1) ","Gemy" +"1459820484761","table(fm1) ","Gemy" +"1459820484776","","Gemy" +"1459820484777","length(table(fm1)) ","Gemy" +"1459820484779","(frq <- table(fm1, eclsO$F5SPECS)) ","Gemy" +"1459820484798","matched(fm1) ","Gemy" +"1459820484968","","Gemy" +"1459820484969","","Gemy" +"1459820484970","","Gemy" +"1459820484971","","Gemy" +"1459820484971","(O <- table(eclsO$F5SPECS, fm1)) ","Gemy" +"1459820484991","(E <- outer(table(eclsO$F5SPECS), table(fm1)) / sum(O)) ","Gemy" +"1459820485012","(W <- E / O) ","Gemy" +"1459820485035","mtch_wts <- W[cbind(eclsO$F5SPECS + 1, fm1)] ","Gemy" +"1459820485036","cov_names <- names(datAn2)[-c(16","Gemy" +"17)] ","","Gemy" +"1459820485037","smds_fm <- smd_vr_DF(covars = cov_names, dat = eclsO,","Gemy" +"1459820485037","trt = eclsO$F5SPECS, wts = mtch_wts, plot = TRUE)","Gemy" +"1459820485178","","Gemy" +"1459820485178","","Gemy" +"1459820485178","","Gemy" +"1459820485179","","Gemy" +"1459820485179","summary(lm(C6R4RSCL ~ F5SPECS, data = eclsO, weights = mtch_wts))","Gemy" +"1459820485191","","Gemy" +"1459820485191","summary(lm(C6R4RSCL ~ F5SPECS + MIRT + RIRT, data = eclsO, weights = mtch_wts))","Gemy" +"1459820485222","","Gemy" +"1459820485222","summary(lm(C6R4RSCL ~ F5SPECS + MIRT + I(MIRT^2), data = eclsO, weights = mtch_wts))","Gemy" +"1459820485234","ATE_mtch <- lm(C6R4RSCL ~ F5SPECS, data = eclsO, weights = mtch_wts)","Gemy" +"1459820485240","summary(ATE_mtch)","Gemy" +"1459820485247","","Gemy" +"1459820485248","","Gemy" +"1459820485248","","Gemy" +"1459820485248","","Gemy" +"1459820485249","","Gemy" +"1459820485249","","Gemy" +"1459820485250","","Gemy" +"1459820485250","","Gemy" +"1459820485250","","Gemy" +"1459820485251","","Gemy" +"1459820485251","pm1 <- pairmatch(lin_ps2, z = eclsO$F5SPECS, data = eclsO)","Gemy" +"1459820503646","table(pm1, eclsO$F5SPECS, useNA = always)","Gemy" +"1459820503675","","Gemy" +"1459820503675","matched_dat <- eclsO[matched(pm1), ]","Gemy" +"1459820503680","dim(matched_dat)","Gemy" +"1459820503681","","Gemy" +"1459820503681","smds_pm <- smd_vr_DF(covars = cov_names, dat = matched_dat,","Gemy" +"1459820503682","trt = matched_dat$F5SPECS,","Gemy" +"1459820503682","wts = rep(1, nrow(matched_dat)), plot = TRUE)","Gemy" +"1459820503744","","Gemy" +"1459820503744","","Gemy" +"1459820503745","","Gemy" +"1459820503745","","Gemy" +"1459820503745","","Gemy" +"1459820503746","","Gemy" +"1459820503746","glmMIRT <- glm(F5SPECS ~ . - C6R4RSCL + I(MIRT^2), data = datAn2, family = binomial)","Gemy" +"1459820503955","psMIRT <- predict(glmMIRT, type = response)","Gemy" +"1459820503955","lin_psMIRT <- log(psMIRT/(1 - psMIRT))","Gemy" +"1459820503956","","Gemy" +"1459820503957","ovlp(trt = datAn2$F5SPECS, lps = lin_psMIRT)","Gemy" +"1459820504034","","Gemy" +"1459820504034","ovlpMIRT <- ovlp_ind(trt = datAn2$F5SPECS, lps = lin_psMIRT, caliper = 0.1) ","Gemy" +"1459820505479","sum(ovlpMIRT)","Gemy" +"1459820505479","table(ovlpMIRT, datAn2$F5SPECS)","Gemy" +"1459820505489","","Gemy" +"1459820505490","ovlp(trt = datAn2$F5SPECS[ovlpMIRT], lps = lin_ps3[ovlpMIRT])","Gemy" +"1459820505491","","Gemy" +"1459820505491","eclsMIRT <- datAn2[ovlpMIRT,]","Gemy" +"1459820505498","","Gemy" +"1459820505498","glm4 <- glm(F5SPECS ~ . - C6R4RSCL + I(MIRT^2), data = eclsMIRT, family = binomial)","Gemy" +"1459820505640","ps4 <- predict(glm4, type = response)","Gemy" +"1459820505640","lin_ps4 <- log(ps4/(1 - ps4))","Gemy" +"1459820505641","ovlp(trt = eclsO4$F5SPECS, lps = lin_ps4) ","Gemy" +"1459820505642","","Gemy" +"1459820505642","pm3 <- pairmatch(lin_ps4, z = eclsMIRT$F5SPECS, data = eclsMIRT)","Gemy" +"1459820519794","matched_dat4 <- eclsMIRT[matched(pm3),]","Gemy" +"1459820519804","dim(matched_dat4)","Gemy" +"1459820519805","","Gemy" +"1459820519805","smds_pm <- smd_vr_DF(covars = cov_names, dat = matched_dat4,","Gemy" +"1459820519806","trt = matched_dat4$F5SPECS,","Gemy" +"1459820519806","wts = rep(1, nrow(matched_dat4)), plot = TRUE)","Gemy" +"1459820519883","","Gemy" +"1459820519883","","Gemy" +"1459820519884","","Gemy" +"1459820519884","ATT_mtch <- lm(C6R4RSCL ~ F5SPECS, data = matched_dat4)","Gemy" +"1459820519888","summary(ATT_mtch)","Gemy" +"1459828264647","> ","Gemy" +"1459828264652","> load(file = file.choose())","Gemy" +"1459828264653","> dim(datAn2) ","Gemy" +"1459828264653","> head(datAn2)","Gemy" +"1459828310964","","Gemy" +"1459828310965","load(file = file.choose())","Gemy" +"1459828316748","dim(datAn2) ","Gemy" +"1459828316750","head(datAn2)","Gemy" +"1459828316761","","Gemy" +"1459828328562","datAn2$C6R4MSCL <- NULL","Gemy" +"1459828328563","head(datAn2)","Gemy" +"1459828344401","","Gemy" +"1459828344436","","Gemy" +"1459828344437","","Gemy" +"1459828344437","smd_vr_DF(covars = cov_names, dat = datAn2, trt = datAn2$F5SPECS, plot = TRUE)","Gemy" +"1459828499331","","Gemy" +"1459828499356","smd_vr <- function(trt, covar, wts = rep(1, lenght(cov)))","Gemy" +"1459828499356","{","Gemy" +"1459828499357","","Gemy" +"1459828499358","","Gemy" +"1459828499358","","Gemy" +"1459828499359","","Gemy" +"1459828499359","trt_ind <- trt == 1","Gemy" +"1459828499360","ctrl_ind <- trt == 0","Gemy" +"1459828499361","","Gemy" +"1459828499361","nt <- sum(trt == 1)","Gemy" +"1459828499362","nc <- sum(trt == 0)","Gemy" +"1459828499363","","Gemy" +"1459828499363","out <- NULL","Gemy" +"1459828499364","","Gemy" +"1459828499364","out[1] <- (mean(covar[trt_ind]) - mean(covar[ctrl_ind])) /","Gemy" +"1459828499365","sqrt( ( (nt - 1)*var(covar[trt_ind]) + (nc - 1)*var(covar[ctrl_ind]) ) /","Gemy" +"1459828499365","(nt + nc - 2) )","Gemy" +"1459828499366","","Gemy" +"1459828499366","out[2] <- var(covar[trt_ind]) / var(covar[ctrl_ind])","Gemy" +"1459828499368","out <- t(out)","Gemy" +"1459828499368","colnames(out) <- c(St Mean Diff, Var Ratio)","Gemy" +"1459828499369","return(out)","Gemy" +"1459828499369","}","Gemy" +"1459828499371","smd_vr <- function(covar, trt, wts = rep(1, length(covar)))","Gemy" +"1459828499371","{","Gemy" +"1459828499372","","Gemy" +"1459828499372","","Gemy" +"1459828499373","","Gemy" +"1459828499373","covar <- as.numeric(as.character(covar)) ","Gemy" +"1459828499373","covar.by.sel <- split(covar, trt)","Gemy" +"1459828499374","wts.by.sel <- split(wts, trt)","Gemy" +"1459828499374","wtmn.0 <- weighted.mean(covar.by.sel[[1]], w = wts.by.sel[[1]], na.rm = TRUE)","Gemy" +"1459828499374","wtmn.1 <- weighted.mean(covar.by.sel[[2]], w = wts.by.sel[[2]], na.rm = TRUE)","Gemy" +"1459828499375","wt.mn.diff <- wtmn.1 - wtmn.0","Gemy" +"1459828499375","wtvar.0 <- cov.wt(matrix(covar.by.sel[[1]], length(covar.by.sel[[1]]), 1), wt = wts.by.sel[[1]])[[1]]","Gemy" +"1459828499376","wtvar.1 <- cov.wt(matrix(covar.by.sel[[2]], length(covar.by.sel[[2]]), 1), wt = wts.by.sel[[2]])[[1]]","Gemy" +"1459828499376","pooled.wt.var <- (wtvar.0*sum(wts.by.sel[[1]]) + wtvar.1*sum(wts.by.sel[[2]]))/sum(wts)","Gemy" +"1459828499377","smds <- (wt.mn.diff)/sqrt(pooled.wt.var)","Gemy" +"1459828499377","out <- t(c(smds, wtvar.1/wtvar.0))","Gemy" +"1459828499378","colnames(out) <- c(St Mean Diff, Var Ratio)","Gemy" +"1459828499378","out","Gemy" +"1459828499379","}","Gemy" +"1459828499380","smd_vr_DF <- function(covars, dat, trt, wts = rep(1, length(trt)), plot = FALSE)","Gemy" +"1459828499381","{","Gemy" +"1459828499381","","Gemy" +"1459828499382","","Gemy" +"1459828499382","","Gemy" +"1459828499382","","Gemy" +"1459828499383","output <- matrix(0, length(covars), 2)","Gemy" +"1459828499383","colnames(output) <- c(St Mean Diff, Var Ratio)","Gemy" +"1459828499384","","Gemy" +"1459828499384","for(i in 1","Gemy" +"length(covars)) {","","Gemy" +"1459828499384","output[i,] <- smd_vr(trt = trt, covar = dat[,covars[i]], wts = wts)","Gemy" +"1459828499385","}","Gemy" +"1459828499385","rownames(output) <- covars","Gemy" +"1459828499386","","Gemy" +"1459828499386","if(plot) {","Gemy" +"1459828499387","plot(output, pch = 19, xlim = c(-1, 1), ylim = c(0, 3.5))","Gemy" +"1459828499388","abline(v = c(-.1, .1), lwd = 2, lty = 2)","Gemy" +"1459828499389","abline(h = c(4/5, 5/4), lwd = 2, lty = 2)","Gemy" +"1459828499390","lbls <- rownames(output)","Gemy" +"1459828499390","for (i in 1","Gemy" +"length(lbls)) {","","Gemy" +"1459828499391","if(output[i,2] < 5/4 & output[i,2] > .8 & output[i,1] < .1 & output[i,1] > -.1) {","Gemy" +"1459828499392","lbls[i] <- ","Gemy" +"1459828499393","}","Gemy" +"1459828499393","}","Gemy" +"1459828499394","text(output, labels = lbls, adj = c(0, -.3))","Gemy" +"1459828499395","}","Gemy" +"1459828499396","output","Gemy" +"1459828499396","}","Gemy" +"1459828499398","","Gemy" +"1459828499398","ovlp <- function(trt, lps)","Gemy" +"1459828499399","{","Gemy" +"1459828499400","","Gemy" +"1459828499400","require(optmatch)","Gemy" +"1459828499400","","Gemy" +"1459828499401","","Gemy" +"1459828499401","tt <- t.test(x = lps[trt==1], y = lps[trt==0], alternative = two.sided,","Gemy" +"1459828499402","var.equal = FALSE)$p.value","Gemy" +"1459828499402","","Gemy" +"1459828499402","ks <- ks.test(x = lps[trt==1], y = lps[trt==0], alternative = two.sided)$p.value","Gemy" +"1459828499403","par(mfrow = c(2,1))","Gemy" +"1459828499404","rc <- range(lps)","Gemy" +"1459828499405","brks <- seq(from = rc[1] - diff(rc)/30, to = rc[2] + diff(rc)/30, by = diff(rc)/30)","Gemy" +"1459828499405","hist(lps[trt==1], breaks = brks, xlab = , main = Treated Cases,","Gemy" +"1459828499406","freq = FALSE)","Gemy" +"1459828499406","d1 <- density(lps[trt==1])","Gemy" +"1459828499406","lines(d1, col = 2, lwd = 1, lty = 1)","Gemy" +"1459828499407","abline(v = c(range(lps[trt==1])), col = 3, lwd = 3)","Gemy" +"1459828499408","hist(lps[trt==0], breaks = brks, xlab = , main = Control Cases,","Gemy" +"1459828499408","freq = FALSE)","Gemy" +"1459828499409","d2 <- density(lps[trt==0])","Gemy" +"1459828499409","lines(d2, col = 2, lwd = 1, lty = 1)","Gemy" +"1459828499410","abline(v = c(range(lps[trt==0])), col = 3, lwd = 3)","Gemy" +"1459828499410","par(mfrow = c(1,1))","Gemy" +"1459828499411","}","Gemy" +"1459828499412","","Gemy" +"1459828499413","ovlp_ind <- function(trt, lps, caliper = 0.1)","Gemy" +"1459828499413","{","Gemy" +"1459828499413","nt <- sum(trt == 1); nc <- sum(trt == 0)","Gemy" +"1459828499414","SDpool <- sqrt( ( (nt - 1)*var(lps[trt == 1]) + (nc - 1)*var(lps[trt == 0]) ) /","Gemy" +"1459828499414","(nt + nc - 2) )","Gemy" +"1459828499415","","Gemy" +"1459828499415","diffs <- match_on(trt ~ lps, method = euclidean)","Gemy" +"1459828499416","smds <- diffs/SDpool ","Gemy" +"1459828499416","fun <- function(vec) {min(vec) <= caliper}","Gemy" +"1459828499416","trtOvlp <- apply(smds, 1, fun) ","Gemy" +"1459828499417","ctrlOvlp <- apply(smds, 2, fun) ","Gemy" +"1459828499417","drop1 <- which(trt==1)[!trtOvlp]","Gemy" +"1459828499418","drop0 <- which(trt==0)[!ctrlOvlp]","Gemy" +"1459828499418","ind <- !logical(length(lps))","Gemy" +"1459828499419","ind[c(drop1, drop0)] <- FALSE","Gemy" +"1459828499420","ind","Gemy" +"1459828499421","}","Gemy" +"1459828499423","var_wt <- function(x, wt)","Gemy" +"1459828499424","{","Gemy" +"1459828499424","wt_m <- x %*% wt / sum(wt)","Gemy" +"1459828499425","wt_var <- x^2 %*% wt / sum(wt) - m^2","Gemy" +"1459828499426","out <- c(wt_m, wt_var)","Gemy" +"1459828499426","out","Gemy" +"1459828499427","}","Gemy" +"1459828523708","smd_vr_DF(covars = cov_names, dat = datAn2, trt = datAn2$F5SPECS, plot = TRUE)","Gemy" +"1459828602185","","Gemy" +"1459828602186","","Gemy" +"1459828602187","smds <- smd_vr_DF(covars = cov_names,","Gemy" +"1459828602188","dat = eclsk,","Gemy" +"1459828602188","trt = eclsk$F5SPECS, plot = TRUE)","Gemy" +"1459828644021","","Gemy" +"1459828644069","","Gemy" +"1459828644070","smds <- smd_vr_DF(covars = cov_names,","Gemy" +"1459828644071","dat = datAn2,","Gemy" +"1459828644072","trt = datAn2k$F5SPECS, plot = TRUE)","Gemy" +"1459828695741","cov_names <- names(datAn2)[-c(16","Gemy" +"17)] ","","Gemy" +"1459828854735","smd_vr_DF(covars = cov_names, dat = datAn2, trt = datAn2$F5SPECS, plot = TRUE)","Gemy" +"1459829745155","out <- capture.output(summary(result))","Gemy" +"1459833325379","","Gemy" +"1459833325384","glm1 <- glm(F5SPECS ~ . - C6R4RSCL, data = datAn2, family = binomial)","Gemy" +"1459833325848","ps1 <- predict(glm1, type = response)","Gemy" +"1459833325849","lin_ps1 <- log(ps1/(1 - ps1))","Gemy" +"1459833348789","","Gemy" +"1459833348801","ovlp(trt = datAn2$F5SPECS, lps = lin_ps1)","Gemy" +"1459833456049","","Gemy" +"1459833456061","library(optmatch)","Gemy" +"1459833456062","ovlp_ind1 <- ovlp_ind(trt = datAn2$F5SPECS, lps = lin_ps1, caliper = 0.1) ","Gemy" +"1459833458171","sum(ovlp_ind1)","Gemy" +"1459833458189","table(ovlp_ind1, datAn2$F5SPECS)","Gemy" +"1459833528214","","Gemy" +"1459833528230","ovlp(trt = datAn2$F5SPECS[ovlp_ind1], lps = lin_ps1[ovlp_ind1])","Gemy" +"1459833594668","","Gemy" +"1459833594668","eclsO <- datAn2[ovlp_ind1,]","Gemy" +"1459833594699","","Gemy" +"1459833594700","glm2 <- glm(F5SPECS ~ . - C6R4RSCL, data = eclsO, family = binomial)","Gemy" +"1459833594916","ps2 <- predict(glm2, type = response)","Gemy" +"1459833594916","lin_ps2 <- log(ps2/(1 - ps2))","Gemy" +"1459833699842","","Gemy" +"1459833699842","ovlp(trt = eclsO$F5SPECS, lps = lin_ps2)","Gemy" +"1459833771742","","Gemy" +"1459833771747","fm1 <- fullmatch(match_on(glm2), data = eclsO)","Gemy" +"1459833780837","summary(fm1) ","Gemy" +"1459833780878","table(fm1) ","Gemy" +"1459833780905","","Gemy" +"1459833780906","length(table(fm1)) ","Gemy" +"1459833780910","(frq <- table(fm1, eclsO$F5SPECS)) ","Gemy" +"1459833780942","matched(fm1) ","Gemy" +"1459833877285","","Gemy" +"1459833877290","(O <- table(eclsO$F5SPECS, fm1)) ","Gemy" +"1459833877311","(E <- outer(table(eclsO$F5SPECS), table(fm1)) / sum(O)) ","Gemy" +"1459833877342","(W <- E / O) ","Gemy" +"1459833877369","mtch_wts <- W[cbind(eclsO$F5SPECS + 1, fm1)] ","Gemy" +"1459833892783","cov_names <- names(datAn2)[-c(16","Gemy" +"17)] ","","Gemy" +"1459833892828","smds_fm <- smd_vr_DF(covars = cov_names, dat = eclsO,","Gemy" +"1459833892829","trt = eclsO$F5SPECS, wts = mtch_wts, plot = TRUE)","Gemy" +"1459833917525","","Gemy" +"1459833917526","summary(lm(C6R4RSCL ~ F5SPECS, data = eclsO, weights = mtch_wts))","Gemy" +"1459833993045","pm1 <- pairmatch(lin_ps2, z = eclsO$F5SPECS, data = eclsO)","Gemy" +"1459834011217","table(pm1, eclsO$F5SPECS, useNA = always)","Gemy" +"1459834109677","","Gemy" +"1459834109693","matched_dat <- eclsO[matched(pm1), ]","Gemy" +"1459834109703","dim(matched_dat)","Gemy" +"1459834196995","","Gemy" +"1459834196995","smds_pm <- smd_vr_DF(covars = cov_names, dat = matched_dat,","Gemy" +"1459834197011","trt = matched_dat$F5SPECS,","Gemy" +"1459834197011","wts = rep(1, nrow(matched_dat)), plot = TRUE)","Gemy" +"1459834361656","","Gemy" +"1459834361661","glmMIRT <- glm(F5SPECS ~ . - C6R4RSCL + I(MIRT^2), data = datAn2, family = binomial)","Gemy" +"1459834361857","psMIRT <- predict(glmMIRT, type = response)","Gemy" +"1459834361859","lin_psMIRT <- log(psMIRT/(1 - psMIRT))","Gemy" +"1459834485583","","Gemy" +"1459834485584","ovlp(trt = datAn2$F5SPECS, lps = lin_psMIRT)","Gemy" +"1459834485662","","Gemy" +"1459834485663","ovlpMIRT <- ovlp_ind(trt = datAn2$F5SPECS, lps = lin_psMIRT, caliper = 0.1) ","Gemy" +"1459834487442","sum(ovlpMIRT)","Gemy" +"1459834487448","table(ovlpMIRT, datAn2$F5SPECS)","Gemy" +"1459834487456","","Gemy" +"1459834487457","ovlp(trt = datAn2$F5SPECS[ovlpMIRT], lps = lin_ps3[ovlpMIRT])","Gemy" +"1459834487458","","Gemy" +"1459834487459","eclsMIRT <- datAn2[ovlpMIRT,]","Gemy" +"1459834487466","","Gemy" +"1459834487467","glm4 <- glm(F5SPECS ~ . - C6R4RSCL + I(MIRT^2), data = eclsMIRT, family = binomial)","Gemy" +"1459834487647","ps4 <- predict(glm4, type = response)","Gemy" +"1459834487648","lin_ps4 <- log(ps4/(1 - ps4))","Gemy" +"1459834487649","ovlp(trt = eclsO4$F5SPECS, lps = lin_ps4) ","Gemy" +"1459834487651","","Gemy" +"1459834487651","pm3 <- pairmatch(lin_ps4, z = eclsMIRT$F5SPECS, data = eclsMIRT)","Gemy" +"1459834503796","matched_dat4 <- eclsMIRT[matched(pm3),]","Gemy" +"1459834503806","dim(matched_dat4)","Gemy" +"1459834503806","","Gemy" +"1459834503807","smds_pm <- smd_vr_DF(covars = cov_names, dat = matched_dat4,","Gemy" +"1459834503807","trt = matched_dat4$F5SPECS,","Gemy" +"1459834503808","wts = rep(1, nrow(matched_dat4)), plot = TRUE)","Gemy" +"1459834503896","","Gemy" +"1459834503897","","Gemy" +"1459834503897","","Gemy" +"1459834578803","ATT_mtch <- lm(C6R4RSCL ~ F5SPECS, data = matched_dat4)","Gemy" +"1459834578807","summary(ATT_mtch)","Gemy" +"1459869574320","","Gemy" +"1459869574332","load(file = file.choose())","Gemy" +"1459869584826","dim(datAn2) ","Gemy" +"1459869584829","head(datAn2)","Gemy" +"1459869595108","","Gemy" +"1459869595109","datAn2$C6R4MSCL <- NULL","Gemy" +"1459869595110","head(datAn2)","Gemy" +"1459869595117","","Gemy" +"1459869595117","","Gemy" +"1459869595118","","Gemy" +"1459869595118","","Gemy" +"1459869595118","","Gemy" +"1459869595119","","Gemy" +"1459869595119","cov_names <- names(datAn2)[-c(16","Gemy" +"17)] ","","Gemy" +"1459869595120","smd_vr_DF(covars = cov_names, dat = datAn2, trt = datAn2$F5SPECS, plot = TRUE)","Gemy" +"1459869755256","write.table(x, file = , append = FALSE, quote = TRUE, sep = ,","Gemy" +"1459869755264","eol = \n, na = NA, dec = ., row.names = TRUE,","Gemy" +"1459869755265","col.names = TRUE, qmethod = c(escape, double),","Gemy" +"1459869755266","fileEncoding = )","Gemy" +"1459869782512","write.table(datAn2, file = , append = FALSE, quote = TRUE, sep = ,","Gemy" +"1459869782514","eol = \n, na = NA, dec = ., row.names = TRUE,","Gemy" +"1459869782514","col.names = TRUE, qmethod = c(escape, double),","Gemy" +"1459869782515","fileEncoding = )","Gemy" +"1459869869577","","Gemy" +"1459869869582","datAn2$C6R4MSCL <- NULL","Gemy" +"1459869869583","head(datAn2)","Gemy" +"1459869869599","","Gemy" +"1459869869599","","Gemy" +"1459869869600","","Gemy" +"1459869869600","","Gemy" +"1459869869600","","Gemy" +"1459869869601","","Gemy" +"1459869869601","cov_names <- names(datAn2)[-c(16","Gemy" +"17)] ","","Gemy" +"1459869869602","smd_vr_DF(covars = cov_names, dat = datAn2, trt = datAn2$F5SPECS, plot = TRUE)","Gemy" +"1459869959737","summary(smd_vr_DF())","Gemy" +"1459870172674","capture.output(smd_vr_DF(covars = cov_names, dat = datAn2, trt = datAn2$F5SPECS, plot = TRUE), file = NULL, append = FALSE,","Gemy" +"1459870172681","type = c(output, message), split = FALSE)","Gemy" +"1459870246121","sink(sink-examp.txt)","Gemy" +"1459870246128","i <- 1","Gemy" +"10","","Gemy" +"1459870246128","outer(i, i, *)","Gemy" +"1459870246131","sink()","Gemy" +"1459870246131","unlink(sink-examp.txt)","Gemy" +"1459871798962","unlink(sink-examp.txt)","Gemy" +"1459871800065","","Gemy" +"1459871800066","lm1 <- lm(C6R4RSCL ~ ., data = datAn2)","Gemy" +"1459871800164","summary(lm1)","Gemy" +"1459871800197","","Gemy" +"1459871800197","","Gemy" +"1459871800197","plot(C6R4RSCL ~ MIRT, data = datAn2)","Gemy" +"1459871800422","plot(C6R4RSCL ~ RIRT, data = datAn2)","Gemy" +"1459871800683","","Gemy" +"1459871800683","lm2 <- update(lm1, . ~ . + I(MIRT^2))","Gemy" +"1459871801216","summary(lm2)","Gemy" +"1459871801223","lm3 <- update(lm1, . ~ . + I(RIRT^2))","Gemy" +"1459871801290","summary(lm3)","Gemy" +"1459871801298","lm4 <- update(lm2, . ~ . + I(RIRT^2))","Gemy" +"1459871801367","summary(lm4)","Gemy" +"1459871801376","","Gemy" +"1459871801376","","Gemy" +"1459871801377","summary(lm2)","Gemy" +"1459872150693","","Gemy" +"1459872150720","dat1 <- subset(datAn2, subset = datAn2$F5SPECS == 1)","Gemy" +"1459872150727","dim(dat1)","Gemy" +"1459872150728","","Gemy" +"1459872150728","dat0 <- subset(datAn2, subset = datAn2$F5SPECS == 0)","Gemy" +"1459872150735","dim(dat0)","Gemy" +"1459872150736","","Gemy" +"1459872150736","lmY1 <- lm(C6R4RSCL ~ . - F5SPECS, data = dat1)","Gemy" +"1459872150742","summary(lmY1)","Gemy" +"1459872150750","","Gemy" +"1459872150751","lmY0 <- lm(C6R4RSCL ~ . - F5SPECS, data = dat0)","Gemy" +"1459872150773","summary(lmY0)","Gemy" +"1459872150780","","Gemy" +"1459872150781","","Gemy" +"1459872150781","Y1hats <- predict(lmY1, newdata = datAn2)","Gemy" +"1459872150791","Y0hats <- predict(lmY0, newdata = datAn2)","Gemy" +"1459872150834","(ATE_RE <- mean(Y1hats - Y0hats))","Gemy" +"1459872150835","","Gemy" +"1459872150835","Y0hatsATT <- predict(lmY0, newdata = dat1)","Gemy" +"1459872150838","(ATT_RE <- mean(dat1$C6R4RSCL - Y0hatsATT))","Gemy" +"1459872150838","","Gemy" +"1459872150839","","Gemy" +"1459872150839","","Gemy" +"1459872150839","","Gemy" +"1459872150840","library(boot)","Gemy" +"1459872150873","boot_fun <- function(dat, ind) {","Gemy" +"1459872150874","datB <- dat[ind,]","Gemy" +"1459872150875","dat1 <- subset(datB, subset = dat$F5SPECS == 1)","Gemy" +"1459872150875","dat0 <- subset(datB, subset = dat$F5SPECS == 0)","Gemy" +"1459872150875","lmY1 <- lm(C6R4RSCL ~ . - F5SPECS, data = dat1)","Gemy" +"1459872150876","lmY0 <- lm(C6R4RSCL ~ . - F5SPECS, data = dat0)","Gemy" +"1459872150876","Y1hats <- predict(lmY1, newdata = dat)","Gemy" +"1459872150876","Y0hats <- predict(lmY0, newdata = dat)","Gemy" +"1459872150877","ATE <- mean(Y1hats - Y0hats)","Gemy" +"1459872150877","ATE","Gemy" +"1459872150878","}","Gemy" +"1459872150878","boot_out <- boot(data = datAn2, statistic = boot_fun, R = 1000)","Gemy" +"1459872199202","boot_out","Gemy" +"1459872199209","","Gemy" +"1459874127826","","Gemy" +"1459874127832","glm1 <- glm(F5SPECS ~ . - C6R4RSCL, data = datAn2, family = binomial)","Gemy" +"1459874128098","ps1 <- predict(glm1, type = response)","Gemy" +"1459874128099","lin_ps1 <- log(ps1/(1 - ps1))","Gemy" +"1459874128100","","Gemy" +"1459874128100","ovlp(trt = datAn2$F5SPECS, lps = lin_ps1)","Gemy" +"1459874129405","","Gemy" +"1459874129406","library(optmatch)","Gemy" +"1459874129406","ovlp_ind1 <- ovlp_ind(trt = datAn2$F5SPECS, lps = lin_ps1, caliper = 0.1) ","Gemy" +"1459874131248","sum(ovlp_ind1)","Gemy" +"1459874131249","table(ovlp_ind1, datAn2$F5SPECS)","Gemy" +"1459874131256","","Gemy" +"1459874131257","ovlp(trt = datAn2$F5SPECS[ovlp_ind1], lps = lin_ps1[ovlp_ind1])","Gemy" +"1459874148976","","Gemy" +"1459874148977","","Gemy" +"1459874148977","","Gemy" +"1459874148978","","Gemy" +"1459874148978","","Gemy" +"1459874148978","eclsO <- datAn2[ovlp_ind1,]","Gemy" +"1459874148984","","Gemy" +"1459874148985","glm2 <- glm(F5SPECS ~ . - C6R4RSCL, data = eclsO, family = binomial)","Gemy" +"1459874149164","ps2 <- predict(glm2, type = response)","Gemy" +"1459874149164","lin_ps2 <- log(ps2/(1 - ps2))","Gemy" +"1459874149165","","Gemy" +"1459874149165","ovlp(trt = eclsO$F5SPECS, lps = lin_ps2)","Gemy" +"1459874170681","","Gemy" +"1459874170682","fm1 <- fullmatch(match_on(glm2), data = eclsO)","Gemy" +"1459874179722","summary(fm1) ","Gemy" +"1459874179745","table(fm1) ","Gemy" +"1459874179756","","Gemy" +"1459874179756","length(table(fm1)) ","Gemy" +"1459874179758","(frq <- table(fm1, eclsO$F5SPECS)) ","Gemy" +"1459874179775","matched(fm1) ","Gemy" +"1459874179934","","Gemy" +"1459874179934","","Gemy" +"1459874179935","","Gemy" +"1459874179935","","Gemy" +"1459874179935","(O <- table(eclsO$F5SPECS, fm1)) ","Gemy" +"1459874179955","(E <- outer(table(eclsO$F5SPECS), table(fm1)) / sum(O)) ","Gemy" +"1459874179977","(W <- E / O) ","Gemy" +"1459874180001","mtch_wts <- W[cbind(eclsO$F5SPECS + 1, fm1)] ","Gemy" +"1459874180002","cov_names <- names(datAn2)[-c(16","Gemy" +"17)] ","","Gemy" +"1459874190416","smds_fm <- smd_vr_DF(covars = cov_names, dat = eclsO,","Gemy" +"1459874190417","trt = eclsO$F5SPECS, wts = mtch_wts, plot = TRUE)","Gemy" +"1459874190595","","Gemy" +"1459874190596","","Gemy" +"1459874190596","","Gemy" +"1459874190596","","Gemy" +"1459874190597","summary(lm(C6R4RSCL ~ F5SPECS, data = eclsO, weights = mtch_wts))","Gemy" +"1459874190609","","Gemy" +"1459874190609","summary(lm(C6R4RSCL ~ F5SPECS + MIRT + RIRT, data = eclsO, weights = mtch_wts))","Gemy" +"1459874190621","","Gemy" +"1459874190621","summary(lm(C6R4RSCL ~ F5SPECS + MIRT + I(MIRT^2), data = eclsO, weights = mtch_wts))","Gemy" +"1459874190634","ATE_mtch <- lm(C6R4RSCL ~ F5SPECS, data = eclsO, weights = mtch_wts)","Gemy" +"1459874190640","summary(ATE_mtch)","Gemy" +"1460483859632","","Gemy" +"1460483859635","","Gemy" +"1460483859635","","Gemy" +"1460483859635","","Gemy" +"1460483859635","","Gemy" +"1460483859636","library(rdrobust)","Gemy" +"1460483859641","data(rdrobust_RDsenate)","Gemy" +"1460483859646","rddat <- na.omit(rddat)","Gemy" +"1460483859647","dim(rddat)","Gemy" +"1460483859647","Y <- rddat$vote","Gemy" +"1460483859648","X <- rddat$margin","Gemy" +"1460483859648","D <- ifelse(X >= 0, 1, 0)","Gemy" +"1460483859649","plot(Y ~ X, pch = D+1, col = c(2,4)[D+1])","Gemy" +"1460483859667","","Gemy" +"1460483859668","","Gemy" +"1460483859668","","Gemy" +"1460483859669","","Gemy" +"1460483859669","","Gemy" +"1460483859670","","Gemy" +"1460483859670","","Gemy" +"1460483859670","summary(lm.m1 <- lm(Y ~ X + D))","Gemy" +"1460483859674","summary(lm.m2 <- lm(Y ~ X + I(X^2) + D))","Gemy" +"1460483859678","summary(lm.m3 <- lm(Y ~ X + I(X^2) + I(X^3) + D))","Gemy" +"1460483859682","summary(lm.m4 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + D))","Gemy" +"1460483859686","summary(lm.m5 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + I(X^5) + D))","Gemy" +"1460483859691","","Gemy" +"1460483859692","AIC(lm.m1, lm.m2, lm.m3, lm.m4, lm.m5) ","Gemy" +"1460483859693","anova(lm.m1, lm.m2, lm.m3, lm.m4, lm.m5) ","Gemy" +"1460483859694","","Gemy" +"1460483859695","plot(lm.m3)","Gemy" +"1460483859696","","Gemy" +"1460483859697","summary(lm.i1 <- lm(Y ~ X + D + X","Gemy" +"D))","","Gemy" +"1460483859700","summary(lm.i2 <- lm(Y ~ X + I(X^2) + D + X","Gemy" +"D + I(X^2)","D))","Gemy" +"1460483859703","summary(lm.i3 <- lm(Y ~ X + I(X^2) + I(X^3) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D))","","Gemy" +"1460483859707","summary(lm.i4 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D + I(X^4)","D))","Gemy" +"1460483859711","summary(lm.i5 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + I(X^5) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D + I(X^4)","D + I(X^5)","Gemy" +"D))","","Gemy" +"1460483859716","","Gemy" +"1460483859717","AIC(lm.i1, lm.i2, lm.i3, lm.i4, lm.i5) ","Gemy" +"1460483859718","anova(lm.i1, lm.i2, lm.i3, lm.i4, lm.i5) ","Gemy" +"1460483859719","","Gemy" +"1460483859720","plot(lm.i4)","Gemy" +"1460483859721","","Gemy" +"1460483859721","AIC(lm.m3, lm.i4) ","Gemy" +"1460483859722","anova(lm.m3, lm.i4) ","Gemy" +"1460483859722","","Gemy" +"1460483859723","plot(Y ~ X, pch = D+1, col = c(2,4)[D+1])","Gemy" +"1460483859740","df0 <- data.frame(cbind(seq(-100, 0, .1), rep(0, 1001)))","Gemy" +"1460483859786","names(df0) <- c(X, D)","Gemy" +"1460483859786","head(df0)","Gemy" +"1460483859790","prd0 <- predict(lm.i4, newdata = df0)","Gemy" +"1460483859791","points(x = seq(-100, 0, .1), y = prd0, type = l, lwd = 3)","Gemy" +"1460483859794","df1 <- data.frame(cbind(seq(0, 100, .1), rep(1, 1001)))","Gemy" +"1460483859795","names(df1) <- c(X, D)","Gemy" +"1460483859795","head(df1)","Gemy" +"1460483859797","prd1 <- predict(lm.i4, newdata = df1)","Gemy" +"1460483859798","points(x = seq(0, 100, .1), y = prd1, type = l, lwd = 3)","Gemy" +"1460483859800","","Gemy" +"1460483859800","","Gemy" +"1460483859801","","Gemy" +"1460483859801","df00 <- data.frame(cbind(0, 0))","Gemy" +"1460483859802","names(df00) <- c(X, D)","Gemy" +"1460483859803","df11 <- data.frame(cbind(0, 1))","Gemy" +"1460483859804","names(df11) <- c(X, D)","Gemy" +"1460483859804","(tau.hat.parametric <- predict(lm.i4, df11) - predict(lm.i4, df00))","Gemy" +"1460483859805","","Gemy" +"1460483859806","","Gemy" +"1460483859806","summary(lm.i4)","Gemy" +"1460483859807","","Gemy" +"1460483859807","","Gemy" +"1460483859808","","Gemy" +"1460483859808","","Gemy" +"1460483859809","","Gemy" +"1460483894613","install.packages(rdrobust)","Gemy" +"1460483932610","","Gemy" +"1460483932611","","Gemy" +"1460483932615","","Gemy" +"1460483932616","","Gemy" +"1460483932616","","Gemy" +"1460483932616","library(rdrobust)","Gemy" +"1460483932703","data(rdrobust_RDsenate)","Gemy" +"1460483932707","rddat <- na.omit(rddat)","Gemy" +"1460483932708","dim(rddat)","Gemy" +"1460483932708","Y <- rddat$vote","Gemy" +"1460483932709","X <- rddat$margin","Gemy" +"1460483932710","D <- ifelse(X >= 0, 1, 0)","Gemy" +"1460483932710","plot(Y ~ X, pch = D+1, col = c(2,4)[D+1])","Gemy" +"1460483961083","install.packages(rdrobust)","Gemy" +"1460483981618","data(rdrobust_RDsenate)","Gemy" +"1460483981622","rddat <- na.omit(rddat)","Gemy" +"1460483981623","dim(rddat)","Gemy" +"1460483981623","Y <- rddat$vote","Gemy" +"1460483981624","X <- rddat$margin","Gemy" +"1460483981624","D <- ifelse(X >= 0, 1, 0)","Gemy" +"1460483981625","plot(Y ~ X, pch = D+1, col = c(2,4)[D+1])","Gemy" +"1460484023433","library(rdrobust)","Gemy" +"1460484023463","data(rdrobust_RDsenate)","Gemy" +"1460484046158","rddat <- na.omit(rddat)","Gemy" +"1460484046159","dim(rddat)","Gemy" +"1460484046163","Y <- rddat$vote","Gemy" +"1460484046163","X <- rddat$margin","Gemy" +"1460484046164","D <- ifelse(X >= 0, 1, 0)","Gemy" +"1460484046164","plot(Y ~ X, pch = D+1, col = c(2,4)[D+1])","Gemy" +"1460484274069","","Gemy" +"1460484304951","library(rdrobust)","Gemy" +"1460484324277","data(rdrobust_RDsenate)","Gemy" +"1460484332528","rddat <- na.omit(rddat)","Gemy" +"1460484352234","dim(rddat)","Gemy" +"1460484398200","rddat<-na.omit(rddat)","Gemy" +"1460484426002","rddat <- na.omit(rdrobust_rddat)","Gemy" +"1460484444601","rddat <- na.omit(rdrobust_RDsenate)","Gemy" +"1460484450475","rddat <- na.omit(rddat)","Gemy" +"1460484450476","dim(rddat)","Gemy" +"1460484450481","Y <- rddat$vote","Gemy" +"1460484450481","X <- rddat$margin","Gemy" +"1460484450482","D <- ifelse(X >= 0, 1, 0)","Gemy" +"1460484450484","plot(Y ~ X, pch = D+1, col = c(2,4)[D+1])","Gemy" +"1460484481734","","Gemy" +"1460484481739","","Gemy" +"1460484481739","","Gemy" +"1460484481739","","Gemy" +"1460484481740","","Gemy" +"1460484481740","","Gemy" +"1460484481740","","Gemy" +"1460484481741","summary(lm.m1 <- lm(Y ~ X + D))","Gemy" +"1460484481775","summary(lm.m2 <- lm(Y ~ X + I(X^2) + D))","Gemy" +"1460484481791","summary(lm.m3 <- lm(Y ~ X + I(X^2) + I(X^3) + D))","Gemy" +"1460484481804","summary(lm.m4 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + D))","Gemy" +"1460484481817","summary(lm.m5 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + I(X^5) + D))","Gemy" +"1460484481834","","Gemy" +"1460484481834","AIC(lm.m1, lm.m2, lm.m3, lm.m4, lm.m5) ","Gemy" +"1460484481840","anova(lm.m1, lm.m2, lm.m3, lm.m4, lm.m5) ","Gemy" +"1460484481853","","Gemy" +"1460484481853","plot(lm.m3)","Gemy" +"1460484482268","summary(lm.i3 <- lm(Y ~ X + I(X^2) + I(X^3) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D))","","Gemy" +"1460484482281","summary(lm.i4 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D + I(X^4)","D))","Gemy" +"1460484482305","summary(lm.i5 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + I(X^5) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D + I(X^4)","D + I(X^5)","Gemy" +"D))","","Gemy" +"1460484482321","","Gemy" +"1460484482322","AIC(lm.i1, lm.i2, lm.i3, lm.i4, lm.i5) ","Gemy" +"1460484482323","anova(lm.i1, lm.i2, lm.i3, lm.i4, lm.i5) ","Gemy" +"1460484482324","","Gemy" +"1460484482324","plot(lm.i4)","Gemy" +"1460484482754","","Gemy" +"1460484482754","plot(Y ~ X, pch = D+1, col = c(2,4)[D+1])","Gemy" +"1460484482830","df0 <- data.frame(cbind(seq(-100, 0, .1), rep(0, 1001)))","Gemy" +"1460484482831","names(df0) <- c(X, D)","Gemy" +"1460484482832","head(df0)","Gemy" +"1460484482834","prd0 <- predict(lm.i4, newdata = df0)","Gemy" +"1460484482837","points(x = seq(-100, 0, .1), y = prd0, type = l, lwd = 3)","Gemy" +"1460484482840","df1 <- data.frame(cbind(seq(0, 100, .1), rep(1, 1001)))","Gemy" +"1460484482841","names(df1) <- c(X, D)","Gemy" +"1460484482842","head(df1)","Gemy" +"1460484482844","prd1 <- predict(lm.i4, newdata = df1)","Gemy" +"1460484482847","points(x = seq(0, 100, .1), y = prd1, type = l, lwd = 3)","Gemy" +"1460484482849","","Gemy" +"1460484482849","","Gemy" +"1460484482849","","Gemy" +"1460484482850","df00 <- data.frame(cbind(0, 0))","Gemy" +"1460484482850","names(df00) <- c(X, D)","Gemy" +"1460484482851","df11 <- data.frame(cbind(0, 1))","Gemy" +"1460484482852","names(df11) <- c(X, D)","Gemy" +"1460484482852","(tau.hat.parametric <- predict(lm.i4, df11) - predict(lm.i4, df00))","Gemy" +"1460484482857","","Gemy" +"1460484482857","","Gemy" +"1460484482857","summary(lm.i4)","Gemy" +"1460484482865","","Gemy" +"1460484482865","","Gemy" +"1460484482866","","Gemy" +"1460484482867","","Gemy" +"1460484482867","","Gemy" +"1460484679434","source(~/Desktop/HUDM 5133/Regression discontinuity .R)","Gemy" +"1461089097423","loadhistory(~/Desktop/HUDM 5133/12 RD2 FUNCTIONS.R)","Gemy" +"1461089112133","triangular <- function(x)","Gemy" +"1461089136188","","Gemy" +"1461089136193","","Gemy" +"1461089136194","triangular <- function(x)","Gemy" +"1461089136195","{","Gemy" +"1461089136195","out <- numeric(length(x))","Gemy" +"1461089136195","out[(abs(x) <= 1)] <- (1 - abs(x[(abs(x) <= 1)]))","Gemy" +"1461089136196","out","Gemy" +"1461089136197","}","Gemy" +"1461089136197","tricube <- function(x)","Gemy" +"1461089136198","{","Gemy" +"1461089136198","out <- numeric(length(x))","Gemy" +"1461089136198","out[(abs(x) <= 1)] <- (70/81)*(1 - (abs(x[(abs(x) <= 1)]))^3)^3","Gemy" +"1461089136199","out","Gemy" +"1461089136199","}","Gemy" +"1461089136200","epanech <- function(x)","Gemy" +"1461089136200","{","Gemy" +"1461089136200","out <- numeric(length(x))","Gemy" +"1461089136201","out[(abs(x) <= 1)] <- (3/4)*(1 - x[(abs(x) <= 1)]^2)","Gemy" +"1461089136201","out","Gemy" +"1461089136201","}","Gemy" +"1461089136202","rectangular <- function(x)","Gemy" +"1461089136203","{","Gemy" +"1461089136203","out <- numeric(length(x))","Gemy" +"1461089136204","out[(abs(x) <= 1)] <- 0.5","Gemy" +"1461089136205","out","Gemy" +"1461089136205","}","Gemy" +"1461089136206","normal <- function(x)","Gemy" +"1461089136206","{","Gemy" +"1461089136207","out <- (1/sqrt(2*pi))*exp(-0.5*x^2)","Gemy" +"1461089136208","out","Gemy" +"1461089136208","}","Gemy" +"1461089136209","kern_poly <- function(x, y, bw, kern = epanechnikov, degree = 1,","Gemy" +"1461089136210","dom = seq(min(x), max(x), by = diff(range(x)/200)))","Gemy" +"1461089136212","{","Gemy" +"1461089136212","","Gemy" +"1461089136213","","Gemy" +"1461089136214","","Gemy" +"1461089136215","","Gemy" +"1461089136215","","Gemy" +"1461089136216","if (length(x) != length(y)) stop(Error: x and y must have same length!)","Gemy" +"1461089136217","wts <- function(x_focal, x, y, bw, kern, degree)","Gemy" +"1461089136218","{","Gemy" +"1461089136218","","Gemy" +"1461089136220","","Gemy" +"1461089136221","if (kern == epanechnikov) wt <- epanech((x - x_focal)/bw)","Gemy" +"1461089136222","if (kern == rectangular) wt <- rectangular((x - x_focal)/bw)","Gemy" +"1461089136223","if (kern == normal) wt <- normal((x - x_focal)/bw)","Gemy" +"1461089136225","if (kern == tricube) wt <- tricube((x - x_focal)/bw)","Gemy" +"1461089136226","lm_out <- lm(y ~ poly(x, degree, raw = T), weights = wt)","Gemy" +"1461089136227","lm_out <- lm(y ~ poly(x, degree, raw = T), weights = wt)","Gemy" +"1461089136230","output <- predict(lm_out, newdata = data.frame(x = t(t(x_focal))))","Gemy" +"1461089136231","output","Gemy" +"1461089136232","}","Gemy" +"1461089136233","dom <- sort(dom)","Gemy" +"1461089136234","means_out <- sapply(dom, wts, x = x, y = y, bw = bw, kern = kern, degree = degree)","Gemy" +"1461089136235","out <- cbind(dom, means_out)","Gemy" +"1461089136236","out","Gemy" +"1461089136237","}","Gemy" +"1461089136240","loocv1 <- function(i, x, y, bw, kern = epanechnikov, degree = 2)","Gemy" +"1461089136240","{","Gemy" +"1461089136241","","Gemy" +"1461089136241","","Gemy" +"1461089136242","","Gemy" +"1461089136243","","Gemy" +"1461089136244","","Gemy" +"1461089136244","","Gemy" +"1461089136245","","Gemy" +"1461089136245","","Gemy" +"1461089136246","kern_poly(x = x[-i], y = y[-i], bw = bw, kern = kern, degree = degree, dom = c(x[i]))","Gemy" +"1461089136246","}","Gemy" +"1461089136248","loocv2 <- function(x, y, bw, kern = epanechnikov, degree = 2)","Gemy" +"1461089136248","{","Gemy" +"1461089136249","","Gemy" +"1461089136249","","Gemy" +"1461089136250","","Gemy" +"1461089136251","cvfits <- sapply(1","Gemy" +"length(x), loocv1, x = x, y = y, bw = bw, kern = kern, degree = degree)","","Gemy" +"1461089136252","mse <- mean((y - cvfits)^2)","Gemy" +"1461089136253","mse","Gemy" +"1461089136253","}","Gemy" +"1461089136255","loocv3 <- function(BW, x, y, kern = epanechnikov, degree = 2, cores = 1)","Gemy" +"1461089136255","{","Gemy" +"1461089136256","","Gemy" +"1461089136256","","Gemy" +"1461089136257","","Gemy" +"1461089136257","","Gemy" +"1461089136257","","Gemy" +"1461089136259","library(parallel) ","Gemy" +"1461089136259","cvs <- mclapply(BW, loocv2, x = x, y = y, kern = kern, degree = degree, mc.cores = cores)","Gemy" +"1461089136260","best <- BW[which(cvs == min(unlist(cvs)))]","Gemy" +"1461089136261","plot(BW, cvs, type = b, xlab = Bandwidth, ylab = Cross-Validated Error,","Gemy" +"1461089136262","main = paste0(Best Bandwidth = , best, ; , MSPE = , round(min(unlist(cvs)), 2)))","Gemy" +"1461089136263","abline(v = best, lty = 2)","Gemy" +"1461089136264","out <- cbind(BW, cvs)","Gemy" +"1461089136264","out","Gemy" +"1461089136265","}","Gemy" +"1461089136266","kern_ATE <- function(bwa, bwb, dega, degb, x, y, kern, degree, cutoff)","Gemy" +"1461089136267","{","Gemy" +"1461089136267","","Gemy" +"1461089136268","Xa <- x[which(x > cutoff)]; Xb <- x[which(x <= cutoff)]","Gemy" +"1461089136269","Ya <- y[which(x > cutoff)]; Yb <- y[which(x <= cutoff)]","Gemy" +"1461089136270","below <- kern_poly(Xb, Yb, bw = bwb, kern = kern, degree = degb, dom = cutoff)","Gemy" +"1461089136270","above <- kern_poly(Xa, Ya, bw = bwa, kern = kern, degree = dega, dom = cutoff)","Gemy" +"1461089136271","ATE <- above[2] - below[2]","Gemy" +"1461089136272","ATE","Gemy" +"1461089136272","}","Gemy" +"1461089169250","","Gemy" +"1461089169256","","Gemy" +"1461089169257","triangular <- function(x)","Gemy" +"1461089169258","{","Gemy" +"1461089169259","out <- numeric(length(x))","Gemy" +"1461089169260","out[(abs(x) <= 1)] <- (1 - abs(x[(abs(x) <= 1)]))","Gemy" +"1461089169261","out","Gemy" +"1461089169262","}","Gemy" +"1461089169322","tricube <- function(x)","Gemy" +"1461089169322","{","Gemy" +"1461089169323","out <- numeric(length(x))","Gemy" +"1461089169324","out[(abs(x) <= 1)] <- (70/81)*(1 - (abs(x[(abs(x) <= 1)]))^3)^3","Gemy" +"1461089169324","out","Gemy" +"1461089169325","}","Gemy" +"1461089169326","epanech <- function(x)","Gemy" +"1461089169326","{","Gemy" +"1461089169327","out <- numeric(length(x))","Gemy" +"1461089169327","out[(abs(x) <= 1)] <- (3/4)*(1 - x[(abs(x) <= 1)]^2)","Gemy" +"1461089169328","out","Gemy" +"1461089169328","}","Gemy" +"1461089169329","rectangular <- function(x)","Gemy" +"1461089169330","{","Gemy" +"1461089169330","out <- numeric(length(x))","Gemy" +"1461089169331","out[(abs(x) <= 1)] <- 0.5","Gemy" +"1461089169331","out","Gemy" +"1461089169332","}","Gemy" +"1461089169333","normal <- function(x)","Gemy" +"1461089169333","{","Gemy" +"1461089169334","out <- (1/sqrt(2*pi))*exp(-0.5*x^2)","Gemy" +"1461089169334","out","Gemy" +"1461089169334","}","Gemy" +"1461089169336","kern_poly <- function(x, y, bw, kern = epanechnikov, degree = 1,","Gemy" +"1461089169336","dom = seq(min(x), max(x), by = diff(range(x)/200)))","Gemy" +"1461089169337","{","Gemy" +"1461089169337","","Gemy" +"1461089169338","","Gemy" +"1461089169338","","Gemy" +"1461089169339","","Gemy" +"1461089169339","","Gemy" +"1461089169340","if (length(x) != length(y)) stop(Error: x and y must have same length!)","Gemy" +"1461089169341","wts <- function(x_focal, x, y, bw, kern, degree)","Gemy" +"1461089169341","{","Gemy" +"1461089169342","","Gemy" +"1461089169342","","Gemy" +"1461089169343","if (kern == epanechnikov) wt <- epanech((x - x_focal)/bw)","Gemy" +"1461089169343","if (kern == rectangular) wt <- rectangular((x - x_focal)/bw)","Gemy" +"1461089169344","if (kern == normal) wt <- normal((x - x_focal)/bw)","Gemy" +"1461089169344","if (kern == tricube) wt <- tricube((x - x_focal)/bw)","Gemy" +"1461089169345","lm_out <- lm(y ~ poly(x, degree, raw = T), weights = wt)","Gemy" +"1461089169346","lm_out <- lm(y ~ poly(x, degree, raw = T), weights = wt)","Gemy" +"1461089169347","output <- predict(lm_out, newdata = data.frame(x = t(t(x_focal))))","Gemy" +"1461089169348","output","Gemy" +"1461089169349","}","Gemy" +"1461089169351","dom <- sort(dom)","Gemy" +"1461089169352","means_out <- sapply(dom, wts, x = x, y = y, bw = bw, kern = kern, degree = degree)","Gemy" +"1461089169353","out <- cbind(dom, means_out)","Gemy" +"1461089169355","out","Gemy" +"1461089169356","}","Gemy" +"1461089169359","loocv1 <- function(i, x, y, bw, kern = epanechnikov, degree = 2)","Gemy" +"1461089169360","{","Gemy" +"1461089169360","","Gemy" +"1461089169361","","Gemy" +"1461089169362","","Gemy" +"1461089169362","","Gemy" +"1461089169363","","Gemy" +"1461089169363","","Gemy" +"1461089169363","","Gemy" +"1461089169364","","Gemy" +"1461089169365","kern_poly(x = x[-i], y = y[-i], bw = bw, kern = kern, degree = degree, dom = c(x[i]))","Gemy" +"1461089169365","}","Gemy" +"1461089169367","loocv2 <- function(x, y, bw, kern = epanechnikov, degree = 2)","Gemy" +"1461089169367","{","Gemy" +"1461089169368","","Gemy" +"1461089169368","","Gemy" +"1461089169369","","Gemy" +"1461089169369","cvfits <- sapply(1","Gemy" +"length(x), loocv1, x = x, y = y, bw = bw, kern = kern, degree = degree)","","Gemy" +"1461089169370","mse <- mean((y - cvfits)^2)","Gemy" +"1461089169370","mse","Gemy" +"1461089169371","}","Gemy" +"1461089169372","loocv3 <- function(BW, x, y, kern = epanechnikov, degree = 2, cores = 1)","Gemy" +"1461089169373","{","Gemy" +"1461089169373","","Gemy" +"1461089169374","","Gemy" +"1461089169374","","Gemy" +"1461089169374","","Gemy" +"1461089169375","","Gemy" +"1461089169375","library(parallel) ","Gemy" +"1461089169376","cvs <- mclapply(BW, loocv2, x = x, y = y, kern = kern, degree = degree, mc.cores = cores)","Gemy" +"1461089169377","best <- BW[which(cvs == min(unlist(cvs)))]","Gemy" +"1461089169378","plot(BW, cvs, type = b, xlab = Bandwidth, ylab = Cross-Validated Error,","Gemy" +"1461089169379","main = paste0(Best Bandwidth = , best, ; , MSPE = , round(min(unlist(cvs)), 2)))","Gemy" +"1461089169380","abline(v = best, lty = 2)","Gemy" +"1461089169382","out <- cbind(BW, cvs)","Gemy" +"1461089169383","out","Gemy" +"1461089169384","}","Gemy" +"1461089169387","kern_ATE <- function(bwa, bwb, dega, degb, x, y, kern, degree, cutoff)","Gemy" +"1461089169388","{","Gemy" +"1461089169388","","Gemy" +"1461089169390","Xa <- x[which(x > cutoff)]; Xb <- x[which(x <= cutoff)]","Gemy" +"1461089169391","Ya <- y[which(x > cutoff)]; Yb <- y[which(x <= cutoff)]","Gemy" +"1461089169392","below <- kern_poly(Xb, Yb, bw = bwb, kern = kern, degree = degb, dom = cutoff)","Gemy" +"1461089169392","above <- kern_poly(Xa, Ya, bw = bwa, kern = kern, degree = dega, dom = cutoff)","Gemy" +"1461089169393","ATE <- above[2] - below[2]","Gemy" +"1461089169394","ATE","Gemy" +"1461089169394","}","Gemy" +"1461089201098","","Gemy" +"1461089201103","","Gemy" +"1461089201103","","Gemy" +"1461089201103","","Gemy" +"1461089201104","","Gemy" +"1461089201104","library(rdrobust)","Gemy" +"1461089201163","data(rdrobust_RDsenate)","Gemy" +"1461089214896","rddat <- na.omit(rdrobust_RDsenate)","Gemy" +"1461089214899","dim(rddat)","Gemy" +"1461089214902","Y <- rddat$vote","Gemy" +"1461089214903","X <- rddat$margin","Gemy" +"1461089214904","D <- ifelse(X >= 0, 1, 0)","Gemy" +"1461089214905","plot(Y ~ X, pch = D+1, col = c(4,2)[D+1], xlab = US Senate Race Victory Margin for Democratic Candidate at Time t,","Gemy" +"1461089214905","ylab = Percent of Vote for New Democratic Candidate at Time t + 2)","Gemy" +"1461089241527","","Gemy" +"1461089241528","","Gemy" +"1461089241532","","Gemy" +"1461089241532","","Gemy" +"1461089241533","","Gemy" +"1461089241533","","Gemy" +"1461089241533","","Gemy" +"1461089241533","summary(lm.m1 <- lm(Y ~ X + D))","Gemy" +"1461089241580","summary(lm.m2 <- lm(Y ~ X + I(X^2) + D))","Gemy" +"1461089241593","summary(lm.m3 <- lm(Y ~ X + I(X^2) + I(X^3) + D))","Gemy" +"1461089241606","summary(lm.m4 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + D))","Gemy" +"1461089241668","summary(lm.m5 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + I(X^5) + D))","Gemy" +"1461089266814","","Gemy" +"1461089266819","AIC(lm.m1, lm.m2, lm.m3, lm.m4, lm.m5) ","Gemy" +"1461089266827","anova(lm.m1, lm.m2, lm.m3, lm.m4, lm.m5) ","Gemy" +"1461089266836","","Gemy" +"1461089266837","summary(lm.i1 <- lm(Y ~ X + D + X","Gemy" +"D))","","Gemy" +"1461089266848","summary(lm.i2 <- lm(Y ~ X + I(X^2) + D + X","Gemy" +"D + I(X^2)","D))","Gemy" +"1461089266860","summary(lm.i3 <- lm(Y ~ X + I(X^2) + I(X^3) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D))","","Gemy" +"1461089266876","summary(lm.i4 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D + I(X^4)","D))","Gemy" +"1461089266891","summary(lm.i5 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + I(X^5) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D + I(X^4)","D + I(X^5)","Gemy" +"D))","","Gemy" +"1461089266911","","Gemy" +"1461089266911","AIC(lm.i1, lm.i2, lm.i3, lm.i4, lm.i5) ","Gemy" +"1461089266915","anova(lm.i1, lm.i2, lm.i3, lm.i4, lm.i5) ","Gemy" +"1461089266925","","Gemy" +"1461089266926","AIC(lm.m3, lm.i4) ","Gemy" +"1461089266930","anova(lm.m3, lm.i4) ","Gemy" +"1461089266940","","Gemy" +"1461089266941","plot(Y ~ X, pch = D+1, col = c(4,2)[D+1], xlab = US Senate Race Victory Margin for Democratic Candidate at Time t,","Gemy" +"1461089266942","ylab = Percent of Vote for New Democratic Candidate at Time t + 2)","Gemy" +"1461089283537","df0 <- data.frame(cbind(seq(-100, 0, .1), rep(0, 1001)))","Gemy" +"1461089283539","names(df0) <- c(X, D)","Gemy" +"1461089283540","head(df0)","Gemy" +"1461089283542","prd0 <- predict(lm.i4, newdata = df0, interval = confidence, level = 0.95)","Gemy" +"1461089283553","points(x = seq(-100, 0, .1), y = prd0[,1], type = l, lwd = 3)","Gemy" +"1461089283557","points(x = seq(-100, 0, .1), y = prd0[,2], type = l, lwd = 2, lty = 2)","Gemy" +"1461089283559","points(x = seq(-100, 0, .1), y = prd0[,3], type = l, lwd = 2, lty = 2)","Gemy" +"1461089283561","df1 <- data.frame(cbind(seq(0, 100, .1), rep(1, 1001)))","Gemy" +"1461089283562","names(df1) <- c(X, D)","Gemy" +"1461089283563","head(df1)","Gemy" +"1461089283565","prd1 <- predict(lm.i4, newdata = df1, interval = confidence, level = 0.95)","Gemy" +"1461089283571","points(x = seq(0, 100, .1), y = prd1[,1], type = l, lwd = 3)","Gemy" +"1461089283573","points(x = seq(0, 100, .1), y = prd1[,2], type = l, lwd = 2, lty = 2)","Gemy" +"1461089283575","points(x = seq(0, 100, .1), y = prd1[,3], type = l, lwd = 2, lty = 2)","Gemy" +"1461089283578","","Gemy" +"1461089283579","","Gemy" +"1461089283579","","Gemy" +"1461089283580","df00 <- data.frame(cbind(0, 0))","Gemy" +"1461089283581","names(df00) <- c(X, D)","Gemy" +"1461089283582","df11 <- data.frame(cbind(0, 1))","Gemy" +"1461089283583","names(df11) <- c(X, D)","Gemy" +"1461089283583","(tau.hat.parametric <- predict(lm.i4, df11) - predict(lm.i4, df00))","Gemy" +"1461089283588","","Gemy" +"1461089283588","","Gemy" +"1461089283589","summary(lm.i4)","Gemy" +"1461089300786","","Gemy" +"1461089300787","","Gemy" +"1461089300791","","Gemy" +"1461089300792","","Gemy" +"1461089300792","indb <- which(X <= 0); inda <- which(X > 0)","Gemy" +"1461089300793","Xb <- X[indb]; Xa <- X[inda]; Yb <- Y[indb]; Ya <- Y[inda]","Gemy" +"1461089300795","","Gemy" +"1461089300796","","Gemy" +"1461089300797","plot(Y ~ X, pch = D+1, col = c(4,2)[D+1], xlab = US Senate Race Victory Margin for Democratic Candidate at Time t,","Gemy" +"1461089300798","ylab = Percent of Vote for New Democratic Candidate at Time t + 2)","Gemy" +"1461089300888","","Gemy" +"1461089300888","t1b <- kern_poly(x = Xb, y = Yb, bw = 100, degree = 2)","Gemy" +"1461089302639","t1a <- kern_poly(x = Xa, y = Ya, bw = 100, degree = 2)","Gemy" +"1461089304153","points(t1b, type = l, lwd = 3, lty = 1, col = 1)","Gemy" +"1461089304154","points(t1a, type = l, lwd = 3, lty = 1, col = 1)","Gemy" +"1461089304159","","Gemy" +"1461089304159","t3b <- kern_poly(x = Xb, y = Yb, bw = 30, degree = 1)","Gemy" +"1461089305842","t3a <- kern_poly(x = Xa, y = Ya, bw = 30, degree = 1)","Gemy" +"1461089307406","points(t3b, type = l, lwd = 4, lty = 3, col = 6)","Gemy" +"1461089307407","points(t3a, type = l, lwd = 4, lty = 3, col = 6)","Gemy" +"1461089307412","","Gemy" +"1461089307413","t2b <- kern_poly(x = Xb, y = Yb, bw = 10, degree = 2)","Gemy" +"1461089309107","t2a <- kern_poly(x = Xa, y = Ya, bw = 10, degree = 2)","Gemy" +"1461089310780","points(t2b, type = l, lwd = 3, lty = 2, col = 3)","Gemy" +"1461089310781","points(t2a, type = l, lwd = 3, lty = 2, col = 3)","Gemy" +"1461089310786","","Gemy" +"1461089310786","t4b <- kern_poly(x = Xb, y = Yb, bw = 5, degree = 2)","Gemy" +"1461089312534","t4a <- kern_poly(x = Xa, y = Ya, bw = 5, degree = 2)","Gemy" +"1461089314195","points(t4b, type = l, lwd = 3, lty = 3, col = 8)","Gemy" +"1461089314197","points(t4a, type = l, lwd = 3, lty = 3, col = 8)","Gemy" +"1461089314199","","Gemy" +"1461089314199","","Gemy" +"1461089314200","","Gemy" +"1461089314200","","Gemy" +"1461089314200","","Gemy" +"1461089314201","","Gemy" +"1461089314201","","Gemy" +"1461089314202","cvb1 <- loocv3(BW = seq(10, 200, 2), x = Xb, y = Yb, cores = 4, degree = 1, kern = epanechnikov)","Gemy" +"1461089569449","","Gemy" +"1461089569450","cvb2 <- loocv3(BW = seq(10, 200, 2), x = Xb, y = Yb, cores = 4, degree = 2, kern = epanechnikov)","Gemy" +"1461089864591","","Gemy" +"1461089864592","","Gemy" +"1461089864593","cva1 <- loocv3(BW = seq(10, 200, 2), x = Xa, y = Ya, cores = 4, degree = 1, kern = epanechnikov)","Gemy" +"1461090222522","","Gemy" +"1461090222524","cva2 <- loocv3(BW = seq(10, 200, 2), x = Xa, y = Ya, cores = 4, degree = 2, kern = epanechnikov)","Gemy" +"1461090560161","","Gemy" +"1461090560167","","Gemy" +"1461090560169","","Gemy" +"1461090560170","","Gemy" +"1461090560172","","Gemy" +"1461090560173","library(rdrobust)","Gemy" +"1461090560337","data(rdrobust_RDsenate)","Gemy" +"1461090560363","rddat <- na.omit(rdrobust_RDsenate)","Gemy" +"1461090560372","dim(rddat)","Gemy" +"1461090560374","Y <- rddat$vote","Gemy" +"1461090560377","X <- rddat$margin","Gemy" +"1461090560379","D <- ifelse(X >= 0, 1, 0)","Gemy" +"1461090560384","plot(Y ~ X, pch = D+1, col = c(4,2)[D+1], xlab = US Senate Race Victory Margin for Democratic Candidate at Time t,","Gemy" +"1461090560386","ylab = Percent of Vote for New Democratic Candidate at Time t + 2)","Gemy" +"1461090560833","","Gemy" +"1461090560835","","Gemy" +"1461090560836","","Gemy" +"1461090560838","","Gemy" +"1461090560846","","Gemy" +"1461090560849","","Gemy" +"1461090560850","","Gemy" +"1461090560859","summary(lm.m1 <- lm(Y ~ X + D))","Gemy" +"1461090561930","summary(lm.m2 <- lm(Y ~ X + I(X^2) + D))","Gemy" +"1461090562272","summary(lm.m3 <- lm(Y ~ X + I(X^2) + I(X^3) + D))","Gemy" +"1461090562333","summary(lm.m4 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + D))","Gemy" +"1461090562419","summary(lm.m5 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + I(X^5) + D))","Gemy" +"1461090562499","","Gemy" +"1461090562502","AIC(lm.m1, lm.m2, lm.m3, lm.m4, lm.m5) ","Gemy" +"1461090562539","anova(lm.m1, lm.m2, lm.m3, lm.m4, lm.m5) ","Gemy" +"1461090562623","","Gemy" +"1461090562624","summary(lm.i1 <- lm(Y ~ X + D + X","Gemy" +"D))","","Gemy" +"1461090562676","summary(lm.i2 <- lm(Y ~ X + I(X^2) + D + X","Gemy" +"D + I(X^2)","D))","Gemy" +"1461090562746","summary(lm.i3 <- lm(Y ~ X + I(X^2) + I(X^3) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D))","","Gemy" +"1461090562830","summary(lm.i4 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D + I(X^4)","D))","Gemy" +"1461090562944","summary(lm.i5 <- lm(Y ~ X + I(X^2) + I(X^3) + I(X^4) + I(X^5) + D + X","Gemy" +"D + I(X^2)","D + I(X^3)","Gemy" +"D + I(X^4)","D + I(X^5)","Gemy" +"D))","","Gemy" +"1461090563037","","Gemy" +"1461090563039","AIC(lm.i1, lm.i2, lm.i3, lm.i4, lm.i5) ","Gemy" +"1461090563061","anova(lm.i1, lm.i2, lm.i3, lm.i4, lm.i5) ","Gemy" +"1461090563106","","Gemy" +"1461090563107","AIC(lm.m3, lm.i4) ","Gemy" +"1461090563143","anova(lm.m3, lm.i4) ","Gemy" +"1461090563192","","Gemy" +"1461090563208","plot(Y ~ X, pch = D+1, col = c(4,2)[D+1], xlab = US Senate Race Victory Margin for Democratic Candidate at Time t,","Gemy" +"1461090563211","ylab = Percent of Vote for New Democratic Candidate at Time t + 2)","Gemy" +"1461090563859","df0 <- data.frame(cbind(seq(-100, 0, .1), rep(0, 1001)))","Gemy" +"1461090563863","names(df0) <- c(X, D)","Gemy" +"1461090563865","head(df0)","Gemy" +"1461090563882","prd0 <- predict(lm.i4, newdata = df0, interval = confidence, level = 0.95)","Gemy" +"1461090563923","points(x = seq(-100, 0, .1), y = prd0[,1], type = l, lwd = 3)","Gemy" +"1461090564867","points(x = seq(-100, 0, .1), y = prd0[,2], type = l, lwd = 2, lty = 2)","Gemy" +"1461090564883","points(x = seq(-100, 0, .1), y = prd0[,3], type = l, lwd = 2, lty = 2)","Gemy" +"1461090564891","df1 <- data.frame(cbind(seq(0, 100, .1), rep(1, 1001)))","Gemy" +"1461090564898","names(df1) <- c(X, D)","Gemy" +"1461090564900","head(df1)","Gemy" +"1461090564910","prd1 <- predict(lm.i4, newdata = df1, interval = confidence, level = 0.95)","Gemy" +"1461090564945","points(x = seq(0, 100, .1), y = prd1[,1], type = l, lwd = 3)","Gemy" +"1461090565926","points(x = seq(0, 100, .1), y = prd1[,2], type = l, lwd = 2, lty = 2)","Gemy" +"1461090565946","points(x = seq(0, 100, .1), y = prd1[,3], type = l, lwd = 2, lty = 2)","Gemy" +"1461090565970","","Gemy" +"1461090565972","","Gemy" +"1461090565979","","Gemy" +"1461090565981","df00 <- data.frame(cbind(0, 0))","Gemy" +"1461090566010","names(df00) <- c(X, D)","Gemy" +"1461090566012","df11 <- data.frame(cbind(0, 1))","Gemy" +"1461090566016","names(df11) <- c(X, D)","Gemy" +"1461090566018","(tau.hat.parametric <- predict(lm.i4, df11) - predict(lm.i4, df00))","Gemy" +"1461692502856","load(~/Downloads/eclskR.Rdata)","Gemy" +"1464017792694","clear","Gemy" +"1464019284150","plot (1,1)","Gemy" +"1464019289684","5+7","Gemy" +"1464019662400","","Gemy" +"1464019675096","","Gemy" +"1464019805350","install.packages(graphics)","Gemy" +"1464019805352","library(graphics)","Gemy" +"1464019805355","demo(image)","Gemy" +"1464019813256","install.packages(graphics)","Gemy" +"1464019827646","install.packages(graphics)","Gemy" +"1464019832683","install.packages(graphics)","Gemy" +"1464019838158","install.packages(graphics)","Gemy" +"1464019843858","install.packages(graphics)","Gemy" +"1464019850749","install.packages(graphics)","Gemy" +"1464019918954","install.packages(graphics)","Gemy" +"1464019922139","install.packages(graphics)","Gemy" +"1464019939598","demo(persp)","Gemy" +"1464020445456","5+5","Gemy" +"1464020456998","5+4","Gemy" +"1464020460148","10-8","Gemy" +"1464020462802","14/4","Gemy" +"1464020465005","22*4","Gemy" +"1464020470323","7^2","Gemy" +"1464020478011","sqrt(49)","Gemy" +"1464020483222","exp(1)","Gemy" +"1464020497441","log(exp(10))","Gemy" +"1464020502003","sin(pi/2)","Gemy" +"1464020505752","cos(pi)","Gemy" +"1464020521762","51 %% 10 ","Gemy" +"1464020639267","51 %/% 10","Gemy" +"1464020665487","? %/%","Gemy" +"1464020685592","? %%","Gemy" +"1464020709850","3 + (4-1)","Gemy" +"1464020721405","4+4(5-1)","Gemy" +"1464020738447","3 + 3*(2-3)","Gemy" +"1464020771208","2","Gemy" +"9","","Gemy" +"1464020793203","1e8 -100","Gemy" +"1464020814480","","Gemy" +"1464020819267","x <- 8","Gemy" +"1464020822052","x","Gemy" +"1464020826046","x +8","Gemy" +"1464020830748","x*3","Gemy" +"1464020854691","x^2","Gemy" +"1464020861307","X","Gemy" +"1464020882699","X <- 9","Gemy" +"1464020886818","x+X","Gemy" +"1464020889482","X","Gemy" +"1464020896994","y <- 1000","Gemy" +"1464020903411","x+y","Gemy" +"1464020909610","Z <=y-x","Gemy" +"1464020917985","z <- y/x","Gemy" +"1464020921416","z","Gemy" +"1464020933633","x+y =","Gemy" +"1464020938256","y-x","Gemy" +"1464021123596","1","Gemy" +" 20","","Gemy" +"1464021130650","20","Gemy" +"1","","Gemy" +"1464021137700","2.3 ","Gemy" +" 2.8","","Gemy" +"1464021146458","2.5 ","Gemy" +" 24.9","","Gemy" +"1464021167282","3.3","Gemy" +"4.6","","Gemy" +"1464021193131","seq(from=1, to =8, by =1)","Gemy" +"1464021215186","seq(from=3, to=8, by 0.1)","Gemy" +"1464021242528","seq(from=2, to=8, by 0.1)","Gemy" +"1464021268121","seq(from=2, to=8, by= 0.01)","Gemy" +"1464021301288","seq(from=2,to =8, by = 0.1)","Gemy" +"1464021348632","x<-9","Gemy" +"1464021363557","y<-1","Gemy" +"10","","Gemy" +"1464021400222","assign(x,8)","Gemy" +"1464021432956","assign(x, 100)","Gemy" +"1464021469756","assign(x,100)","Gemy" +"1464021480906","?assign","Gemy" +"1464021513289","assign(x, 100)","Gemy" +"1464021524033","assign( y, 7)","Gemy" +"1464021621848","seq(from=9, to =10, by 0.01)","Gemy" +"1464021634951","seq(from=0, to =3, by = 0.1)","Gemy" +"1464021668276","4.1 ","Gemy" +" 3.4","","Gemy" +"1464021675219","?clear","Gemy" +"1464021776128","cool","Gemy" +"1464021805554","seq (from =3, to =5, by =1)","Gemy" +"1464021815350","x <- 1","Gemy" +"10","","Gemy" +"1464021838622","3.4 ","Gemy" +" 3.6","","Gemy" +"1464021854189","x +3","Gemy" +"1464021863445","4*x","Gemy" +"1464021869230","x&2","Gemy" +"1464021874349","x^2","Gemy" +"1464021888740","c (1,4,5,3)","Gemy" +"1464021994698","y <- c(4,2,7)","Gemy" +"1464021997353","y","Gemy" +"1464021998113","x","Gemy" +"1464021999938","c","Gemy" +"1464022016058","x+y","Gemy" +"1464022086785","x <- x+3","Gemy" +"1464022091784","x","Gemy" +"1464022115679","x^2","Gemy" +"1464022150558","1","Gemy" +"7","","Gemy" +"1464022177942","rep(y,times=4)","Gemy" +"1464022230133","rep (y, times=2, each =2)","Gemy" +"1464022246732","rep (y, times =4, each -2)","Gemy" +"1464022255484","rep(y, times =2, each =2)","Gemy" +"1464022275115","","Gemy" +"1464022297292","is.na(10)","Gemy" +"1464022307867","is.na(NA)","Gemy" +"1464022326520","z <- c(1","Gemy" +"3, NA)","","Gemy" +"1464022328433","z","Gemy" +"1464022335490","is.na (z)","Gemy" +"1464022422014","0/0","Gemy" +"1464022428389","inf - inf","Gemy" +"1464022433935","Inf - Inf","Gemy" +"1464022487957","help.start()","Gemy" +"1464022508041","1/0","Gemy" +"1464022521860","-3/0","Gemy" +"1464022579540","help (help)","Gemy" +"1464022586027","?help","Gemy" +"1464022590497","help(assign)","Gemy" +"1464022596520","?mean","Gemy" +"1464022604369","?%/%","Gemy" +"1464022611322","? +","Gemy" +"1464022614184","4","Gemy" +"1464022630426","help.search","Gemy" +"1464022644761","help.search (mean)","Gemy" +"1464022652112","help.search (mean)","Gemy" +"1464022675719","example(plot)","Gemy" +"1464022712030",".libPath()","Gemy" +"1464022727686","library()","Gemy" +"1464022771860","install.packages(car)","Gemy" +"1464022783292","?logit","Gemy" +"1464022791320","library(car)","Gemy" +"1464023041206","x <- (1, 5, 6,6)","Gemy" +"1464023052079","c(1,5,6)","Gemy" +"1464023061086","x<- c(1,5,6)","Gemy" +"1464023075508","x(5)<-6","Gemy" +"1464023085525","x[5] <- 6","Gemy" +"1464023087501","x","Gemy" +"1464023163549","x <- c( 1, 4, 6, 7)","Gemy" +"1464023173083","x[2]<-8","Gemy" +"1464023175009","x","Gemy" +"1464023194209","x[3]<-NA","Gemy" +"1464023195537","x","Gemy" +"1464023297477","x[3]<-6","Gemy" +"1464023299390","x","Gemy" +"1464023372685","v <- c(5, 24, 10, 2, 5)","Gemy" +"1464023434461","seq (1,2, 3)","Gemy" +"1464023500977","x <- (1,2,3)","Gemy" +"1464023510265","1","Gemy" +"3","","Gemy" +"1464023603712","seq (from=1, to =3, by=1)","Gemy" +"1464023640853","x <- seq(from =1, to =3, by =1)","Gemy" +"1464023643142","x","Gemy" +"1464023741333","rep (x, times =1)","Gemy" +"1464023746691","rep(x, times=2)","Gemy" +"1464023801111","seq(from= 4, to =6, by = 0.1)","Gemy" +"1464023801118","rep (seq(from=1, to=4, by =1), times =2)","Gemy" +"1464023919722","rep(x, times =2, each =2)","Gemy" +"1464024084249","?","Gemy" +"1464024088202","?:","Gemy" +"1464024103562","help(","Gemy" +")","","Gemy" +"1464024144760","example (","Gemy" +")","","Gemy" +"1464024165680","help(","Gemy" +")","","Gemy" +"1464024171001","help(:)","Gemy" +"1464024210272","help.search(","Gemy" +")","","Gemy" +"1464024218168","help.search(:)","Gemy" +"1464024253446","25","Gemy" +"1464024256273","2","Gemy" +"4","","Gemy" +"1464024326160","seq (from=1, to =4, by =1)","Gemy" +"1464024374029","2.4 ","Gemy" +" 5.5","","Gemy" +"1464024391247","seq(from =2.4, to = 5.4, by 1)","Gemy" +"1464024408000","seq(from=2.4, to =5.4, by =1)","Gemy" +"1464147425733","? seq","Gemy" +"1464147480201","seq( from =4, to =6, by =1)","Gemy" +"1464147533024","","Gemy" +"1464147533025","x<-seq(from= 4, to =6, by = 1)","Gemy" +"1464147533026","","Gemy" +"1464147533026","rep (seq(from=1, to=4, by =1), times =2)","Gemy" +"1464147533027","rep (x, times=2)","Gemy" +"1464147659869","","Gemy" +"1464147659870","rep(x, times =2, each =2) ","Gemy" +"1464147706985","? NA","Gemy" +"1464147727490","rep(x, times =2, each =2) ","Gemy" +"1464147727491","2. ","Gemy" +"1464147727495","y <- c(1, 3, 4, 6)","Gemy" +"1464147727496","y","Gemy" +"1464147727496","","Gemy" +"1464147727496","","Gemy" +"1464147727497","y[3] <-NA","Gemy" +"1464147727497","y","Gemy" +"1464147780384","is.na(y)","Gemy" +"1464147830380","3. ","Gemy" +"1464147830381","? :","Gemy" +"1464147830399","help(:)","Gemy" +"1464147838768","","Gemy" +"1464147838769","y[3] <-3","Gemy" +"1464147838773","y","Gemy" +"1464147891271","","Gemy" +"1464147891276","2.4 ","Gemy" +" 5.5","","Gemy" +"1464148014109","","Gemy" +"1464148014114","1","Gemy" +"4","","Gemy" +"1464148014114","4","Gemy" +"1","","Gemy" +"1464148014115","","Gemy" +"1464148014115","seq( from =1, to=4, by =1)","Gemy" +"1464148014116","seq(from=4, to=1, by 1)","Gemy" +"1464148022878","seq( from =1, to=4, by =1)","Gemy" +"1464148022879","seq(from=4, to=1, by= 1)","Gemy" +"1464148036222","seq( from =1, to=4, by =1)","Gemy" +"1464148036223","seq(from=4, to=1, by=-1)","Gemy" +"1464148106676","pi","Gemy" +"6","","Gemy" +"1464148131987","?seq","Gemy" +"1464148217824","?:","Gemy" +"1464148351349","?seq","Gemy" +"1464148431413","","Gemy" +"1464148431414","","Gemy" +"1464148431417","","Gemy" +"1464148431418","","Gemy" +"1464148431418","seq (from =pi, to = 6, by 0.3)","Gemy" +"1464148440028","","Gemy" +"1464148440028","seq (from =pi, to = 6, by= 0.3)","Gemy" +"1464148983189","","Gemy" +"1464148983194","","Gemy" +"1464148983194","","Gemy" +"1464148983195","","Gemy" +"1464148983195","seq(from= 4, to =6, by = 1)","Gemy" +"1464148983196","x<-seq(from= 4, to =6, by = 1)","Gemy" +"1464148983197","","Gemy" +"1464148983197","rep (seq(from=1, to=4, by =1), times =2) ","Gemy" +"1464148983198","rep (x, times=3) ","Gemy" +"1464148983199","","Gemy" +"1464148983200","rep(x, times =2, each =2) ","Gemy" +"1464148983201","","Gemy" +"1464148983202","y <- c(1, 3, 4, 6)","Gemy" +"1464148983202","y","Gemy" +"1464148983203","","Gemy" +"1464148983203","","Gemy" +"1464148983204","y[3] <-NA","Gemy" +"1464148983204","y","Gemy" +"1464148983205","is.na(y) ","Gemy" +"1464148983206","","Gemy" +"1464148983206","y[3] <-3","Gemy" +"1464148983207","y","Gemy" +"1464148983207","","Gemy" +"1464148983208","? :","Gemy" +"1464148983238","help(:)","Gemy" +"1464148983251","","Gemy" +"1464148983252","","Gemy" +"1464148983252","1","Gemy" +"4","","Gemy" +"1464148983252","4","Gemy" +"1","","Gemy" +"1464148983253","","Gemy" +"1464148983253","seq( from =1, to=4, by =1)","Gemy" +"1464148983254","seq(from=4, to=1, by=-1)","Gemy" +"1464148983255","","Gemy" +"1464148983255","2.4 ","Gemy" +" 5.5","","Gemy" +"1464148983256","","Gemy" +"1464148983256","seq(from =2.4, to =5.4, by =1)","Gemy" +"1464148983257","","Gemy" +"1464148983258","","Gemy" +"1464148983258","","Gemy" +"1464148983258","","Gemy" +"1464148983259","","Gemy" +"1464148983259","seq (from =pi, to = 6, by= 0.3)","Gemy" +"1464148983260","","Gemy" +"1464148983260","","Gemy" +"1464151275691","","Gemy" +"1464151275699","","Gemy" +"1464151275699","","Gemy" +"1464151275700","","Gemy" +"1464151275700","seq(from= 4, to =6, by = 1)","Gemy" +"1464151275703","x<-seq(from= 4, to =6, by = 1)","Gemy" +"1464151275704","","Gemy" +"1464151275705","rep (seq(from=1, to=4, by =1), times =2) ","Gemy" +"1464151275705","rep (x, times=3) ","Gemy" +"1464151275706","","Gemy" +"1464151275707","rep(x, times =2, each =2) ","Gemy" +"1464151275707","","Gemy" +"1464151275708","y <- c(1, 3, 4, 6)","Gemy" +"1464151275708","y","Gemy" +"1464151275709","","Gemy" +"1464151275709","","Gemy" +"1464151275710","y[3] <-NA","Gemy" +"1464151275710","y","Gemy" +"1464151275711","is.na(y) ","Gemy" +"1464151275711","","Gemy" +"1464151275712","y[3] <-3","Gemy" +"1464151275713","y","Gemy" +"1464151275714","","Gemy" +"1464151275715","? :","Gemy" +"1464151275746","help(:)","Gemy" +"1464151275762","","Gemy" +"1464151275763","","Gemy" +"1464151275763","1","Gemy" +"4","","Gemy" +"1464151275764","4","Gemy" +"1","","Gemy" +"1464151275764","","Gemy" +"1464151275765","seq( from =1, to=4, by =1)","Gemy" +"1464151275765","seq(from=4, to=1, by=-1)","Gemy" +"1464151275766","","Gemy" +"1464151275767","2.4 ","Gemy" +" 5.5","","Gemy" +"1464151275768","","Gemy" +"1464151275768","seq(from =2.4, to =5.4, by =1)","Gemy" +"1464151275769","","Gemy" +"1464151275769","","Gemy" +"1464151275770","","Gemy" +"1464151275770","","Gemy" +"1464151275770","","Gemy" +"1464151275771","seq (from =pi, to = 6, by= 0.3)","Gemy" +"1464151275772","","Gemy" +"1464151275772","","Gemy" +"1464151275772","","Gemy" +"1464151275773","","Gemy" +"1464151275773","","Gemy" +"1464151275774","","Gemy" +"1464151275774","","Gemy" +"1464151275775","","Gemy" +"1464151275775","","Gemy" +"1464151275775","","Gemy" +"1464151275775","","Gemy" +"1464151275776","","Gemy" +"1464151275776","","Gemy" +"1464151275776","","Gemy" +"1464151275777","","Gemy" +"1464151275777","","Gemy" +"1464151275777","","Gemy" +"1464151275778","","Gemy" +"1464151275778","","Gemy" +"1464151275778","","Gemy" +"1464151275779","","Gemy" +"1464151275779","","Gemy" +"1464151275779","","Gemy" +"1464151275780","","Gemy" +"1464151275780","","Gemy" +"1464151275781","","Gemy" +"1464151275781","","Gemy" +"1464151275781","","Gemy" +"1464151275781","","Gemy" +"1464151275782","","Gemy" +"1464151375889","?seq","Gemy" +"1464151395282","seq(from=3, to =5)","Gemy" +"1464151432862","seq(from =5, to =3)","Gemy" +"1464151511933","seq(from=3.4, to =4.5)","Gemy" +"1464151564625","","Gemy" +"1464151564626","","Gemy" +"1464151564630","","Gemy" +"1464151564631","","Gemy" +"1464151564631","seq(from =4, to =6)","Gemy" +"1464151564632","seq(from= 4, to =6, by = 1)","Gemy" +"1464151564632","","Gemy" +"1464151564633","seq(from=3, to=1)","Gemy" +"1464151564634","seq(from=3, to=1, by =-1)","Gemy" +"1464151564634","","Gemy" +"1464151564635","x<-seq(from= 4, to =6, by = 1)","Gemy" +"1464151564636","","Gemy" +"1464151564636","rep (seq(from=1, to=4, by =1), times =2) ","Gemy" +"1464151564637","rep (x, times=3) ","Gemy" +"1464151564638","","Gemy" +"1464151564638","rep(x, times =2, each =2) ","Gemy" +"1464151564639","","Gemy" +"1464151564640","y <- c(1, 3, 4, 6)","Gemy" +"1464151564640","y","Gemy" +"1464151564641","","Gemy" +"1464151564641","","Gemy" +"1464151564641","y[3] <-NA","Gemy" +"1464151564642","y","Gemy" +"1464151564642","is.na(y) ","Gemy" +"1464151564643","","Gemy" +"1464151564643","y[3] <-3","Gemy" +"1464151564644","y","Gemy" +"1464151564645","","Gemy" +"1464151564645","? :","Gemy" +"1464151564665","help(:)","Gemy" +"1464151564679","","Gemy" +"1464151564680","","Gemy" +"1464151564680","1","Gemy" +"4","","Gemy" +"1464151564680","4","Gemy" +"1","","Gemy" +"1464151564681","","Gemy" +"1464151564681","seq( from =1, to=4, by =1)","Gemy" +"1464151564682","seq(from=4, to=1, by=-1)","Gemy" +"1464151564683","","Gemy" +"1464151564684","2.4 ","Gemy" +" 5.5","","Gemy" +"1464151564685","","Gemy" +"1464151564685","seq(from =2.4, to =5.4, by =1)","Gemy" +"1464151564686","","Gemy" +"1464151564686","","Gemy" +"1464151564687","","Gemy" +"1464151564687","","Gemy" +"1464151564687","","Gemy" +"1464151564688","seq (from =pi, to = 6, by= 0.3)","Gemy" +"1464151564688","","Gemy" +"1464151564689","","Gemy" +"1464151564689","","Gemy" +"1464151564689","","Gemy" +"1464151564690","","Gemy" +"1464151564690","","Gemy" +"1464151564690","","Gemy" +"1464151564691","","Gemy" +"1464151564691","","Gemy" +"1464151564691","","Gemy" +"1464151564692","","Gemy" +"1464151564692","","Gemy" +"1464151564693","","Gemy" +"1464151564693","","Gemy" +"1464151564693","","Gemy" +"1464151564693","","Gemy" +"1464151564694","","Gemy" +"1464151564694","","Gemy" +"1464151564694","","Gemy" +"1464151564695","","Gemy" +"1464151564695","","Gemy" +"1464151564695","","Gemy" +"1464151564695","","Gemy" +"1464151564696","","Gemy" +"1464151564696","","Gemy" +"1464151564696","","Gemy" +"1464151564697","","Gemy" +"1464151564697","","Gemy" +"1464151564697","","Gemy" +"1464151564697","","Gemy" +"1464151660943","","Gemy" +"1464151660947","","Gemy" +"1464151660948","","Gemy" +"1464151660948","","Gemy" +"1464151660948","seq(from =4, to =6)","Gemy" +"1464151660949","seq(from= 4, to =6, by = 1)","Gemy" +"1464151660950","","Gemy" +"1464151660951","seq(from=3, to=1)","Gemy" +"1464151660951","seq(from=3, to=1, by =-1)","Gemy" +"1464151660952","","Gemy" +"1464151660952","x<-seq(from= 4, to =6, by = 1)","Gemy" +"1464151660953","","Gemy" +"1464151660953","rep (seq(from=1, to=4, by =1), times =2) ","Gemy" +"1464151660954","rep (x, times=3) ","Gemy" +"1464151660955","","Gemy" +"1464151660955","rep(x, times =2, each =2) ","Gemy" +"1464151660956","","Gemy" +"1464151660956","y <- c(1, 3, 4, 6)","Gemy" +"1464151660957","y","Gemy" +"1464151660957","","Gemy" +"1464151660957","","Gemy" +"1464151660958","y[3] <-NA","Gemy" +"1464151660958","y","Gemy" +"1464151660959","is.na(y) ","Gemy" +"1464151660959","","Gemy" +"1464151660960","y[3] <-3","Gemy" +"1464151660960","y","Gemy" +"1464151660961","","Gemy" +"1464151660962","? :","Gemy" +"1464151660982","help(:)","Gemy" +"1464151661003","","Gemy" +"1464151661003","","Gemy" +"1464151661004","1","Gemy" +"4","","Gemy" +"1464151661004","4","Gemy" +"1","","Gemy" +"1464151661005","","Gemy" +"1464151661005","seq( from =1, to=4, by =1)","Gemy" +"1464151661006","seq(from=4, to=1, by=-1)","Gemy" +"1464151661007","","Gemy" +"1464151661007","2.4 ","Gemy" +" 5.5","","Gemy" +"1464151661008","","Gemy" +"1464151661008","seq(from =2.4, to =5.4, by =1)","Gemy" +"1464151661009","","Gemy" +"1464151661009","","Gemy" +"1464151661010","","Gemy" +"1464151661010","","Gemy" +"1464151661010","","Gemy" +"1464151661011","seq (from =pi, to = 6, by= 0.3)","Gemy" +"1464151661011","","Gemy" +"1464151661012","","Gemy" +"1464151661012","","Gemy" +"1464151661012","","Gemy" +"1464151661012","","Gemy" +"1464151661013","","Gemy" +"1464151661013","","Gemy" +"1464151661014","","Gemy" +"1464151661014","","Gemy" +"1464151661014","","Gemy" +"1464151661014","","Gemy" +"1464151661015","","Gemy" +"1464151661015","","Gemy" +"1464151661015","","Gemy" +"1464151661015","","Gemy" +"1464151661016","","Gemy" +"1464151661016","","Gemy" +"1464151661016","","Gemy" +"1464151661016","","Gemy" +"1464151661017","","Gemy" +"1464151661017","","Gemy" +"1464151661017","","Gemy" +"1464151661017","","Gemy" +"1464151661017","","Gemy" +"1464151661018","","Gemy" +"1464151661018","","Gemy" +"1464151661018","","Gemy" +"1464151661019","","Gemy" +"1464151661019","","Gemy" +"1464151661019","","Gemy" +"1464190367841","load(/Users/Gemy/Documents/Intro to R /ecls.Rdata)","Gemy" +"1464190378710","getwd()","Gemy" +"1464190415805","setwd(dir = /Users/Gemy/Documents/Intro to R)","Gemy" +"1464190575072","setwd(dir = /Users/Gemy/Documents/Intro to R /)","Gemy" +"1464190605383","load(file=file.choose())","Gemy" +"1464190627941","ls()","Gemy" +"1464190701571","getwd","Gemy" +"1464190712931","getwd()","Gemy" +"1464190721466","class(5)","Gemy" +"1464190727210","is.numeric(5)","Gemy" +"1464190781334","is.integer(5)","Gemy" +"1464190789761","is.integer(5L)","Gemy" +"1464190894533","n1 <- 5L","Gemy" +"1464190900862","n1","Gemy" +"1464190910027","x <-5","Gemy" +"1464190911631","x","Gemy" +"1464190942239","(vec <- c(2,4,3,39,NA,23.2,pi,0/0))","Gemy" +"1464190942240","","Gemy" +"1464190959219","vec[3]","Gemy" +"1464190993395","class(2L)","Gemy" +"1464190999018","class(2L*3L)","Gemy" +"1464191002995","class(x)","Gemy" +"1464191008458","class(n1)","Gemy" +"1464191051038","vec[c(1,2,8)]","Gemy" +"1464191068978","vec[-2]","Gemy" +"1464191106503","vec[8] <- 1000","Gemy" +"1464191109678","vec","Gemy" +"1464191200853","vec ==2","Gemy" +"1464191220476","class(2L/3L)","Gemy" +"1464191232949","num0 <- numeric(10)","Gemy" +"1464191240101","num0","Gemy" +"1464191253268","int(0) <- integer(10)","Gemy" +"1464191266749","int0 <- integer(10)","Gemy" +"1464191269331","int","Gemy" +"1464191272460","int0","Gemy" +"1464191299996","class(int0)","Gemy" +"1464191306581","class(num0)","Gemy" +"1464191341841","int0[5] <- 2.5","Gemy" +"1464191344673","int0","Gemy" +"1464191352656","class(int0)","Gemy" +"1464191361393","z <- 1","Gemy" +"10","","Gemy" +"1464191362664","z","Gemy" +"1464191390784","length(vec)","Gemy" +"1464191405463","vec [c(1,2, 8)]","Gemy" +"1464191409191","vec","Gemy" +"1464191436574","vec[1","Gemy" +"5] <- integer(4)","","Gemy" +"1464191455143","vec[1","Gemy" +"5] <- integer(5)","","Gemy" +"1464191458846","vec","Gemy" +"1464191482455","head(ecls) ","Gemy" +"1464191496915","dim(ecls)","Gemy" +"1464191527924","ecls$MIRT","Gemy" +"1464191560083","ecls$GENDER","Gemy" +"1464191569139","dim(ecls)","Gemy" +"1464191610955","class(ecls$GENDER)","Gemy" +"1464191615280","View(ecls)","Gemy" +"1464191655976","class(ecls$MIRT, ecls$GENDER)","Gemy" +"1464191700656","head(ecls)","Gemy" +"1464191757229","class(ecls)","Gemy" +"1464191779438","class(ecls$GENDER)","Gemy" +"1464191779438","class(ecls$WKWHITE)","Gemy" +"1464191779443","class(ecls$RIRT)","Gemy" +"1464191779443","class(ecls$MIRT)","Gemy" +"1464191779444","class(ecls$P1FIRKDG)","Gemy" +"1464191779445","class(ecls$F5SPECS)","Gemy" +"1464191779445","class(ecls$C6R4MSCL)","Gemy" +"1464191811309","str(ecls)","Gemy" +"1464191820278","dim(ecls)","Gemy" +"1464191821364","dim","Gemy" +"1464191823148","dim()","Gemy" +"1464191845227","x <- xyz","Gemy" +"1464191847474","x","Gemy" +"1464191851909","class(x)","Gemy" +"1464191855019","nchar(x)","Gemy" +"1464191873762","head(ecls)","Gemy" +"1464191876928","dim(ecls)","Gemy" +"1464191888210","names(ecls)","Gemy" +"1464191928760","char_vec <- names(ecls)","Gemy" +"1464191932170","char_vec","Gemy" +"1464191938769","length(char_vec)","Gemy" +"1464191946201","char_vec[4]","Gemy" +"1464191958152","str(elcs)","Gemy" +"1464191963913","str(ecls)","Gemy" +"1464192001951","chr0 <- character(0)","Gemy" +"1464192007599","class(chr0)","Gemy" +"1464192013998","chr0","Gemy" +"1464192034030","chr0 <- character(1)","Gemy" +"1464192035757","chr0","Gemy" +"1464192054581","chr1 <- character(2)","Gemy" +"1464192057310","chr1","Gemy" +"1464192063429","class(chr1)","Gemy" +"1464192072973","num0","Gemy" +"1464192085076","num0[4] <- char","Gemy" +"1464192087397","num0","Gemy" +"1464192093292","class(num0)","Gemy" +"1464192197017","int0","Gemy" +"1464192218934","int0[3]= char","Gemy" +"1464192220729","into","Gemy" +"1464192225289","int0","Gemy" +"1464192235480","class(int0)","Gemy" +"1464192292045","head(ecls)","Gemy" +"1464192296292","str(ecls)","Gemy" +"1464192324548","elcs$GENDER(1","Gemy" +"10)","","Gemy" +"1464192335029","ecls$GENDER(1","Gemy" +"10)","","Gemy" +"1464192370891","ecls$GENDER[1","Gemy" +"10]","","Gemy" +"1464192397987","ecls$GENDER[1] <- male","Gemy" +"1464192407629","head(ecls)","Gemy" +"1464192421418","class(ecls$GENDER)","Gemy" +"1464192469603","ecls$GENDER[1] <- 1","Gemy" +"1464192474641","class(ecls$GENDER)","Gemy" +"1464192479409","head(ecls)","Gemy" +"1464192488536","ecls$GENDER[1] <- 1","Gemy" +"1464192491480","head(ecls)","Gemy" +"1464192494724","class(ecls$GENDER)","Gemy" +"1464192570766","ecls$GENDER<- as.numeric","Gemy" +"1464192583975","ecls$GENDER<- as.numeric[ecls$GENDER]","Gemy" +"1464192608014","ecls$GENDER<- as.numeric(ecls$GENDER)","Gemy" +"1464192617112","as.numeric(ecls$GENDER)","Gemy" +"1464192646660","class(ecls$GENDER)","Gemy" +"1464192651962","head(ecls)","Gemy" +"1464192694266","ecls$GENDER[1] <- male","Gemy" +"1464192698915","head(ecls)","Gemy" +"1464192704399","class(ecls$GENDER)","Gemy" +"1464192709442","ecls$GENDER<- as.numeric(ecls$GENDER)","Gemy" +"1464192718993","class(ecls)","Gemy" +"1464192725249","class(ecls$GENDER)","Gemy" +"1464192759736","ecls$GENDER[1","Gemy" +"10]","","Gemy" +"1464192823295","ecls$GENDER[1] <- 1","Gemy" +"1464192828335","class(ecls$GENDER)","Gemy" +"1464192834942","ecls$GENDER","Gemy" +"1464192882661","head(ecls)","Gemy" +"1464192911814","str(ecls)","Gemy" +"1464192955585","names(ecls)","Gemy" +"1464192964252","char_vec <- names(ecls)","Gemy" +"1464192967459","char_vec","Gemy" +"1464192973484","length(char_vec)","Gemy" +"1464192982698","char_vec[3]","Gemy" +"1464192994610","chr0 <- character(10)","Gemy" +"1464192998328","class(chr0)","Gemy" +"1464193000657","num0","Gemy" +"1464193016841","num0[5] <- char","Gemy" +"1464193020970","class(num0)","Gemy" +"1464193023953","num0","Gemy" +"1464193048800","chr5<- character(3)","Gemy" +"1464193054665","class(chr5)","Gemy" +"1464193057913","chr5","Gemy" +"1464193068776","chr0<-character(10)","Gemy" +"1464193070145","chr0","Gemy" +"1464193086089","","Gemy" +"1464193101607","class(TRUE)","Gemy" +"1464193108119","class(T)","Gemy" +"1464193115126","T <-2","Gemy" +"1464193147814","class(T)","Gemy" +"1464193151762","rm(T)","Gemy" +"1464193200385","rm(T)","Gemy" +"1464193210820","rm(TRUE)","Gemy" +"1464193223852","log0 <- logical(10)","Gemy" +"1464193226235","log0","Gemy" +"1464193229907","log0","Gemy" +"1464193242019","log0[4] <- 1","Gemy" +"1464193244307","log0","Gemy" +"1464193283073","class(log0)","Gemy" +"1464193296435","log10<-logical(3)","Gemy" +"1464193299994","class(log10)","Gemy" +"1464193317506","sample(1","Gemy" +"10, 4, replace=TRUE)","","Gemy" +"1464193336237","log10[5] <- female","Gemy" +"1464193337846","log10","Gemy" +"1464193379527","log0[4] <- me","Gemy" +"1464193381383","log0","Gemy" +"1464193409742","?sample","Gemy" +"1464193453781","sample( 2","Gemy" +"4, 3, replace= FALSE)","","Gemy" +"1464193500268","sample(1","Gemy" +"10)","","Gemy" +"1464193505674","sample(1","Gemy" +"10, 3)","","Gemy" +"1464193520797","sample (1","Gemy" +"10, 4, replace= TRUE)","","Gemy" +"1464193527107","sample(1","Gemy" +"10, 3)","","Gemy" +"1464193534604","sample(1","Gemy" +"10, 3, replace = FALSE)","","Gemy" +"1464193544490","sample(1","Gemy" +"10, 3, replace = FALSE)","","Gemy" +"1464193547795","sample (1","Gemy" +"10, 4, replace= TRUE)","","Gemy" +"1464193557370","sample (1","Gemy" +"10, 4, replace= TRUE)","","Gemy" +"1464193560601","sample (1","Gemy" +"10, 4, replace= TRUE)","","Gemy" +"1464193610801","logical(10)","Gemy" +"1464193613402","num(10)","Gemy" +"1464193617817","numeric(10)","Gemy" +"1464193621617","char(10)","Gemy" +"1464193626801","character(10)","Gemy" +"1464193695426","sample(1","Gemy" +"10, 5, replace = TRUE)","","Gemy" +"1464193695427","sample(1","Gemy" +"10, 5, replace = FALSE)","","Gemy" +"1464193876499","sample(ecls, v(1,5, 7), replace= TRUE)","Gemy" +"1464193926836","sample(1","Gemy" +"5, 5, replace=TRUE)","","Gemy" +"1464193936925","sample(1","Gemy" +"5, 5, replace= FALSE)","","Gemy" +"1464194049770","sample(ecls$GENDER, 3, replace)","Gemy" +"1464194054531","sample(ecls$GENDER, 3, replace=)","Gemy" +"1464194140865","string_dates <- c(2014-06-03, 2014-06-19)","Gemy" +"1464194140866","string_dates","Gemy" +"1464194166227","mydates <- as.Date(c(2014-06-03, 2014-06-19))","Gemy" +"1464194166234","mydates","Gemy" +"1464194179928","class(string_dates)","Gemy" +"1464194183868","class(mydates)","Gemy" +"1464194243093","?as.date","Gemy" +"1464194257453","?as.date","Gemy" +"1464194271150","?as.Date","Gemy" +"1464194314437","mydates-500","Gemy" +"1464194350214","me <- as.Date(1992-04-03)","Gemy" +"1464194381797","today <-Sys.date()","Gemy" +"1464194403507","old<- today- me","Gemy" +"1464194412642","today <-Sys.Date()","Gemy" +"1464194423484","old<- today- me","Gemy" +"1464194433427","(old<- today- me)","Gemy" +"1464194545313","as.numeric(old) %/% 365","Gemy" +"1464194600457","as.numeric(old) %% 365-3","Gemy" +"1464194729389","5==5","Gemy" +"1464194734109","5<0","Gemy" +"1464194740270","5 !=5","Gemy" +"1464194839004","gender <- ecls$GENDER","Gemy" +"1464194847467","hist(gender)","Gemy" +"1464194855066","range(gender)","Gemy" +"1464194861417","mean(gender)","Gemy" +"1464194875828","","Gemy" +"1464194875829","c6math <- ecls$C6R4MSCL","Gemy" +"1464194875833","","Gemy" +"1464194875833","hist(c6math)","Gemy" +"1464194875858","","Gemy" +"1464194875858","range(c6math)","Gemy" +"1464194875859","","Gemy" +"1464194875859","mean(c6math)","Gemy" +"1464194904522","today","Gemy" +"1464194908129","old","Gemy" +"1464194910603","me","Gemy" +"1464194918338","class(old)","Gemy" +"1464195017457","aboAVG <- as.logical(c6math>mean(c6math) )","Gemy" +"1464195023863","aboAVG","Gemy" +"1464195037512","aboAVG>mean(c6math)","Gemy" +"1464195340209","gender","Gemy" +"1464195344313","hist(gender)","Gemy" +"1464195350771","range(gender)","Gemy" +"1464195361568","c6math <- ecls$C6R4MSCL","Gemy" +"1464195366710","hist(c6math)","Gemy" +"1464195384224","range(c6math)","Gemy" +"1464195392194","mean(c6math)","Gemy" +"1464195490296","abovAVG <- as.logical(c6math> mean(c6math))","Gemy" +"1464195502735","abovAVG>122","Gemy" +"1464195539528","abovAVG","Gemy" +"1464195549956","head(ecls)","Gemy" +"1464195636916","class(abovAVG)","Gemy" +"1464195659844","abovAVG[1] <-0","Gemy" +"1464195667620","class(abovAVG)","Gemy" +"1464195675987","abovAVG","Gemy" +"1464195685693","table(abovAVG)","Gemy" +"1464195711827","1","Gemy" +"10>5","","Gemy" +"1464195729804","1","Gemy" +"10 =5","","Gemy" +"1464195737442","1","Gemy" +"10 ==5","","Gemy" +"1464195751440","1","Gemy" +"9 == 9","1","Gemy" +"1464195778121","1","Gemy" +"5 == c(1, 4, 5,6)","","Gemy" +"1464195782770","1","Gemy" +"5 == c(1, 4, 5,6, 9)","","Gemy" +"1464195811890","1","Gemy" +"10 == 3","4","Gemy" +"1464195836497","1","Gemy" +"2 == 1","10","Gemy" +"1464195842569","1","Gemy" +"10 ==1","2","Gemy" +"1464195891967","vec1 <- c(3.4, 5.6)","Gemy" +"1464195902584","vec2 <- 10+ vec1","Gemy" +"1464195905749","vec2","Gemy" +"1464195919432","?which","Gemy" +"1464195940561","which(1","Gemy" +"10 == 6)","","Gemy" +"1464195953127","which(c(TRUE, FALSE, FALSE))","Gemy" +"1464195988007","vect <- c(1, 3, 4, 5, NA, 3, NaN, 32)","Gemy" +"1464195991567","is.na(vect)","Gemy" +"1464196009999","which(is.na(vect))","Gemy" +"1464196181979","which (c6math > aboAVG)","Gemy" +"1464196308334","letters","Gemy" +"1464196460180","hist(ecls$MIRT)","Gemy" +"1464196470671","which(ecls$MIRT>40)","Gemy" +"1464196568572","ecls$MIRT[ind]","Gemy" +"1464196582405","(ind <- which(ecls$MIRT > 70 & ecls$RIRT > 70))","Gemy" +"1464196584599","ind","Gemy" +"1464196698259","ecls(279, 441)","Gemy" +"1464196718057","ecls (279, 441)","Gemy" +"1464196733783","ecls[ind]","Gemy" +"1464196742313","ecls[ind,]","Gemy" +"1464231601400","ls","Gemy" +"1464231603337","ls()","Gemy" +"1464231635352","load(~/Documents/Intro to R /ecls.Rdata)","Gemy" +"1464231639598","ls()","Gemy" +"1464231651583","class(5)","Gemy" +"1464231656204","is.numeric(3)","Gemy" +"1464231664331","is.integer(3)","Gemy" +"1464231669219","is.integer(3L)","Gemy" +"1464231679651","x <- 3L","Gemy" +"1464231682195","x","Gemy" +"1464231689088","is.integer(x)","Gemy" +"1464231695660","is.numeric(x)","Gemy" +"1464231703973","class(2L)","Gemy" +"1464231709105","class(2L*3L)","Gemy" +"1464231716542","class(2L/3L)","Gemy" +"1464231780966","num1 <- numeric(0)","Gemy" +"1464231783966","num1","Gemy" +"1464231805264","int1 <- integer(10)","Gemy" +"1464231809191","int","Gemy" +"1464231811699","int1","Gemy" +"1464231829053","num0 <- numeric (10)","Gemy" +"1464231831673","num0","Gemy" +"1464231838552","class(int1)","Gemy" +"1464231844721","class(num0)","Gemy" +"1464232026174","num0[1] <- 8","Gemy" +"1464232027906","num0","Gemy" +"1464232033322","class(num0)","Gemy" +"1464232058656","vec <- c(1,3,45, NA )","Gemy" +"1464232062747","vec[1]","Gemy" +"1464232067626","vec[4]","Gemy" +"1464232073133","lenth(vec)","Gemy" +"1464232077834","length(vec)","Gemy" +"1464232086729","vec[c(1,2, 3)]","Gemy" +"1464232097891","vec[1","Gemy" +"3]","","Gemy" +"1464232102331","vec[-2]","Gemy" +"1464232157354","vec[3] <- 3","Gemy" +"1464232159986","vec","Gemy" +"1464232176922","vec[1","Gemy" +"2] <- numeric(3)","","Gemy" +"1464232184271","vec[1","Gemy" +"2] <- numeric(2)","","Gemy" +"1464232186309","vec","Gemy" +"1464232197975","head(ecls)","Gemy" +"1464232203132","dim(ecls)","Gemy" +"1464232394410","ecls$GENDER","Gemy" +"1464232417155","class(ecls$WKWHITE)","Gemy" +"1464232421032","str(ecls)","Gemy" +"1464232429829","str(ecls$GENDER)","Gemy" +"1464232441294","x <- zy","Gemy" +"1464232442970","x","Gemy" +"1464232446283","class(x)","Gemy" +"1464232449899","nchar(x)","Gemy" +"1464232456359","head(ecls)","Gemy" +"1464232459794","dim(ecls)","Gemy" +"1464232465139","names(ecls)","Gemy" +"1464232473872","char_vec <- names(ecls)","Gemy" +"1464232481044","char_vec","Gemy" +"1464232487572","length(char_vec)","Gemy" +"1464232502489","nchar(char_vec)","Gemy" +"1464232523067","char_vec[4]","Gemy" +"1464232538856","chr1 <- character(1)","Gemy" +"1464232541434","chr1","Gemy" +"1464232551878","chr0 <- character(10)","Gemy" +"1464232554512","chr0","Gemy" +"1464232568241","class(chr0)","Gemy" +"1464232577230","num0","Gemy" +"1464232582513","class(num0)","Gemy" +"1464232595705","num9 [1] <- me","Gemy" +"1464232609448","num0 [1] <- me","Gemy" +"1464232611453","num0","Gemy" +"1464232616392","char(num0)","Gemy" +"1464232623095","class(num0)","Gemy" +"1464232635220","class(TRUE)","Gemy" +"1464232638943","class(T)","Gemy" +"1464232652624","log1 <- logical(1)","Gemy" +"1464232655131","log(1)","Gemy" +"1464232663897","log0 <- logical(10)","Gemy" +"1464232665335","log0","Gemy" +"1464232677288","log1","Gemy" +"1464232706389","log0[3] <- 3","Gemy" +"1464232709566","log0","Gemy" +"1464232714983","class(log0)","Gemy" +"1464232740009","sample(1","Gemy" +"3, 3, replace)","","Gemy" +"1464232744575","sample(1","Gemy" +"3, 3, replace=)","","Gemy" +"1464232792555","date <- c(1992-4-3)","Gemy" +"1464232794676","date","Gemy" +"1464232803222","class(date)","Gemy" +"1464232816853","is.Date(1992-4-3)","Gemy" +"1464232839148","mybirthday <- as.Date(1992-4-3)","Gemy" +"1464232916051","class(mybirthday)","Gemy" +"1464232942293","mybirthday - 300","Gemy" +"1464232996886","tuan <- as.Date(1984-5-1)","Gemy" +"1464232998803","tuan","Gemy" +"1464233000975","class(tuan)","Gemy" +"1464233005406","mybirthday - tuan","Gemy" +"1464233039717","cung <-mybirthday - tuan","Gemy" +"1464233042104","cung","Gemy" +"1464233075780","diff(mybirthday, tuan)","Gemy" +"1464233104523","diff(as.Date(c(mybirthday, tuan)))","Gemy" +"1464233147983","cung %/% 365","Gemy" +"1464233166639","as.Date(cung)","Gemy" +"1464233175342","as.numeric(cung)","Gemy" +"1464233182700","cung %/%365","Gemy" +"1464233188901","cung %/% 365","Gemy" +"1464233199056","class(cung)","Gemy" +"1464233217977","as.numeric(cung) %/% 365","Gemy" +"1464233226294","as.numeric(cung) %% 365","Gemy" +"1464233268155","today - mybirthday","Gemy" +"1464233284842","today <- Sys.Date","Gemy" +"1464233288214","today- my birthday","Gemy" +"1464233291915","today- mybirthday","Gemy" +"1464233309458","today <- Sys.Date()","Gemy" +"1464233316782","today - mybirthday","Gemy" +"1464233343043","alive <- today - mybirthday","Gemy" +"1464233351545","class(alive)","Gemy" +"1464233356460","as.numeric(alive)","Gemy" +"1464233490547","as.numeric(alive) %/% 365","Gemy" +"1464233493937","as.numeric(alive) %% 365","Gemy" +"1464233557623","diff(as.Date(c(2016-5-25-1992-4-3)))","Gemy" +"1464233568378","diff(as.Date(c(2016-5-25,1992-4-3)))","Gemy" +"1464233987202","?mean","Gemy" +"1464234041869","vidu <- c(1,3,4, NA, 3, 5, NA)","Gemy" +"1464234157669","mean(vidu)","Gemy" +"1464234170782","mean(vidu, na.rm =)","Gemy" +"1464234196836","mean(vidu, na.rm= TRUE)","Gemy" +"1464234257982","","Gemy" +"1464234257987","T <- 0","Gemy" +"1464234257988","mean(my_nums, na.rm = TRUE) ","Gemy" +"1464234257988","mean(my_nums, na.rm = T) ","Gemy" +"1464234257989","","Gemy" +"1464234271708","","Gemy" +"1464234271709","my_nums <- c(1, 4, 3, 5, 3, 2, 6, 3, NA, 2, NA, 1, 9, 6, 7, 8, 8)","Gemy" +"1464234271709","mean(my_nums)","Gemy" +"1464234271710","mean(my_nums, na.rm = TRUE) ","Gemy" +"1464234271710","mean(my_nums, na.rm = T) ","Gemy" +"1464234271711","","Gemy" +"1464234271711","T <- 0","Gemy" +"1464234271712","mean(my_nums, na.rm = TRUE) ","Gemy" +"1464234271712","mean(my_nums, na.rm = T) ","Gemy" +"1464234271713","","Gemy" +"1464234355527","5>2","Gemy" +"1464234357717","4<3","Gemy" +"1464234375672","gender <- ecls$GENDER","Gemy" +"1464234381778","hist(gender)","Gemy" +"1464234386089","range(gender)","Gemy" +"1464234669543","mean(gender)","Gemy" +"1464234713267","math <- ecls$C6R4MSCL","Gemy" +"1464234717980","hist(math)","Gemy" +"1464234720823","range(math)","Gemy" +"1464234725522","mean(math)","Gemy" +"1464234763328","abov <- as.logical(mean(math)>math)","Gemy" +"1464234765309","abov","Gemy" +"1464234783694","math[1] <- 1","Gemy" +"1464234785739","math","Gemy" +"1464234796234","class(math)","Gemy" +"1464234825705","abov","Gemy" +"1464234833104","abov[1] <-1","Gemy" +"1464234836432","aboc","Gemy" +"1464234838203","abov","Gemy" +"1464234842849","class(abov)","Gemy" +"1464234867281","?tab","Gemy" +"1464234873524","?tabulate","Gemy" +"1464234888209","tab(c(1,2,3))","Gemy" +"1464235024103","?table","Gemy" +"1464235081894","str(abov)","Gemy" +"1464235151830","table(abov)","Gemy" +"1464235250502","1","Gemy" +"3> 3","","Gemy" +"1464235256228","1","Gemy" +"10<3","","Gemy" +"1464235264344","1","Gemy" +"2==1","3","Gemy" +"1464235287252","1","Gemy" +"2 == 1","3","Gemy" +"1464235292825","1","Gemy" +"2 == 1","10","Gemy" +"1464235300231","1","Gemy" +"2 == 1","3","Gemy" +"1464235312596","1","Gemy" +"10 == 1","3","Gemy" +"1464235318418","1","Gemy" +"10 == 1","3","Gemy" +"1464235327523","1","Gemy" +"10 == 1","3","Gemy" +"1464235362257","vec1 <- c(1.3, 5.3, 5.2)","Gemy" +"1464235378765","vec2 <- vec1 +3","Gemy" +"1464235381649","vec2","Gemy" +"1464235482285","which (c( F, T, F))","Gemy" +"1464235502889","which (c( FALSE, TRUE, FALSE))","Gemy" +"1464235525073","which (c( FALSE, TRUE, FALSE))","Gemy" +"1464235556578","stri <- c( 1, 3, 4, NA)","Gemy" +"1464235558375","stri","Gemy" +"1464235569570","which (stri == NA)","Gemy" +"1464235575443","is.na(stri)","Gemy" +"1464235587568","letters","Gemy" +"1464235594575","which (letters ==1)","Gemy" +"1464235607557","which( letters ==a)","Gemy" +"1464235628194","3>1 & 2>1","Gemy" +"1464235637235","2>2 & 1>3","Gemy" +"1464235663905","!(33 ==1)","Gemy" +"1464235689647","hist(ecls$MIRT)","Gemy" +"1464235705223","which (ecls$MIRT)> 49","Gemy" +"1464235713772","which (ecls$MIRT> 49)","Gemy" +"1464235727391","which(ecls$RIRT > 70)","Gemy" +"1464235727393","which(ecls$MIRT > 70 & ecls$RIRT > 70)","Gemy" +"1464235733872","hist(ecls$MIRT)","Gemy" +"1464235796236","kothich <- which(ecls$MIRT > 42 & ecls$RIRT <50)","Gemy" +"1464235798912","kothich","Gemy" +"1464235823037","ecls$MIRT[kothich]","Gemy" +"1464235855898","which(c6math> 160)","Gemy" +"1464235868161","which (ecls$C6R4MSCL> 160)","Gemy" +"1464235900052","tuanthidethuong <- which (ecls$C6R4MSCL> 160)","Gemy" +"1464235906582","tuanthidethuong","Gemy" +"1464235924924","ecls$C6R4MSCL[tuanthidethuong]","Gemy" +"1464236101864","which(ecls$C6R4MSCL > 160 | ecls$C6R4MSCL <60)","Gemy" +"1464236167665","tuanthixinhdep <-which(ecls$C6R4MSCL > 160 | ecls$C6R4MSCL <60)","Gemy" +"1464236181729","ecls$C6R4MSCL[tuanthixinhdep]","Gemy" +"1464236198979","hist(tuanthixinhdep)","Gemy" +"1464236209031","tuanthixinhdep","Gemy" +"1464236216416","mean(tuanthixinhdep)","Gemy" +"1464236543437","?grep","Gemy" +"1464236634097","grep(pattern =GEND, x= char_vec, ignore.case=FALSE)","Gemy" +"1464236659972","grep(pattern = FIR, x = char_vec, ignore.case = FALSE)","Gemy" +"1464236761314","gsub(pattern = IRT, replacement = cct, x = char_vec) ","Gemy" +"1464236761316","","Gemy" +"1464236811550","head(ecls)","Gemy" +"1464236942906","set.seed(300)","Gemy" +"1464236963596","lasao <- round(rnorm(10,1))","Gemy" +"1464236968285","lasao","Gemy" +"1464236989248","min(lasao)","Gemy" +"1464237002458","set.seed(5026)","Gemy" +"1464237002458","nv <- round(rnorm(10), 1) ","Gemy" +"1464237002463","","Gemy" +"1464237002463","nv","Gemy" +"1464237002464","min(nv) ","Gemy" +"1464237020790","min(nv) ","Gemy" +"1464237020791","which(nv == -1.2) ","Gemy" +"1464237379177","a <- 3 ","Gemy" +"1464237379184","class(a)","Gemy" +"1464237519925","a <- 3 ","Gemy" +"1464237519930","class(a)","Gemy" +"1464237519931","b <- 4L ","Gemy" +"1464237519931","class(b)","Gemy" +"1464237519931","c <- gemy ","Gemy" +"1464237519932","class(c)","Gemy" +"1464237519932","d <- a>2 ","Gemy" +"1464237519933","class(d)","Gemy" +"1464237611979","a <- 3 ","Gemy" +"1464237611984","class(a)","Gemy" +"1464237611985","b <- 4L ","Gemy" +"1464237611986","class(b)","Gemy" +"1464237611986","c <- gemy ","Gemy" +"1464237611987","class(c)","Gemy" +"1464237611987","d <- a>2 ","Gemy" +"1464237611987","class(d)","Gemy" +"1464237611988","e <- as.Date(2020-2-2)","Gemy" +"1464237611990","class(e)","Gemy" +"1464237805773","MIRT <- ecls$MIRT","Gemy" +"1464237810594","class(MIRT)","Gemy" +"1464237911901","as.logical(MIRT < 20)","Gemy" +"1464238026145","which (MIRT <15)","Gemy" +"1464238125506","which (MIRT<15)","Gemy" +"1464238125507","","Gemy" +"1464238125511","ind <- which (MIRT<15)","Gemy" +"1464238128310","ind","Gemy" +"1464238158962","MIRT[ind]","Gemy" +"1464238428364","?grep","Gemy" +"1464238597944","grep(pattern = GEND, x = char_vec, ignore.case = FALSE)","Gemy" +"1464238602616","grep(pattern = GEND, x = char_vec, ignore.case =)","Gemy" +"1464238605960","grep(pattern = GEND, x = char_vec, ignore.case =TRUE)","Gemy" +"1464238614863","grep(pattern = FIR, x = char_vec, ignore.case =)","Gemy" +"1464238620057","grep(pattern = FIR, x = char_vec, ignore.case =FALSE)","Gemy" +"1464238623335","grep(pattern = FIR, x = char_vec, ignore.case =TRUE)","Gemy" +"1464238698552","txt <- c(The, licenses, for, most, software, are,","Gemy" +"1464238698557","designed, to, take, away, your, freedom,","Gemy" +"1464238698558","to, share, and, change, it.,","Gemy" +"1464238698558",", By, contrast,, the, GNU, General, Public, License,","Gemy" +"1464238698559","is, intended, to, guarantee, your, freedom, to,","Gemy" +"1464238698559","share, and, change, free, software, --,","Gemy" +"1464238698560","to, make, sure, the, software, is,","Gemy" +"1464238698560","free, for, all, its, users)","Gemy" +"1464238702062","txt","Gemy" +"1464238735890","nchar(txt)","Gemy" +"1464238814511","range(txt)","Gemy" +"1464238825754","range(nchar(txt))","Gemy" +"1464239024305","grep (pattern= to, x= char_vec, ignore.case= FALSE)","Gemy" +"1464239115718","grep (pattern= to, txt, ignore.case= FALSE)","Gemy" +"1464239129984","grep (pattern= to, txt, ignore.case=)","Gemy" +"1464239134100","grep (pattern= to, txt, ignore.case=TRUE)","Gemy" +"1464239157112","grep (pattern= Li, txt, ignore.case=TRUE)","Gemy" +"1464239162278","grep (pattern= Li, txt, ignore.case=)","Gemy" +"1464239172311","grep (pattern= Li, txt, ignore.case=FALSE)","Gemy" +"1464239330299","grep(pattern = to, txt, ignore.case=FALSE)","Gemy" +"1464239330305","","Gemy" +"1464239330306","grep( pattern=to, txt)","Gemy" +"1464239381085","grep(pattern = to, txt, ignore.case=FALSE)","Gemy" +"1464239381088","","Gemy" +"1464239381088","grep( [to], txt)","Gemy" +"1464239452759","txt[grep( [to], txt)]","Gemy" +"1464239501928","?[]","Gemy" +"1464239508055","?[]","Gemy" +"1464239535642","grep(pattern =ic, txt)","Gemy" +"1464239550599","txt[grep(pattern =ic, txt)]","Gemy" +"1464239686896","grep (pattern=the, txt)","Gemy" +"1464239715121","gsub(pattern =the, replacement =duh, txt)","Gemy" +"1464239882511","","Gemy" +"1464239882513","","Gemy" +"1464239882514","","Gemy" +"1464239882514","","Gemy" +"1464239882515","","Gemy" +"1464239882515","","Gemy" +"1464239882515","","Gemy" +"1464239882516","","Gemy" +"1464239882516","a <- 3 ","Gemy" +"1464239882517","class(a)","Gemy" +"1464239882518","b <- 4L ","Gemy" +"1464239882519","class(b)","Gemy" +"1464239882521","c <- gemy ","Gemy" +"1464239882524","class(c)","Gemy" +"1464239882525","d <- a>2 ","Gemy" +"1464239882526","class(d)","Gemy" +"1464239882527","e <- as.Date(2020-2-2) ","Gemy" +"1464239882530","class(e)","Gemy" +"1464239882532","","Gemy" +"1464239882533","","Gemy" +"1464239882534","","Gemy" +"1464239882536","","Gemy" +"1464239882538","load(file = file.choose())","Gemy" +"1464239898867","","Gemy" +"1464239898873","MIRT <- ecls$MIRT","Gemy" +"1464239898875","","Gemy" +"1464239898875","","Gemy" +"1464239898876","v1 <- as.logical(MIRT < 20) ","Gemy" +"1464239898877","","Gemy" +"1464239898877","","Gemy" +"1464239898878","which (MIRT<15)","Gemy" +"1464239898880","","Gemy" +"1464239898881","ind <- which (MIRT<15)","Gemy" +"1464239898882","","Gemy" +"1464239898882","","Gemy" +"1464239898884","MIRT[ind]","Gemy" +"1464239898886","","Gemy" +"1464239898887","","Gemy" +"1464239898890","","Gemy" +"1464239898892","","Gemy" +"1464239898892","","Gemy" +"1464239898894","?grep","Gemy" +"1464239898987","","Gemy" +"1464239898992","","Gemy" +"1464239898993","","Gemy" +"1464239898995","","Gemy" +"1464239898999","","Gemy" +"1464239899000","txt <- c(The, licenses, for, most, software, are,","Gemy" +"1464239899001","designed, to, take, away, your, freedom,","Gemy" +"1464239899002","to, share, and, change, it.,","Gemy" +"1464239899002",", By, contrast,, the, GNU, General, Public, License,","Gemy" +"1464239899003","is, intended, to, guarantee, your, freedom, to,","Gemy" +"1464239899004","share, and, change, free, software, --,","Gemy" +"1464239899007","to, make, sure, the, software, is,","Gemy" +"1464239899008","free, for, all, its, users)","Gemy" +"1464239899010","txt","Gemy" +"1464239899014","","Gemy" +"1464239899015","","Gemy" +"1464239899016","nchar(txt)","Gemy" +"1464239899019","","Gemy" +"1464239899021","","Gemy" +"1464239899030","","Gemy" +"1464239899034","range(nchar(txt)","Gemy" +"1464239899035","","Gemy" +"1464239899036","","Gemy" +"1464239899039","","Gemy" +"1464239899041","grep(pattern = to, txt, ignore.case=FALSE)","Gemy" +"1464239899044","","Gemy" +"1464239899048","grep( pattern=to, txt)","Gemy" +"1464239899050","","Gemy" +"1464239899051","txt[grep( pattern=to, txt)]","Gemy" +"1464239899052","","Gemy" +"1464239899053","","Gemy" +"1464239899061","grep(pattern =ic, txt)","Gemy" +"1464239899064","","Gemy" +"1464239899066","txt[grep(pattern =ic, txt)]","Gemy" +"1464239899069","","Gemy" +"1464239899070","","Gemy" +"1464239899071","","Gemy" +"1464239899080","gsub(pattern =the, replacement =duh, txt)","Gemy" +"1464239899087","","Gemy" +"1464239899095","grep (pattern=the, txt)","Gemy" +"1464239899097","","Gemy" +"1464239965139","txt[grep (pattern=the, txt)]","Gemy" +"1464240020829","","Gemy" +"1464240020840","grep (pattern=duh, txt)","Gemy" +"1464240020841","","Gemy" +"1464240020841","txt[grep (pattern=duh, txt)]","Gemy" +"1464240337122","grep(pattern = to, txt, ignore.case=FALSE)","Gemy" +"1464240344839","","Gemy" +"1464240344845","","Gemy" +"1464240344846","","Gemy" +"1464240344846","grep(pattern = to, txt, ignore.case=FALSE)","Gemy" +"1464240344847","","Gemy" +"1464637051233","getwd","Gemy" +"1464637055651","getwd()","Gemy" +"1464748117721","","Gemy" +"1464748117732","","Gemy" +"1464748117733","","Gemy" +"1464748117733","","Gemy" +"1464748117734","","Gemy" +"1464748117735","","Gemy" +"1464748117735","","Gemy" +"1464748117735","","Gemy" +"1464748117736","a <- 3 ","Gemy" +"1464748117736","class(a)","Gemy" +"1464748117738","b <- 4L ","Gemy" +"1464748117738","class(b)","Gemy" +"1464748117739","c <- gemy ","Gemy" +"1464748117739","class(c)","Gemy" +"1464748117740","d <- a>2 ","Gemy" +"1464748117741","class(d)","Gemy" +"1464748117742","e <- as.Date(2020-2-2) ","Gemy" +"1464748117752","class(e)","Gemy" +"1464748117753","","Gemy" +"1464748117754","","Gemy" +"1464748117754","","Gemy" +"1464748117755","","Gemy" +"1464748117756","load(file = file.choose())","Gemy" +"1464748126143","","Gemy" +"1464748126145","MIRT <- ecls$MIRT","Gemy" +"1464748126145","","Gemy" +"1464748126146","","Gemy" +"1464748126146","v1 <- as.logical(MIRT < 20) ","Gemy" +"1464748126147","","Gemy" +"1464748126148","","Gemy" +"1464748126148","which (MIRT<15)","Gemy" +"1464748126149","","Gemy" +"1464748126150","ind <- which (MIRT<15)","Gemy" +"1464748126151","","Gemy" +"1464748126151","","Gemy" +"1464748126151","MIRT[ind]","Gemy" +"1464748126153","","Gemy" +"1464748126153","","Gemy" +"1464748126153","","Gemy" +"1464748126154","","Gemy" +"1464748126154","","Gemy" +"1464748126155","?grep","Gemy" +"1464748126262","","Gemy" +"1464748126263","","Gemy" +"1464748126263","","Gemy" +"1464748126263","","Gemy" +"1464748126264","","Gemy" +"1464748126265","txt <- c(The, licenses, for, most, software, are,","Gemy" +"1464748126265","designed, to, take, away, your, freedom,","Gemy" +"1464748126265","to, share, and, change, it.,","Gemy" +"1464748126266",", By, contrast,, the, GNU, General, Public, License,","Gemy" +"1464748126266","is, intended, to, guarantee, your, freedom, to,","Gemy" +"1464748126267","share, and, change, free, software, --,","Gemy" +"1464748126267","to, make, sure, the, software, is,","Gemy" +"1464748126267","free, for, all, its, users)","Gemy" +"1464748126268","txt","Gemy" +"1464748126270","","Gemy" +"1464748126270","","Gemy" +"1464748126271","nchar(txt)","Gemy" +"1464748126272","","Gemy" +"1464748126272","","Gemy" +"1464748126273","","Gemy" +"1464748126273","range(nchar(txt)","Gemy" +"1464748126274","","Gemy" +"1464748126274","","Gemy" +"1464748126275","grep(pattern = to, txt, ignore.case=FALSE)","Gemy" +"1464748126278","","Gemy" +"1464748126278","grep( pattern=to, txt)","Gemy" +"1464748126279","","Gemy" +"1464748126280","","Gemy" +"1464748126280","grep(pattern =ic, txt)","Gemy" +"1464748126281","","Gemy" +"1464748126281","txt[grep(pattern =ic, txt)]","Gemy" +"1464748126282","","Gemy" +"1464748126282","","Gemy" +"1464748126283","","Gemy" +"1464748126284","gsub(pattern =the, replacement =duh, txt)","Gemy" +"1464748126286","","Gemy" +"1464748183360","?grep","Gemy" +"1464748201309","grep(pattern = to, txt, ignore.case = FALSE)","Gemy" +"1464796713905","getwd()","Gemy" +"1464796815273","setwd(dir = /Users/Gemy/Documents/Intro to R /)","Gemy" +"1464796820177","getwd()","Gemy" +"1464796840481","set.seed(3498)","Gemy" +"1464796844322","rnorm(10)","Gemy" +"1464796853264","rnorm(10)","Gemy" +"1464796860356","rnorm(10)","Gemy" +"1464796892902","?set.seed","Gemy" +"1464796910838","set.seed(245790)","Gemy" +"1464796926984","sample(1","Gemy" +"100, size = 25, replace = FALSE)","","Gemy" +"1464797054865","mat1 <- matrix(data = NA, nrow = 3, ncol =5, byrow = FALSE)","Gemy" +"1464797057818","mat1","Gemy" +"1464797074999","is.logical(mat1)","Gemy" +"1464797096041","mat2 <- matrix (data = 0, nrow= 3, ncol = 5, byrow= FALSE)","Gemy" +"1464797097631","mat2","Gemy" +"1464797107081","is.numeric(mat2)","Gemy" +"1464797166544","matrix(data = -4, nrow= 3, ncol =5, byrow =FALSE)","Gemy" +"1464797195079","matrix ( data=1","Gemy" +"14, nrow =3, ncol =5, byrow =FALSE)","","Gemy" +"1464797203990","matrix ( data=1","Gemy" +"15, nrow =3, ncol =5, byrow =FALSE)","","Gemy" +"1464797213293","matrix(data = 1","Gemy" +"15, nrow = 3, ncol = 5, byrow = TRUE)","","Gemy" +"1464797224209","mat3 <- matrix(data = c(Horace Mann, Grace Dodge, Zenkel, Thompson,","Gemy" +"1464797224209","Thorndike, Macy),","Gemy" +"1464797224214","nrow = 3, ncol = 2, byrow = FALSE)","Gemy" +"1464797228711","mat3","Gemy" +"1464797289236","is.character(mat3)","Gemy" +"1464797319718","mat1 <- matrix(data = 1","Gemy" +"15, nrow=3, ncol =5, byrow = FALSE)","","Gemy" +"1464797320899","mat1","Gemy" +"1464797331462","mat1 [1, 5]","Gemy" +"1464797346562","mat 1[, 3]","Gemy" +"1464797355154","mat1[,3]","Gemy" +"1464797380080","mat1[,]","Gemy" +"1464797393739","dim(mat1)","Gemy" +"1464797400323","nrow(mat1)","Gemy" +"1464797407705","t(mat1)","Gemy" +"1464797470939","a <- 1","Gemy" +"5","","Gemy" +"1464797470940","b <- c(3, 5, 4, 5, 3)","Gemy" +"1464797490903","mat4 <- cbind(a,b)","Gemy" +"1464797493878","mat4","Gemy" +"1464797516456","mat5 <- rbind(a,b)","Gemy" +"1464797519349","mat5","Gemy" +"1464797528670","c <- c(1,3,4)","Gemy" +"1464797532510","cbind(a,c)","Gemy" +"1464797593287","","Gemy" +"1464797638785","mtr1 <- matrix(data = 0, nrow =3, ncol =4, byrow = FALSE)","Gemy" +"1464797649706","mtr1","Gemy" +"1464797716473","odd <- c(10)","Gemy" +"1464797718785","odd","Gemy" +"1464797729514","even <- c(25)","Gemy" +"1464797757204","a <- c(10,25)","Gemy" +"1464797778378","mtr2 <- matrix( data = a, nrow = 2, ncol =5, byrow = FALSE)","Gemy" +"1464797780832","mtr2","Gemy" +"1464797803872","mtr2 <- matrix( data = a, nrow = 2, ncol =5, byrow = TRUE)","Gemy" +"1464797806130","mtr2","Gemy" +"1464797833737","cbind(odd,even)","Gemy" +"1464797864639","t(a)","Gemy" +"1464797885582","mtr2 <- matrix( data = a, nrow = 2, ncol =5, byrow = TRUE)","Gemy" +"1464797887551","mtr2","Gemy" +"1464797895527","mtr2 <- matrix( data = a, nrow = 2, ncol =5, byrow = FALSE)","Gemy" +"1464797898245","mtr2","Gemy" +"1464797982221","b <- (10, 10)","Gemy" +"1464797990036","b <- c(10, 10)","Gemy" +"1464798001011","d <- c(25, 25)","Gemy" +"1464798007901","cbind(b,d)","Gemy" +"1464798037547","b <- c(10, 10, 10, 10, 10)","Gemy" +"1464798046346","d <- c(25, 25, 25, 25, 25)","Gemy" +"1464798050293","cbind(b,d)","Gemy" +"1464798060289","rbind(b,d)","Gemy" +"1464798094185","mtr2 <- matrix( data = a, nrow = 5, ncol =2, byrow = FALSE)","Gemy" +"1464798097604","mtr2","Gemy" +"1464798106977","mtr2 <- matrix( data = a, nrow = 5, ncol =2, byrow = TRUE)","Gemy" +"1464798108633","mtr2","Gemy" +"1464798141322","t(mtr2)","Gemy" +"1464798183562","e <- c( 10, 10, 25, 25)","Gemy" +"1464798189815","mtr2 <- matrix( data = e, nrow = 5, ncol =2, byrow = TRUE)","Gemy" +"1464798201848","mtr2 <- matrix( data = e, nrow = 2, ncol =5, byrow = TRUE)","Gemy" +"1464798358363","a<- c(10, 25, 10, 25, 10)","Gemy" +"1464798372499","b<- c( 25, 10, 25, 10, 25)","Gemy" +"1464798384620","cbind(a,b)","Gemy" +"1464798401032","t(cbind(a,b))","Gemy" +"1464798709401","mat3","Gemy" +"1464798756281","mat1 <- matrix( data = 10, nrow =2, ncol = 1, byrow = FALSE)","Gemy" +"1464798760799","mat1 <- matrix( data = 25, nrow =2, ncol = 1, byrow = FALSE)","Gemy" +"1464798794262","mat2 <- matrix( data = 25, nrow =2, ncol = 1, byrow = FALSE)","Gemy" +"1464798795823","mat 1","Gemy" +"1464798797959","mat1","Gemy" +"1464798800078","mat2","Gemy" +"1464798811046","mat3","Gemy" +"1464798926516","a <- c(10, 10, 10, 10 ,10, 25, 25, 25, 25, 25)","Gemy" +"1464798949669","matrix (data = a, nrow =2, ncol=5, byrow =FALSE)","Gemy" +"1464798963243","matrix (data = a, nrow =2, ncol=5, byrow =TRUE)","Gemy" +"1464798987325","mat3","Gemy" +"1464799004386","mat3[2,]","Gemy" +"1464799221279","mat3 [2,2]","Gemy" +"1464799244924","col1 <- mat3[,1]","Gemy" +"1464799246826","col1","Gemy" +"1464799357707","a <- c(10, 25, 10, 25, 10, 25, 10, 25, 10, 25)","Gemy" +"1464799397434","mtr1 <- matrix(data=a, nrow=2, ncol =5, byrow =FALSE)","Gemy" +"1464799399153","mtr1","Gemy" +"1464799437370","a <- c(10,25,10,25,10)","Gemy" +"1464799440059","mtr1 <- matrix(data=a, nrow=2, ncol =5, byrow =FALSE)","Gemy" +"1464799444267","mtr1","Gemy" +"1464799508010","getwd()","Gemy" +"1464799540470","load(file = file.choose())","Gemy" +"1464799553883","View(ecls)","Gemy" +"1464799572141","fix(ecls)","Gemy" +"1464799627368","fix(ecls)","Gemy" +"1464799673356","head(ecls)","Gemy" +"1464799686740","is.data.frame(ecls)","Gemy" +"1464799690804","str(ecls)","Gemy" +"1464799723715","ecls[1,]","Gemy" +"1464799730892","ecls[,1]","Gemy" +"1464799746523","ecls$GENDER","Gemy" +"1464799830795","table(GENDER)","Gemy" +"1464799853881","ecls[,c(GENDER)] ","Gemy" +"1464799858478","table(GENDER)","Gemy" +"1464799868665","mean(RIRT)","Gemy" +"1464799958593","attach(ecls)","Gemy" +"1464799964055","table(GENDER)","Gemy" +"1464799970262","mean(RIRT)","Gemy" +"1464800008790","detach(ecls)","Gemy" +"1464800012573","mean(RIRT)","Gemy" +"1464800111297","table(ecls$GENDER)","Gemy" +"1464800252712","search()","Gemy" +"1464800275182","attach(elcs)","Gemy" +"1464800294774","head(ecls)","Gemy" +"1464800396646","table(ecls$GENDER)","Gemy" +"1464800396649","table(ecls$F5SPECS) ","Gemy" +"1464800396653","table(ecls$P1FIRKDG) ","Gemy" +"1464800396656","","Gemy" +"1464800396656","( tab1 <- table(gend = ecls$GENDER, specEd = ecls$F5SPECS) )","Gemy" +"1464800510521","margin.table(tab1, margin = 1)","Gemy" +"1464800510523","margin.table(tab1, margin = 2)","Gemy" +"1464800578246","margin.table(ecls, margin=1)","Gemy" +"1464800616629","install.packages(gmodels)","Gemy" +"1464800629320","install.packages(gmodels)","Gemy" +"1464800632915","library(gmodels)","Gemy" +"1464800638783","CrossTable(ecls$GENDER, ecls$F5SPECS)","Gemy" +"1464800785441","phi <- (158*173 - 126*82)/sqrt(240*299*284*255)","Gemy" +"1464800789059","phi","Gemy" +"1464800797509","cor(ecls$GENDER, ecls$F5SPECS, method = pearson)","Gemy" +"1464800812002","cor(ecls$GENDER, ecls$F5SPECS)","Gemy" +"1464800833761","","Gemy" +"1464800833761","table(gender = ecls$GENDER, specEd = ecls$F5SPECS, firK = ecls$P1FIRKDG)","Gemy" +"1464800847987","table(specEd = ecls$F5SPECS, gender = ecls$GENDER, firK = ecls$P1FIRKDG)","Gemy" +"1464800958061","is.factor(ecls$GENDER)","Gemy" +"1464800967796","ecls$gend_fact <- factor(ecls$GENDER,","Gemy" +"1464800967798","levels = c(0, 1),","Gemy" +"1464800967798","labels = c(female, male))","Gemy" +"1464800992310","ecls$gend_fact2 <- factor (ecls$GENDER,)","Gemy" +"1464801024830","ecls$gend_fact2 <- factor (ecls$GENDER, levels =c(0,1), labels =c(female, male)","Gemy" +"1464801030206",")","Gemy" +"1464801037030","head(ecls)","Gemy" +"1464801058647","str(ecls)","Gemy" +"1464801198525","ecls$gender_quant <- as.character(ecls$gender_fact)","Gemy" +"1464801219681","ecls$gend_quant <- as.character(ecls$gend_fact)","Gemy" +"1464801237827","ecls$gend_quant[ecls$gend_quant == male] <- 1","Gemy" +"1464801244714","ecls$gend_quant","Gemy" +"1464801266699","read.csv()","Gemy" +"1464801290210","read.csv((load=))","Gemy" +"1464801316482","ecls$gend_quant[ecls$gend_quant == male] <- 1","Gemy" +"1464801316483","ecls$gend_quant","Gemy" +"1464801316493","","Gemy" +"1464801316493","ecls$gend_quant <- as.numeric(ecls$gend_quant)","Gemy" +"1464801316494","ecls$gend_quant","Gemy" +"1464801316499","str(ecls)","Gemy" +"1464801408946","ecls$gend_quant[ecls$gend_quant == female] <- 0","Gemy" +"1464801414607","ecls$gend_quant","Gemy" +"1464801414615","","Gemy" +"1464801414616","ecls$gend_quant <- as.numeric(ecls$gend_quant)","Gemy" +"1464801414616","ecls$gend_quant","Gemy" +"1464801414624","str(ecls)","Gemy" +"1464801467923","","Gemy" +"1464801467928","ecls$gend_quant2 <- as.character(ecls$gend_fact)","Gemy" +"1464801467929","","Gemy" +"1464801467929","ecls$gend_quant2[ecls$gend_quant == male] <- 1","Gemy" +"1464801467930","ecls$gend_quant2[ecls$gend_quant == female] <- 0","Gemy" +"1464801467930","ecls$gend_quant2","Gemy" +"1464801467938","","Gemy" +"1464801467939","ecls$gend_quant2 <- as.numeric(ecls$gend_quant)","Gemy" +"1464801467939","ecls$gend_quant2","Gemy" +"1464801467947","str(ecls)","Gemy" +"1464801513810","","Gemy" +"1464801513815","ecls$gend_quant2 <- as.character(ecls$gend_fact2)","Gemy" +"1464801513816","","Gemy" +"1464801519146","ecls$gend_quant2[ecls$gend_quant == male] <- 1","Gemy" +"1464801523258","ecls$gend_quant2[ecls$gend_quant == female] <- 0","Gemy" +"1464801527082","ecls$gend_quant2","Gemy" +"1464801560958","ecls$gend_quant2 <- as.numeric(ecls$gend_quant2)","Gemy" +"1464801560964","ecls$gend_quant2","Gemy" +"1464801560969","str(ecls)","Gemy" +"1464801618056","","Gemy" +"1464801618056","ecls$gend_quant2 <- as.character(ecls$gend_fact2)","Gemy" +"1464801618061","","Gemy" +"1464801618061","ecls$gend_quant2[ecls$gend_quant2 == male] <- 1","Gemy" +"1464801618062","ecls$gend_quant2[ecls$gend_quant2 == female] <- 0","Gemy" +"1464801618063","ecls$gend_quant2","Gemy" +"1464801618069","","Gemy" +"1464801618069","ecls$gend_quant2 <- as.numeric(ecls$gend_quant2)","Gemy" +"1464801618070","ecls$gend_quant2","Gemy" +"1464801618078","str(ecls)","Gemy" +"1464801630490","","Gemy" +"1464801630490","install.packages(plyr)","Gemy" +"1464801632881","library(plyr)","Gemy" +"1464801633216","ecls$gend_quant2 <- revalue(ecls$gend_fact, c(male = 1, female = 0))","Gemy" +"1464801633217","str(ecls) ","Gemy" +"1464801633239","ecls$gend_quant2 <- as.numeric(as.character(ecls$gend_quant2))","Gemy" +"1464801633241","str(ecls) ","Gemy" +"1465061918690","getwd","Gemy" +"1465061923269","getwd()","Gemy" +"1465061937842","set.seed(3498","Gemy" +"1465061940749",")","Gemy" +"1465061954055","sample (1","Gemy" +"100, size = 23, replace = FALSE))","","Gemy" +"1465061956611","sample (1","Gemy" +"100, size = 23, replace = FALSE)","","Gemy" +"1465061979678","sample (1","Gemy" +"100, size = 23, replace = TRUE","","Gemy" +"1465061981534",")","Gemy" +"1465062034103","mat1 <- matrix(data = NA, nrow =3, ncol =5, byrow= FALSE)","Gemy" +"1465062036673","mat1","Gemy" +"1465062048364","is.logical(mat1)","Gemy" +"1465062089748","matrix (data = 1","Gemy" +"10, nrow = 3, ncol =2, byrow = FALSE)","","Gemy" +"1465062111454","matrix (data = 1","Gemy" +"6, nrow = 3, ncol =2, byrow = FALSE)","","Gemy" +"1465062118785","matrix (data = 1","Gemy" +"6, nrow = 3, ncol =2, byrow = TRUE)","","Gemy" +"1465062124527","matrix (data = 1","Gemy" +"6, nrow = 3, ncol =2, bycol = TRUE","","Gemy" +"1465062126445",")","Gemy" +"1465062134523","matrix (data = 1","Gemy" +"6, nrow = 3, ncol =2, bycol = TRUE)","","Gemy" +"1465062170809","mat3 <- matrix(data= c(Gemy, TUAN), nrow = 2, ncol = 1, byrow = FALSE)","Gemy" +"1465062172640","mat3","Gemy" +"1465062345969","is.character(mat3)","Gemy" +"1465062363993","mat3[1,]","Gemy" +"1465062369813","mat3[,2]","Gemy" +"1465062377642","mat3[,]","Gemy" +"1465062385889","dim(mat3)","Gemy" +"1465062403777","ncol(mat3)","Gemy" +"1465062407490","nrow(mat3)","Gemy" +"1465062410747","mat3","Gemy" +"1465062415569","t(mat3)","Gemy" +"1465062479744","head(mat3)","Gemy" +"1465062487715","tail(mat3)","Gemy" +"1465062501990","a <- 1","Gemy" +"3","","Gemy" +"1465062507006","b <- c(1,2,3)","Gemy" +"1465062513966","mat2 <- cbind(a,b)","Gemy" +"1465062515741","mat2","Gemy" +"1465062529225","rbind(a,b)","Gemy" +"1465062612880","gemy <- matrix(data = 0, nrow = 3, ncol = 4)","Gemy" +"1465062614519","gemy","Gemy" +"1465062759033","a <- (10, 25, 10, 25, 10)","Gemy" +"1465062766026","a <- c(10, 25, 10, 25, 10)","Gemy" +"1465062807798","gemy2 <- matrix( data = a, nrow = 2, ncol = 5, byrow =FALSE)","Gemy" +"1465062810017","gemy2","Gemy" +"1465062818683","gemy2 <- matrix( data = a, nrow = 2, ncol = 5, byrow =TRUE)","Gemy" +"1465062820753","gemy2","Gemy" +"1465062862177","cbind(a,a)","Gemy" +"1465062867320","rbund(a,a)","Gemy" +"1465062872497","rbind(a,a)","Gemy" +"1465062891952","b <- [10, 25]","Gemy" +"1465062900624","b <- c(10,25)","Gemy" +"1465062927089","cbind(c,c,c,c,c)","Gemy" +"1465062992342","b<- c(10,10)","Gemy" +"1465063005603","cbind(b,b,b,b,b)","Gemy" +"1465063013849","b <- c(10,25)","Gemy" +"1465063016559","cbind(b,b,b,b,b)","Gemy" +"1465063029560","b<- c(10,10)","Gemy" +"1465063036102","d<-c(25,25)","Gemy" +"1465063045026","cbind(b,d,b,d,b)","Gemy" +"1465063116243","load(~/Documents/Intro to R /ecls.Rdata)","Gemy" +"1465063124990","view(ecls)","Gemy" +"1465063129062","View(ecls)","Gemy" +"1465063145251","head(ecls)","Gemy" +"1465063149877","is.data.frame(ecls)","Gemy" +"1465063153252","str(ecls)","Gemy" +"1465063166268","tail(ecls)","Gemy" +"1465063172693","ecls$GENDER","Gemy" +"1465063185821","attach(ecls)","Gemy" +"1465063189861","table(GENDER)","Gemy" +"1465063194443","mean(IRRT)","Gemy" +"1465063199420","mean(RIRT)","Gemy" +"1465063204708","detach(ecls)","Gemy" +"1465063350997","rm(list= c(GENDER), pos =1)","Gemy" +"1465063373636","rm(list= c(ecls$GENDER), pos =1)","Gemy" +"1465063389123","head(ecls)","Gemy" +"1465063392534","mean(GENDER)","Gemy" +"1465063396796","rm(list = c(GENDER), pos = 1)","Gemy" +"1465063404956","mean(ecls$GENDER)","Gemy" +"1465063413067","rm(list = c(elcs$GENDER), pos = 1)","Gemy" +"1465063422362","rm(list = c(ecls$GENDER), pos = 1)","Gemy" +"1465063530425","attach ecls","Gemy" +"1465063540012","attach(ecls)","Gemy" +"1465063545123","rm(list = c(GENDER), pos = 1)","Gemy" +"1465063559602","rm(GENDER, pos=1)","Gemy" +"1465063572485","mean(RIRT)","Gemy" +"1465063575248","sd(RIRT)","Gemy" +"1465063581383","detach (ecls)","Gemy" +"1465063616355","table(ecls$GENDER)","Gemy" +"1465063627213","table (ecls$F5SPECS)","Gemy" +"1465063659570","tablee <- table(gemy = ecls$GENDER)","Gemy" +"1465063668690","tablee","Gemy" +"1465063683097","tablee <- table(gemy = ecls$GENDER, tuan = ecls$P1FIRKDG","Gemy" +"1465063684896",")","Gemy" +"1465063686757","tablee","Gemy" +"1465076083957","margin.table(tablee, margin=1)","Gemy" +"1465076120864","margin.table(tablee, margin = 2)","Gemy" +"1465076255375","install.packages(gmodels)","Gemy" +"1465076265603","library(gmodels)","Gemy" +"1465076287296","CrossTable(ecls$GENDER, ecls$P1FIRKDG)","Gemy" +"1465076306776","corr(ecls$GENDER, ecls$WKWHITE)","Gemy" +"1465076312704","cor(ecls$GENDER, ecls$WKWHITE)","Gemy" +"1465076387374","table(u = ecls$GENDER, f = ecls$WKWHITE, g = ecls$F5SPECS)","Gemy" +"1465076407326","is.factor(ecls$GENDER)","Gemy" +"1465076476057","ecls$factor <- factor(ecls$GENDER, levels = c(0,1), labels = c(female, male))","Gemy" +"1465076481060","head(ecls)","Gemy" +"1465076488114","str(ecls)","Gemy" +"1465076531221","ecls$tuanthi <- as.character(ecls$factor)","Gemy" +"1465076544104","head(ecls)","Gemy" +"1465076580441","ecls$tuanthi[ecls$factor == male] <-1","Gemy" +"1465076585726","ecls$tuanthi","Gemy" +"1465076594625","str(ecls)","Gemy" +"1465076610205","ecls$tuanthi[ecls$factor == female] <-0","Gemy" +"1465076614049","ecls$tuanthi","Gemy" +"1465076617322","str(ecls)","Gemy" +"1465076634537","ecls$tuanthi <- as.numeric(ecls$tuanthi)","Gemy" +"1465076639574","str(ecls)","Gemy" +"1465076659571","install.packages(plyr)","Gemy" +"1465076666447","library(plyr)","Gemy" +"1465076670609","insta;","Gemy" +"1465076680116","install.packages(dyplyr)","Gemy" +"1465076733889","ecls$tuanthi1 <- revalue(ecls$factor, c(male=1, female=0))","Gemy" +"1465076738307","str(ecls)","Gemy" +"1465076772540","ecls$tuanthi1 <- as.numeric(as.character(ecls$tuanthi1))","Gemy" +"1465076775304","str(ecls)","Gemy" +"1465077045694","ecls$specialed <- factor(ecls$F5SPECS, levels = c(0,1), labels = c(yes, no)","Gemy" +"1465077062389",")","Gemy" +"1465077066172","str(ecls)","Gemy" +"1465077139413","ecls$specialed <-as.character(ecls$specialed)","Gemy" +"1465077147541","head(ecls)","Gemy" +"1465077153179","str(ecls)","Gemy" +"1465100190602","me <- c(gemy,tuan)","Gemy" +"1465100192255","me","Gemy" +"1465100195450","fact1","Gemy" +"1465100205686","me <- factor(me)","Gemy" +"1465100206953","me","Gemy" +"1465100230639","attributes(me)","Gemy" +"1465100239213","levels(me)","Gemy" +"1465100267198","me2 <- me[-1]","Gemy" +"1465100268937","me2","Gemy" +"1465100278945","table(me2)","Gemy" +"1465100300552","length(levels(me2))","Gemy" +"1465100318258","me2 <-factor(me2)","Gemy" +"1465100319661","me2","Gemy" +"1465100326130","table(me2)","Gemy" +"1465100330455","length(levels(me2))","Gemy" +"1465100349617","me3 <- me1","Gemy" +"1465100356858","me3 <- me","Gemy" +"1465100359225","me3","Gemy" +"1465100366996","me3[2] <- NA","Gemy" +"1465100370507","me3","Gemy" +"1465100378790","me3 <- factor(me3)","Gemy" +"1465100381028","me3","Gemy" +"1465100392136","table(me3, useNA =no)","Gemy" +"1465100402729","table(me3, useNA =ifany)","Gemy" +"1465100415703","table(me3, useNA =always","Gemy" +"1465100417789",")","Gemy" +"1465101571895","status","Gemy" +"1465101674935","status <- factor(status, ordered = TRUE,","Gemy" +"1465101674936","levels = c(poor, fair, good, very good))","Gemy" +"1465102219794","state.abb","Gemy" +"1465102223989","status","Gemy" +"1465102281193","which(NY)","Gemy" +"1465102284630","?which","Gemy" +"1465102303593","which( state == NY)","Gemy" +"1465102326349","which(NY)","Gemy" +"1465102498488","which(NY)","Gemy" +"1465102598112","which(state.abb, NY)","Gemy" +"1465102631518","which(state.abb == NY)","Gemy" +"1465102672784","state.area","Gemy" +"1465102683400","min(state.area)","Gemy" +"1465102714082","which(state.area ==1214)","Gemy" +"1465102746222","which(min(state.area))","Gemy" +"1465102760114","which.min(state.area)","Gemy" +"1465102917631","which(state.abb[39])","Gemy" +"1465102922761","state.abb","Gemy" +"1465102935322","state.abb[39]","Gemy" +"1465103235410","which.max(state.area)","Gemy" +"1465103328584","max(state.area)","Gemy" +"1465103344141","which (state.area = max(state.area))","Gemy" +"1465103348669","which (state.area == max(state.area))","Gemy" +"1465103497689","state.abb[2]","Gemy" +"1465103614801","state.x77","Gemy" +"1465103739764","is.matrix(state.x77)","Gemy" +"1465103739769","is.data.frame(state.x77)","Gemy" +"1465103782099","df.x77 <- data.frame(state.x77)","Gemy" +"1465103786141","df.x77","Gemy" +"1465103800566","attach(df.x77)","Gemy" +"1465103985945","plot(x = HS.Grad, y = Income)","Gemy" +"1465103997773","detach","Gemy" +"1465104013289","detach(df.x77)","Gemy" +"1465104096046","attach(df.x77)","Gemy" +"1465104163714","cor(HS.Grad, Income)","Gemy" +"1465104332649","head(df.x77)","Gemy" +"1465104535963","set.seed(5026)","Gemy" +"1465105251470","treatment_status <- sample(0","Gemy" +"1, size = 50)","","Gemy" +"1465105263030","treatment_status <- sample(0","Gemy" +"1, size = 50, replace = FALSE","","Gemy" +"1465105264758",")","Gemy" +"1465105455627","treatment_status <- sample(1","Gemy" +"2, size = 50, replace= FALSE)","","Gemy" +"1465105468823","treatment_status <- sample(1","Gemy" +"50, size = 50, replace= FALSE)","","Gemy" +"1465105473807","treatment_status","Gemy" +"1465105506844","treatment_status <- c(0, 1)","Gemy" +"1465105517066","treatment_status","Gemy" +"1465105573450","?set.seed","Gemy" +"1465105586199","?sample","Gemy" +"1465105629510","treatment_status <- sample(c(0,1), 50, replace = TRUE)","Gemy" +"1465105635309","treatment_status","Gemy" +"1465105642676","treatment_status <- sample(c(0,1), 50, replace = FALSE)","Gemy" +"1465105675530","treatment_status <- sample(c(0,1), 50, replace = TRUE)","Gemy" +"1465105681125","treatment_status","Gemy" +"1465105754168","treatment_status <- sample(c(0,1), 50, replace = TRUE)","Gemy" +"1465105759296","treatment_status","Gemy" +"1465105770748","treatment_status <- sample(c(0,1), 50, replace = FALSE)","Gemy" +"1465106005425","treatment_status <- sample(c(0,1), 50, replace = FALSE)","Gemy" +"1465106188608","age <- sample(x = 20","Gemy" +"60, size = 50, replace = TRUE)","","Gemy" +"1465106190235","age","Gemy" +"1465106276438","set.seed(5026)","Gemy" +"1465106276443","age <- sample(x = 20","Gemy" +"60, size = 50, replace = TRUE)","","Gemy" +"1465106276444","age","Gemy" +"1465106276445","income <- sample(x = c(low, middle, high), size = 50, replace = TRUE)","Gemy" +"1465106276445","income","Gemy" +"1465106276447","outcome <- round(runif(50)*100, digits = 1)","Gemy" +"1465106276447","outcome","Gemy" +"1465150316344","set.seed(5026)","Gemy" +"1465150316351","treatment_status <- sample(c(0,1), 50, replace = TRUE)","Gemy" +"1465150316351","treatment_status","Gemy" +"1465150316352","age <- sample(x = 20","Gemy" +"60, size = 50, replace = TRUE)","","Gemy" +"1465150316353","age","Gemy" +"1465150316354","income <- sample(x = c(low, middle, high), size = 50, replace = TRUE)","Gemy" +"1465150316354","income","Gemy" +"1465150316356","outcome <- round(runif(50)*100, digits = 1)","Gemy" +"1465150316357","outcome","Gemy" +"1465150406811","treatment_status <- sample(x = c(0,1), 50, replace = TRUE)","Gemy" +"1465150406813","treatment_status","Gemy" +"1465150413940","treatment_status <- sample(x = c(0,1), 50, replace = FALSE)","Gemy" +"1465150413945","treatment_status","Gemy" +"1465150463061","income","Gemy" +"1465150473437","income <- factor(income)","Gemy" +"1465150475107","income","Gemy" +"1465150484487","?factor","Gemy" +"1465150517474","income <- factor(x= income, ordered= is.ordered(income))","Gemy" +"1465150519322","income","Gemy" +"1465150539867","income <- factor(x= income,levels, ordered= is.ordered(income))","Gemy" +"1465150548029","ordered(income)","Gemy" +"1465150578965","income <- sample(x = c(low, middle, high), size = 50, replace = TRUE)","Gemy" +"1465150578966","income","Gemy" +"1465150586029","ordered(income)","Gemy" +"1465150816613","income","Gemy" +"1465151116195","income <- sample(x = c(low, middle, high), size = 50, replace = TRUE)","Gemy" +"1465151116202","income","Gemy" +"1465151169713","ordered_income <- factor(income, levels = c(low, middle, high))","Gemy" +"1465151177579","ordered_income","Gemy" +"1465151353265","cbind(treatmen_status, age, income, outcome)","Gemy" +"1465151369150","cbind(treatment_status, age, income, outcome)","Gemy" +"1465151441020","cbind(treatment_status, age, ordered_income, outcome)","Gemy" +"1465151528117","status","Gemy" +"1465151528118","status <- factor(status, ordered = TRUE,","Gemy" +"1465151528122","levels = c(poor, fair, good, very good))","Gemy" +"1465151528123","df <- data.frame(PSID, age, diabetes, status)","Gemy" +"1465151528123","str(df)","Gemy" +"1465151528126","status","Gemy" +"1465151537396","?status","Gemy" +"1465151586281","income <- factor(income, order= TRUE, levels = c(low, middle, high))","Gemy" +"1465151586281","income","Gemy" +"1465151601253","new_dat <- cbind(treatment_status, age, income, outcome)","Gemy" +"1465151607781","new_dat","Gemy" +"1465151640704","new_dat <- is.data.frame(new_dat)","Gemy" +"1465151644094","new_dat","Gemy" +"1465151652513","new_dat","Gemy" +"1465151699926","new_dat <- data.frame(treatment_status, age,income, outcome)","Gemy" +"1465151702655","new_dat","Gemy" +"1465151723686","str(new_dat)","Gemy" +"1465151788042","?write.table","Gemy" +"1465151854213","write.table(x= new_dat, file = new_dat.txt)","Gemy" +"1465151890025","write.csv(x= new_dat, file = new_dat.csv)","Gemy" +"1465151990465","read.csv(new_dat.csv)","Gemy" +"1465152006818","read.csv(new_dat.csv)","Gemy" +"1465152063025","read.table(new_dat.txt)","Gemy" +"1465152103809","View(new_dat)","Gemy" +"1465152134275","","Gemy" +"1465152134276","","Gemy" +"1465152134280","","Gemy" +"1465152134280","","Gemy" +"1465152134280","","Gemy" +"1465152134281","state.abb","Gemy" +"1465152134283","which(state.abb == NY)","Gemy" +"1465152134283","","Gemy" +"1465152134284","","Gemy" +"1465152134284","state.area","Gemy" +"1465152134285","min(state.area)","Gemy" +"1465152134286","","Gemy" +"1465152134286","","Gemy" +"1465152134287","which(state.area == 1214)","Gemy" +"1465152134288","","Gemy" +"1465152134288","which.min(state.area)","Gemy" +"1465152134289","which (state.area == min(state.area))","Gemy" +"1465152134289","","Gemy" +"1465152134290","","Gemy" +"1465152134290","state.abb[39]","Gemy" +"1465152134291","which(state.abb[39])","Gemy" +"1465152134291","","Gemy" +"1465152134292","which.max(state.area)","Gemy" +"1465152134292","","Gemy" +"1465152134293","which (state.area == max(state.area))","Gemy" +"1465152134294","","Gemy" +"1465152134294","state.abb[2] ","Gemy" +"1465152134295","","Gemy" +"1465152134296","","Gemy" +"1465152134296","state.x77","Gemy" +"1465152134304","","Gemy" +"1465152134305","dim(state.x77)","Gemy" +"1465152134306","","Gemy" +"1465152134306","is.matrix(state.x77)","Gemy" +"1465152134308","is.data.frame(state.x77)","Gemy" +"1465152134309","","Gemy" +"1465152134310","is.matrix(state.x77)","Gemy" +"1465152134311","is.data.frame(state.x77)","Gemy" +"1465152134312","","Gemy" +"1465152134312","attach(df.x77)","Gemy" +"1465152134313","","Gemy" +"1465152134313","","Gemy" +"1465152134313","plot(x = HS.Grad, y = Income)","Gemy" +"1465152134314","detach(df.x77)","Gemy" +"1465152134315","","Gemy" +"1465152134315","","Gemy" +"1465152134316","","Gemy" +"1465152134316","","Gemy" +"1465152134316","","Gemy" +"1465152134317","","Gemy" +"1465152134317","","Gemy" +"1465152134317","","Gemy" +"1465152134318","set.seed(5026)","Gemy" +"1465152134318","treatment_status <- sample(x = c(0,1), 50, replace = TRUE)","Gemy" +"1465152134319","treatment_status","Gemy" +"1465152134321","age <- sample(x = 20","Gemy" +"60, size = 50, replace = TRUE)","","Gemy" +"1465152134322","age","Gemy" +"1465152134323","income <- sample(x = c(low, middle, high), size = 50, replace = TRUE)","Gemy" +"1465152134323","income","Gemy" +"1465152134325","outcome <- round(runif(50)*100, digits = 1)","Gemy" +"1465152134325","outcome","Gemy" +"1465152134327","","Gemy" +"1465152134327","income <- factor(income, order= TRUE, levels = c(low, middle, high))","Gemy" +"1465152134328","income","Gemy" +"1465152134330","","Gemy" +"1465152134330","","Gemy" +"1465152134331","new_dat <- cbind(treatment_status, age, income, outcome)","Gemy" +"1465152134331","new_dat","Gemy" +"1465152134335","","Gemy" +"1465152134335","","Gemy" +"1465152134336","new_dat <- data.frame(treatment_status, age, income, outcome)","Gemy" +"1465152134338","new_dat","Gemy" +"1465152134347","str(new_dat)","Gemy" +"1465152134356","","Gemy" +"1465152134357","","Gemy" +"1465152134357","write.table(x= new_dat, file = new_dat.txt)","Gemy" +"1465152134362","","Gemy" +"1465152134362","write.csv(x= new_dat, file = new_dat.csv)","Gemy" +"1465152134364","","Gemy" +"1465152134365","","Gemy" +"1465152134365","read.csv(new_dat.csv)","Gemy" +"1465152134374","","Gemy" +"1465152134375","read.table(new_dat.txt)","Gemy" +"1465152167359","which(state.abb == NY)","Gemy" +"1465152323428","state.abb","Gemy" +"1465152335633","which(state.abb== NY)","Gemy" +"1465152341472","which(state.abb== NY","Gemy" +"1465152342768",")","Gemy" +"1465152349788","which(state.abb == NY","Gemy" +"1465152359657","which(state.abb == NY)","Gemy" +"1465152366392","which(state.abb == NY)","Gemy" +"1465152385524","","Gemy" +"1465152385525","","Gemy" +"1465152385529","","Gemy" +"1465152385530","","Gemy" +"1465152385530","","Gemy" +"1465152385530","state.abb","Gemy" +"1465152385532","which(state.abb == NY)","Gemy" +"1465152385532","","Gemy" +"1465152385533","","Gemy" +"1465152385533","state.area","Gemy" +"1465152385534","min(state.area)","Gemy" +"1465152385534","","Gemy" +"1465152385535","","Gemy" +"1465152385535","which(state.area == 1214)","Gemy" +"1465152385536","","Gemy" +"1465152385536","which.min(state.area)","Gemy" +"1465152385537","which (state.area == min(state.area))","Gemy" +"1465152385538","","Gemy" +"1465152385538","","Gemy" +"1465152385539","state.abb[39]","Gemy" +"1465152385539","","Gemy" +"1465152385540","which.max(state.area)","Gemy" +"1465152385541","","Gemy" +"1465152385542","which (state.area == max(state.area))","Gemy" +"1465152385543","","Gemy" +"1465152385543","state.abb[2] ","Gemy" +"1465152385544","","Gemy" +"1465152385544","","Gemy" +"1465152385545","state.x77","Gemy" +"1465152385552","","Gemy" +"1465152385552","dim(state.x77)","Gemy" +"1465152385553","","Gemy" +"1465152385553","is.matrix(state.x77)","Gemy" +"1465152385554","is.data.frame(state.x77)","Gemy" +"1465152385554","","Gemy" +"1465152385555","is.matrix(state.x77)","Gemy" +"1465152385555","is.data.frame(state.x77)","Gemy" +"1465152385556","","Gemy" +"1465152385557","attach(state.x77)","Gemy" +"1465152385557","","Gemy" +"1465152385558","","Gemy" +"1465152385558","plot(x = HS.Grad, y = Income)","Gemy" +"1465152385559","detach(df.x77)","Gemy" +"1465152385560","","Gemy" +"1465152385561","","Gemy" +"1465152385562","","Gemy" +"1465152385562","","Gemy" +"1465152385563","","Gemy" +"1465152385563","","Gemy" +"1465152385563","","Gemy" +"1465152385564","","Gemy" +"1465152385564","set.seed(5026)","Gemy" +"1465152385565","treatment_status <- sample(x = c(0,1), 50, replace = TRUE)","Gemy" +"1465152385567","treatment_status","Gemy" +"1465152385568","age <- sample(x = 20","Gemy" +"60, size = 50, replace = TRUE)","","Gemy" +"1465152385569","age","Gemy" +"1465152385570","income <- sample(x = c(low, middle, high), size = 50, replace = TRUE)","Gemy" +"1465152385570","income","Gemy" +"1465152385572","outcome <- round(runif(50)*100, digits = 1)","Gemy" +"1465152385572","outcome","Gemy" +"1465152385574","","Gemy" +"1465152385574","income <- factor(income, order= TRUE, levels = c(low, middle, high))","Gemy" +"1465152385575","income","Gemy" +"1465152385578","","Gemy" +"1465152385578","","Gemy" +"1465152385579","new_dat <- cbind(treatment_status, age, income, outcome)","Gemy" +"1465152385580","new_dat","Gemy" +"1465152385584","","Gemy" +"1465152385584","","Gemy" +"1465152385585","new_dat <- data.frame(treatment_status, age, income, outcome)","Gemy" +"1465152385587","new_dat","Gemy" +"1465152385594","str(new_dat)","Gemy" +"1465152385602","","Gemy" +"1465152385603","","Gemy" +"1465152385603","write.table(x= new_dat, file = new_dat.txt)","Gemy" +"1465152385605","","Gemy" +"1465152385606","write.csv(x= new_dat, file = new_dat.csv)","Gemy" +"1465152385607","","Gemy" +"1465152385608","","Gemy" +"1465152385608","read.csv(new_dat.csv)","Gemy" +"1465152385617","","Gemy" +"1465152385618","read.table(new_dat.txt)","Gemy" +"1465152453993","","Gemy" +"1465152453994","","Gemy" +"1465152453998","","Gemy" +"1465152453998","","Gemy" +"1465152453999","","Gemy" +"1465152453999","state.abb","Gemy" +"1465152454000","which(state.abb == NY)","Gemy" +"1465152454001","","Gemy" +"1465152454001","","Gemy" +"1465152454001","state.area","Gemy" +"1465152454002","min(state.area)","Gemy" +"1465152454003","","Gemy" +"1465152454003","","Gemy" +"1465152454003","which(state.area == 1214)","Gemy" +"1465152454004","","Gemy" +"1465152454005","which.min(state.area)","Gemy" +"1465152454005","which (state.area == min(state.area))","Gemy" +"1465152454006","","Gemy" +"1465152454006","","Gemy" +"1465152454007","state.abb[39]","Gemy" +"1465152454007","","Gemy" +"1465152454008","which.max(state.area)","Gemy" +"1465152454008","","Gemy" +"1465152454008","which (state.area == max(state.area))","Gemy" +"1465152454009","","Gemy" +"1465152454010","state.abb[2] ","Gemy" +"1465152454011","","Gemy" +"1465152454011","","Gemy" +"1465152454011","state.x77","Gemy" +"1465152454017","","Gemy" +"1465152454018","dim(state.x77)","Gemy" +"1465152454018","","Gemy" +"1465152454019","is.matrix(state.x77)","Gemy" +"1465152454019","is.data.frame(state.x77)","Gemy" +"1465152454020","","Gemy" +"1465152454020","is.matrix(state.x77)","Gemy" +"1465152454021","is.data.frame(state.x77)","Gemy" +"1465152454022","df.x77 <- data.frame(state.x77)","Gemy" +"1465152454023","","Gemy" +"1465152454023","attach(df.x77)","Gemy" +"1465152454038","","Gemy" +"1465152454038","","Gemy" +"1465152454039","plot(x = HS.Grad, y = Income)","Gemy" +"1465152454091","detach(df.x77)","Gemy" +"1465152454092","","Gemy" +"1465152454093","","Gemy" +"1465152454094","","Gemy" +"1465152454094","","Gemy" +"1465152454095","","Gemy" +"1465152454095","","Gemy" +"1465152454095","","Gemy" +"1465152454096","","Gemy" +"1465152454096","set.seed(5026)","Gemy" +"1465152454097","treatment_status <- sample(x = c(0,1), 50, replace = TRUE)","Gemy" +"1465152454098","treatment_status","Gemy" +"1465152454099","age <- sample(x = 20","Gemy" +"60, size = 50, replace = TRUE)","","Gemy" +"1465152454100","age","Gemy" +"1465152454101","income <- sample(x = c(low, middle, high), size = 50, replace = TRUE)","Gemy" +"1465152454102","income","Gemy" +"1465152454104","outcome <- round(runif(50)*100, digits = 1)","Gemy" +"1465152454105","outcome","Gemy" +"1465152454106","","Gemy" +"1465152454107","income <- factor(income, order= TRUE, levels = c(low, middle, high))","Gemy" +"1465152454108","income","Gemy" +"1465152454111","","Gemy" +"1465152454111","","Gemy" +"1465152454112","new_dat <- cbind(treatment_status, age, income, outcome)","Gemy" +"1465152454113","new_dat","Gemy" +"1465152454116","","Gemy" +"1465152454117","","Gemy" +"1465152454117","new_dat <- data.frame(treatment_status, age, income, outcome)","Gemy" +"1465152454118","new_dat","Gemy" +"1465152454124","str(new_dat)","Gemy" +"1465152454130","","Gemy" +"1465152454131","","Gemy" +"1465152454131","write.table(x= new_dat, file = new_dat.txt)","Gemy" +"1465152454133","","Gemy" +"1465152454133","write.csv(x= new_dat, file = new_dat.csv)","Gemy" +"1465152454135","","Gemy" +"1465152454136","","Gemy" +"1465152454136","read.csv(new_dat.csv)","Gemy" +"1465152454146","","Gemy" +"1465152454146","read.table(new_dat.txt)","Gemy" +"1465152484080","","Gemy" +"1465152484081","","Gemy" +"1465152484085","","Gemy" +"1465152484086","","Gemy" +"1465152484086","","Gemy" +"1465152484087","state.abb","Gemy" +"1465152484089","which(state.abb == NY)","Gemy" +"1465152484090","","Gemy" +"1465152484090","","Gemy" +"1465152484091","state.area","Gemy" +"1465152484092","min(state.area)","Gemy" +"1465152484093","","Gemy" +"1465152484093","","Gemy" +"1465152484094","which(state.area == 1214)","Gemy" +"1465152484094","","Gemy" +"1465152484095","which.min(state.area)","Gemy" +"1465152484096","which (state.area == min(state.area))","Gemy" +"1465152484096","","Gemy" +"1465152484097","","Gemy" +"1465152484097","state.abb[39]","Gemy" +"1465152484098","","Gemy" +"1465152484099","which.max(state.area)","Gemy" +"1465152484100","","Gemy" +"1465152484100","which (state.area == max(state.area))","Gemy" +"1465152484101","","Gemy" +"1465152484101","state.abb[2] ","Gemy" +"1465152484102","","Gemy" +"1465152484102","","Gemy" +"1465152484103","state.x77","Gemy" +"1465152484111","","Gemy" +"1465152484112","dim(state.x77)","Gemy" +"1465152484113","","Gemy" +"1465152484114","is.matrix(state.x77)","Gemy" +"1465152484114","is.data.frame(state.x77)","Gemy" +"1465152484115","","Gemy" +"1465152484115","is.matrix(state.x77)","Gemy" +"1465152484116","is.data.frame(state.x77)","Gemy" +"1465152484117","df.x77 <- data.frame(state.x77)","Gemy" +"1465152484120","","Gemy" +"1465152484121","attach(df.x77)","Gemy" +"1465152484143","","Gemy" +"1465152484143","","Gemy" +"1465152484144","plot(x = HS.Grad, y = Income)","Gemy" +"1465152484184","detach(df.x77)","Gemy" +"1465152484186","","Gemy" +"1465152484186","","Gemy" +"1465152484187","","Gemy" +"1465152484187","","Gemy" +"1465152484188","","Gemy" +"1465152484188","","Gemy" +"1465152484189","","Gemy" +"1465152484189","","Gemy" +"1465152484190","set.seed(5026)","Gemy" +"1465152484190","treatment_status <- sample(x = c(0,1), 50, replace = TRUE)","Gemy" +"1465152484229","treatment_status","Gemy" +"1465152484232","age <- sample(x = 20","Gemy" +"60, size = 50, replace = TRUE)","","Gemy" +"1465152484232","age","Gemy" +"1465152484305","income <- sample(x = c(low, middle, high), size = 50, replace = TRUE)","Gemy" +"1465152484305","income","Gemy" +"1465152484307","outcome <- round(runif(50)*100, digits = 1)","Gemy" +"1465152484308","outcome","Gemy" +"1465152484309","","Gemy" +"1465152484310","income <- factor(income, order= TRUE, levels = c(low, middle, high))","Gemy" +"1465152484311","income","Gemy" +"1465152484314","","Gemy" +"1465152484314","","Gemy" +"1465152484315","new_dat <- cbind(treatment_status, age, income, outcome)","Gemy" +"1465152484315","new_dat","Gemy" +"1465152484319","","Gemy" +"1465152484319","","Gemy" +"1465152484320","new_dat <- data.frame(treatment_status, age, income, outcome)","Gemy" +"1465152484322","new_dat","Gemy" +"1465152484329","str(new_dat)","Gemy" +"1465152484338","","Gemy" +"1465152484339","","Gemy" +"1465152484339","write.table(x= new_dat, file = new_dat.txt)","Gemy" +"1465152484343","","Gemy" +"1465152484343","write.csv(x= new_dat, file = new_dat.csv)","Gemy" +"1465152484346","","Gemy" +"1465152484346","","Gemy" +"1465152484347","read.csv(new_dat.csv)","Gemy" +"1465152484362","","Gemy" +"1465152484363","read.table(new_dat.txt)","Gemy" +"1465155666456","read.csv(timesData.csv)","Gemy" +"1465155682080","read.csv(timesData.csv)","Gemy" +"1465155714439","read.csv(timesData.csv)","Gemy" +"1465155965528","getwd","Gemy" +"1465155970037","getwd()","Gemy" +"1465156037508","setwd(/Users/Gemy/)","Gemy" +"1465156137260","setwd(/Users/Gemy/Documents/Intro to R/)","Gemy" +"1465156142015","setwd(/Users/Gemy/Documents/Intro to R)","Gemy" +"1465156184726","getwd()","Gemy" +"1465156195634","setwd(/Users/Gemy/Documents/Intro to R)","Gemy" +"1465156218167","setwd(dir = /Users/Gemy/Documents/Intro to R)","Gemy" +"1465156231872","setwd(dir = /Users/Gemy/Documents/Intro to R /)","Gemy" +"1465156235782","getwd()","Gemy" +"1465156253855","read.csv(timesData.csv)","Gemy" +"1465156319202","head(timesData)","Gemy" +"1465156393516","head(timesData.csv)","Gemy" +"1465156525387","mydata = read.csv(timesData.csv)","Gemy" +"1465156533660","getwd()","Gemy" +"1465156557850","setwd(dir = /Users/Gemy/Documents/Intro to R /)","Gemy" +"1465156563087","mydata = read.csv(timesData.csv)","Gemy" +"1465156609643","mydata","Gemy" +"1465156624131","head(mydata)","Gemy" +"1465157301729","ís.missing(mydata)","Gemy" +"1465157309273","?mising","Gemy" +"1465157491308","??missing","Gemy" +"1465157542580","missing(mydata)","Gemy" +"1465157603467","missing(mydata$income)","Gemy" +"1465157783969","mydata <- data.frame(mydata)","Gemy" +"1465157785960","mydata","Gemy" +"1465157808726","View(mydata)","Gemy" +"1465157829096","str(mydata","Gemy" +"1465157830420",")","Gemy" +"1465157843217","missing(mydata$year)","Gemy" +"1465157858503","mean(income)","Gemy" +"1465157867372","attach(mydata)","Gemy" +"1465157871238","mean(income)","Gemy" +"1465157897621","mean(student_staff_ratio)","Gemy" +"1465157914646","missing(student_staff_ratio)","Gemy" +"1465158296041","mean(mydata$research)","Gemy" +"1465227315822","install.packages(mice)","Gemy" +"1465227332034","?mice","Gemy" +"1465227355225","install.packages(mice)","Gemy" +"1465227435118","install.packages(mice)","Gemy" +"1465227437232","getwd","Gemy" +"1465227439882","getwd()","Gemy" +"1465227448097","setwd(dir = /Users/Gemy/Documents/Intro to R /)","Gemy" +"1465227503493","install.package(mice)","Gemy" +"1465227507627","install.packages(mice)","Gemy" +"1465227522567","library(mice, lib.loc=/Library/Frameworks/R.framework/Versions/3.1/Resources/library)","Gemy" +"1465227529230","detach(package:mice, unload=TRUE)","Gemy" +"1465227632609","md.pattern(mydata$teaching)","Gemy" +"1465227637313","library(mice, lib.loc=/Library/Frameworks/R.framework/Versions/3.1/Resources/library)","Gemy" +"1465227650230","md.pattern(mydata$teaching)","Gemy" +"1465227693483","manager <- c(67, 211, 263, 211, 67, 263, 162, 121, 243, 263, 211, 121, 211,","Gemy" +"1465227693488","243, 211, 158, 30, 30, 243, 76, 243, 67, 162, 243, 158)","Gemy" +"1465227693489","country <- c(US, UK, UK, UK, US, UK, US, US, UK, UK, UK,","Gemy" +"1465227693489","US, UK, UK, UK, US, US, US, UK, US, UK, US,","Gemy" +"1465227693490","US, UK, US)","Gemy" +"1465227693490","gender <- c(F, M, M, M, F, M, F, F, M, M, M, F, M,","Gemy" +"1465227693491","M, M, F, F, F, M, M, M, F, F, M, F)","Gemy" +"1465227693491","age <- c(64, 46, 49, 31, -9999, 67, 22, 18, 64, 24, 37, 36, 18, 20, 49, 28, 40,","Gemy" +"1465227693492","39, 54, 47, 35, 49, 81, 58, 50)","Gemy" +"1465227693492","q1 <- c(5, 3, 3, 3, 3, 1, 5, 5, 4, 3, 3, 4, 4, 3, 3, NA, 2, 1, 4, 4, 5, 4, 4, 3, 3)","Gemy" +"1465227693493","q2 <- c(4, 5, 2, 2, 2, 4, 2, 1, 1, 4, 3, 4, 1, 4, 1, 4, 4, 1, 2, 4, 4, 1, 3, 2, 2)","Gemy" +"1465227693493","q3 <- c(5, 4, 5, 4, 3, 4, 5, 4, 4, 2, 3, 4, 3, 2, 4, 3, 2, 1, 4, NA, 3, 2, 5, 5, 5)","Gemy" +"1465227693494","q4 <- c(3, 2, 5, 4, 4, 3, 3, 4, 3, 2, 3, 3, 1, 3, 4, 4, 1, 4, 3, NA, 2, 3, 2, 2, 4)","Gemy" +"1465227693494","q5 <- c(5, 4, 1, 3, 4, 4, 2, 5, 1, 2, 3, 2, 5, 4, 3, 3, 2, 3, 3, NA, 3, 3, 2, 4, 3)","Gemy" +"1465227707363","leadership <- data.frame(manager, country, gender, age, q1, q2, q3,","Gemy" +"1465227707364","q4, q5, stringsAsFactors=FALSE)","Gemy" +"1465227707370","leadership","Gemy" +"1465227725120","mydata","Gemy" +"1465227783592","detach(package:mice, unload=TRUE)","Gemy" +"1465227807744","which(leadership$age == -9999)","Gemy" +"1465227845086","leadership$age[which(leadership$age == -9999)]","Gemy" +"1465227850738","leadership$age[which(leadership$age == -9999)] <- NA","Gemy" +"1465227853253","leadership","Gemy" +"1465227879225","leadership$age[5] <- -9999","Gemy" +"1465227884322","leadership","Gemy" +"1465227949223","leadership$age == -9999","Gemy" +"1465227966153","leadership$age[leadership$age == -9999] <- NA","Gemy" +"1465227966155","leadership","Gemy" +"1465227993638","leadership <- edit(leadership)","Gemy" +"1465228027241","leadership","Gemy" +"1465228077732","mydata = read.csv(timesData.csv)","Gemy" +"1465228080774","mydata","Gemy" +"1465228085927","leadership","Gemy" +"1465228110228","str(mydata)","Gemy" +"1465228136534","str(leadership)","Gemy" +"1465228146242","names(leadership) == age","Gemy" +"1465228207465","?names","Gemy" +"1465228254440","names(leadership)","Gemy" +"1465228350377","which(names(leadership) == age)","Gemy" +"1465228350382","leadership[5,4] <- NA","Gemy" +"1465228355918","leadership","Gemy" +"1465228366943","leadership$age[5] <- -9999","Gemy" +"1465228366944","leadership","Gemy" +"1465228380037","leadership == -9999","Gemy" +"1465228404886","leadership[leadership == -9999] <- NA ","Gemy" +"1465228404888","leadership","Gemy" +"1465228416925","str(mydata)","Gemy" +"1465228452516","mydata <= 0","Gemy" +"1465228480555","leadership == -9999","Gemy" +"1465228528994","mydata == -9999","Gemy" +"1465228546377","count(leadership == NA)","Gemy" +"1465228549050","?count","Gemy" +"1465228745094","libary(mice)","Gemy" +"1465228754816","library(mice)","Gemy" +"1465228764482","md.pattern(leadership$age)","Gemy" +"1465228779010","md.pattern(leadership)","Gemy" +"1465228795558","leadership","Gemy" +"1465228811015","md.pattern(mydata)","Gemy" +"1465228850391","NA <- md.pattern(mydata)","Gemy" +"1465228947872","leadership$age_cat <- NA","Gemy" +"1465228950929","leadership","Gemy" +"1465228980126","leadership$age_cat[leadership$age > 65] <- Elder","Gemy" +"1465228983247","leadership","Gemy" +"1465229059595","leadership$age_cat[leadership$age >= 45 & leadership$age <= 65] <- Middle Aged","Gemy" +"1465229059596","leadership","Gemy" +"1465229077010","leadership$age_cat[leadership$age < 45] <- Younger","Gemy" +"1465229077011","leadership","Gemy" +"1465229106222","leadership$age_cat[is.na(leadership$age)] <- NA","Gemy" +"1465229109545","leadership","Gemy" +"1465229241556","leadership$age_cat <- factor(leadership$age_cat,","Gemy" +"1465229241557","levels = c(Younger, Middle Aged, Elder),","Gemy" +"1465229241561","ordered = TRUE)","Gemy" +"1465229245898","str(leadership_)","Gemy" +"1465229248627","str(leadership)","Gemy" +"1465229530356","leadership <- within(leadership, {","Gemy" +"1465229530361","age_cat2 <- NA","Gemy" +"1465229530362","age_cat2[age > 65] <- Elder","Gemy" +"1465229530362","age_cat2[age >= 45 & age <= 65] <- Middle Aged","Gemy" +"1465229530363","age_cat2[age < 45] <- Younger","Gemy" +"1465229530363","age_cat2 <- factor(age_cat2,","Gemy" +"1465229530363","levels = c(Younger, Middle Aged, Elder),","Gemy" +"1465229530364","ordered = TRUE)","Gemy" +"1465229530364","})","Gemy" +"1465229530369","leadership","Gemy" +"1465229530381","str(leadership)","Gemy" +"1465229768766","leadership$gend_fact <- factor(leadership$gender, levels = c(Female, Male), ordered = TRUE)","Gemy" +"1465229776917","str(leadership)","Gemy" +"1465229791101","leadership","Gemy" +"1465229862829","leadership$gend_fact[leadership$gender == M] <- Male","Gemy" +"1465229880254","leadership$gend_fact[leadership$gender == Male] <- Male","Gemy" +"1465229893437","leadership$gend_fact[leadership$gender == M] <- Male","Gemy" +"1465229901868","leadership$gend_fact[leadership$gender == F] <- Female","Gemy" +"1465229904712","leadership","Gemy" +"1465229915118","str(leadership)","Gemy" +"1465229946431","leadership$gend_fact[is.na(leadership$gender)] <-NA","Gemy" +"1465229948291","leadership","Gemy" +"1465230003547","str(leadership)","Gemy" +"1465230060050","library(plyr)","Gemy" +"1465230096521","md.pattern(leadership)","Gemy" +"1465230455369","dim(leadership)","Gemy" +"1465230484563","?md.pattern","Gemy" +"1465230612412","leadership$gend_fact <- factor(leadership$gender, levels = c(Female, Male), ordered = FALSE)","Gemy" +"1465230614886","leadership","Gemy" +"1465230623789","leadership$gend_fact <- factor(leadership$gender, levels = c(Female, Male), ordered = TRUE)","Gemy" +"1465230627070","leadership","Gemy" +"1465230651891","leadership$gend_fact <- factor(leadership$gender, levels = c(Female, Male), ordered = FALSE)","Gemy" +"1465230673851","leadership$gend_fact[leadership$gender == M] <- Maleleadership$gend_fact[leadership$gender == F] <- Female","Gemy" +"1465230673856","> leadership","Gemy" +"1465230690471","leadership$gend_fact[leadership$gender == M] <- Male","Gemy" +"1465230697558","leadership$gend_fact[leadership$gender == F] <- Female","Gemy" +"1465230700634","leadership","Gemy" +"1465230708810","str(leadership)","Gemy" +"1465230986707","¬","Gemy" +"1465230994530","dim(leadership)","Gemy" +"1465231013000","sub1 <- leadership$age <= 65","Gemy" +"1465231029261","sub1","Gemy" +"1465231043424","?subset","Gemy" +"1465231178915","sum(sub1, na.rm = TRUE)","Gemy" +"1465231290372","sum(sub1)","Gemy" +"1465231370107","df1 <- subset(leadership, subset = sub1)","Gemy" +"1465231375699","dim(df1)","Gemy" +"1465231402545","table(df1$age_cat, useNA = always)","Gemy" +"1465231487265","sub2 <- leadership$age_cat != Elder","Gemy" +"1465231487267","sub2","Gemy" +"1465231535023","sum(sub2, na.rm = TRUE)","Gemy" +"1465231546613","df2 <- subset(x = leadership, subset = sub2)","Gemy" +"1465231546615","df2","Gemy" +"1465231561017","df1 == df2","Gemy" +"1465231600045","names(leadership)","Gemy" +"1465231600796","grep(age_cat, x = names(leadership))","Gemy" +"1465231619389","sel1 <- names( leadership)[-c(10,11)]","Gemy" +"1465231628263","sel1","Gemy" +"1465231641910","df3 <- subset(x= leadership, select = sel1)","Gemy" +"1465231672453","sel2 <- names( leadership)[-c(10,11,12)]","Gemy" +"1465231682502","df3 <- subset(x = leadership, select = sel1)","Gemy" +"1465231682504","dim(df3)","Gemy" +"1465231682508","df3","Gemy" +"1465231755325","1","Gemy" +"5 %in% c(1, 2, NA, 6, -3, 5, 7)","","Gemy" +"1465231755330","c(1, 2, NA, 6, -3, 5, 7) %in% 1","Gemy" +"5 ","","Gemy" +"1465231768979","c(NA) %in% leadership","Gemy" +"1465231922893","names(leadership) %in% c(age_cat, age_cat2)","Gemy" +"1465231922901","","Gemy" +"1465231922901","(sel2 <- !(names(leadership) %in% c(age_cat, age_cat2)))","Gemy" +"1465232002440","df4 <- subset(x = leadership, select = sel2)","Gemy" +"1465232002443","dim(df4)","Gemy" +"1465232002445","df4","Gemy" +"1465232002455","df3 == df4","Gemy" +"1465232019631","str(leadership)","Gemy" +"1465232074331","sel2 <- names(leadership)[-c(1,2,4,10,11,12)]","Gemy" +"1465232089176","df5 <- subset(x=leadership, select= sel2)","Gemy" +"1465232093482","dim(df5)","Gemy" +"1465232096659","df5","Gemy" +"1465232114131","sel3 <- names(leadership)[-c(1,2,4,10,11)]","Gemy" +"1465232125955","df5 <- subset(x=leadership, select= sel3)","Gemy" +"1465232127801","df5","Gemy" +"1465232194698","sub3 <- leadership$gend_fact == Famale","Gemy" +"1465232196354","sub3","Gemy" +"1465232208232","sum(sub3,na.arm = TRUE)","Gemy" +"1465232223506","df5 <- subset(x=df5, subset = sub3)","Gemy" +"1465232225048","df5","Gemy" +"1465232292326","df5 <- subset(x=leadership, select= sel3)","Gemy" +"1465232294453","df5","Gemy" +"1465232301871","sub3 <- leadership$gend_fact == Female","Gemy" +"1465232303865","sub3","Gemy" +"1465232308799","sum(sub3,na.arm = TRUE)","Gemy" +"1465232313334","df5 <- subset(x=df5, subset = sub3)","Gemy" +"1465232315638","df5","Gemy" +"1465232647902","sel4 <- names(leadership)[c(5","Gemy" +"9)]","","Gemy" +"1465232647903","sub4 <- leadership$gend_fact =Female","Gemy" +"1465232647907","df6 <- subset(x=leadership, select = sub4, subset = sub4)","Gemy" +"1465232687567","sub4 <- leadership$gend_fact ==Female","Gemy" +"1465232699087","df6 <- subset(x=leadership, select = sub4, subset = sub4)","Gemy" +"1465232765294","df6 <- subset(x=leadership, select =sub4)","Gemy" +"1465232795558","df5 <- subset(x=leadership, select= sel4, subset =sub4 )","Gemy" +"1465232798196","df5","Gemy" +"1465232844343","ind4 <- order(leadership$age)","Gemy" +"1465232844344","ind4","Gemy" +"1465232844348","df4 <- leadership[ind4, ]","Gemy" +"1465232844349","df4","Gemy" +"1465232942819","ind5 <- order(leadership$manager, leadership$age)","Gemy" +"1465232942821","ind5","Gemy" +"1465232942824","df5 <- leadership[ind5, ]","Gemy" +"1465232942825","df5","Gemy" +"1465233000695","leadership$age[ind4]","Gemy" +"1465246224987","mydata","Gemy" +"1465246232722","md.pattern(mydata)","Gemy" +"1465246273904","write.table(md.pattern(mydata), file = fre.txt)","Gemy" +"1465246315191","write.table(md.pattern(mydata), file = fre.csv)","Gemy" +"1465246411831","md.pattern(mydata)","Gemy" +"1465246418610","md.pattern(mydata)","Gemy" +"1465246439996","md.pattern(mydata)","Gemy" +"1465246567891","table(mydata)","Gemy" +"1465246626505","library(dyplr)","Gemy" +"1465246635598","library(dplyr)","Gemy" +"1465246642764","library(plyr)","Gemy" +"1465246652997","count(mydata)","Gemy" +"1465246665434","?count","Gemy" +"1465246682759","str(mydata)","Gemy" +"1465246694695","count(mydata$world_rank)","Gemy" +"1465246755199","summary(mydata)","Gemy" +"1465247188276","attach(mydata)","Gemy" +"1465247231860","md.pattern(mydata)","Gemy" +"1465247347771","prop.table(mydata, margin =1)","Gemy" +"1465247366432","prop.table(mydata$world_rank, margin =1)","Gemy" +"1465247441059","count(mydata, vars = country)","Gemy" +"1465247454160","?count","Gemy" +"1465247467088","count(mydata, vars = country)","Gemy" +"1465247496191","summary(mydata)","Gemy" +"1465349855951","dim(USArrests)","Gemy" +"1465349899620","names(USArrests)","Gemy" +"1465349916857","head(USArrests)","Gemy" +"1465349983191","?USArrests","Gemy" +"1465350218715","is.data.frame(USArrests)","Gemy" +"1465350469948","colnames(USArrests)","Gemy" +"1465350476670","rownames(USArrests)","Gemy" +"1465350669343","scatterplot (USArrests$Murder, USArrests$Assault)","Gemy" +"1465350695368","?plot","Gemy" +"1465350742716","plot (USArrests$Murder, USArrests$Assault)","Gemy" +"1465350768930","corr(USArrests$Murder, USArrests$Assault)","Gemy" +"1465350773276","cor(USArrests$Murder, USArrests$Assault)","Gemy" +"1465351034416","USArrests$Assault_cat <- NA","Gemy" +"1465351084348","USArrests$Assault_cat[USArrests$Assault<110] <- Low","Gemy" +"1465351155842","USArrests$Assault_cat[USArrests$Assault>=110 $ USArrests$Assault <=250] <- Middle-low","Gemy" +"1465351179546","USArrests$Assault_cat[USArrests$Assault>=110 $ USArrests$Assault <= 250] <- Middle-low","Gemy" +"1465351188731","USArrests$Assault_cat[USArrests$Assault>=110 $ USArrests$Assault<=250] <- Middle-low","Gemy" +"1465351222489","USArrests$Assault_cat[USArrests$Assault>=110 & USArrests$Assault<=250] <- Middle-low","Gemy" +"1465351261608","USArrests$Assault_cat[ USArrests$Assault >= 250] <- ","Gemy" +"1465351269985","USArrests$Assault_cat[ USArrests$Assault >= 250] <- High","Gemy" +"1465351282814","USArrests$Assault_cat[USArrests$Assault>=110 & USArrests$Assault<=160] <- Middle-low","Gemy" +"1465351295983","USArrests$Assault_cat[USArrests$Assault>=160 & USArrests$Assault<=250] <- Middle-low","Gemy" +"1465351301872","USArrests$Assault_cat[USArrests$Assault>=160 & USArrests$Assault<=250] <- Middle-high","Gemy" +"1465351303600","USArrests$Assault_cat[USArrests$Assault>=160 & USArrests$Assault<=250] <- Middle-low","Gemy" +"1465351311750","head(USArrests)","Gemy" +"1465351386680","USArrests$Assault_cat <- NA","Gemy" +"1465351386686","USArrests$Assault_cat[USArrests$Assault<110] <- Low","Gemy" +"1465351386687","USArrests$Assault_cat[USArrests$Assault>=110 & USArrests$Assault<=160] <- Middle-low","Gemy" +"1465351386688","USArrests$Assault_cat[USArrests$Assault>=160 & USArrests$Assault<=250] <- Middle-high","Gemy" +"1465351386688","USArrests$Assault_cat[ USArrests$Assault >= 250] <- High","Gemy" +"1465351400675","head(USArrests)","Gemy" +"1465351499919","USArrests$Assault_cat[is.na(USArrests$Assault)]<- NA","Gemy" +"1465351509531","USArrests","Gemy" +"1465351625355","USArrests$Assault_cat <- factor(USArrests$Assault_cat, levels =c(Low, Middle-low, Middle-high, High), ordered = TRUE)","Gemy" +"1465351634370","str(USArrests)","Gemy" +"1465351749655","USArrests <- within(USArrests, {})","Gemy" +"1465351786260","USArrests <- within(USArrests, {Assault_cat2 <- NA})","Gemy" +"1465351804805","USArrests <- within(USArrests, {Assault_cat2 <- NA)","Gemy" +"1465351809405","USArrests <- within(USArrests, {Assault_cat2 <- NA","Gemy" +"1465351866091","Assault_cat2[Assault < 110] <- Low","Gemy" +"1465351906139","Assault_cat2[Assault >= 110 & Assault <= 160] <- Middle-low","Gemy" +"1465351944522","Assault_cat2[Assault >= 160 & Assault >= 250] <- Middle-high","Gemy" +"1465351982097","Assault_cat2[Assault <250] <- High","Gemy" +"1465352006930","Assault_cat2[is.na(Assault)] <- NA","Gemy" +"1465352014448","}","Gemy" +"1465352024863","USArrests","Gemy" +"1465352054544","USArrests <- within(USArrests, {Assault_cat2 <- NA","Gemy" +"1465352054545","+ Assault_cat2[Assault < 110] <- Low","Gemy" +"1465352054549","+ Assault_cat2[Assault >= 110 & Assault <= 160] <- Middle-low","Gemy" +"1465352054550","+ Assault_cat2[Assault >= 160 & Assault >= 250] <- Middle-high","Gemy" +"1465352054550","+ Assault_cat2[Assault <250] <- High","Gemy" +"1465352054550","+ Assault_cat2[is.na(Assault)] <- NA} )","Gemy" +"1465352092435","USArrests <- within(USArrests, {Assault_cat2 <- NA","Gemy" +"1465352092436","Assault_cat2[Assault < 110] <- Low","Gemy" +"1465352092436","Assault_cat2[Assault >= 110 & Assault <= 160] <- Middle-low","Gemy" +"1465352092437","Assault_cat2[Assault >= 160 & Assault >= 250] <- Middle-high","Gemy" +"1465352092437","Assault_cat2[Assault <250] <- High","Gemy" +"1465352092437","Assault_cat2[is.na(Assault)] <- NA})","Gemy" +"1465352097422","USArrests","Gemy" +"1465352120397","USArrests <- within(USArrests, {Assault_cat2 <- NA","Gemy" +"1465352120402","Assault_cat2[Assault < 110] <- Low","Gemy" +"1465352120402","Assault_cat2[Assault >= 110 & Assault <= 160] <- Middle-low","Gemy" +"1465352120402","Assault_cat2[Assault >= 160 & Assault >= 250] <- Middle-high","Gemy" +"1465352120403","Assault_cat2[Assault >250] <- High","Gemy" +"1465352120403","Assault_cat2[is.na(Assault)] <- NA})","Gemy" +"1465352124453","USArrests","Gemy" +"1465352146415","USArrests <- within(USArrests, {Assault_cat2 <- NA","Gemy" +"1465352146416","Assault_cat2[Assault < 110] <- Low","Gemy" +"1465352146420","Assault_cat2[Assault >= 110 & Assault <= 160] <- Middle-low","Gemy" +"1465352146421","Assault_cat2[Assault >= 160 & Assault <= 250] <- Middle-high","Gemy" +"1465352146421","Assault_cat2[Assault >250] <- High","Gemy" +"1465352146422","Assault_cat2[is.na(Assault)] <- NA})","Gemy" +"1465352149572","USArrests","Gemy" +"1465352346909","str(USArrests)","Gemy" +"1465352387571","df1 <- order(USArrests$UrbanPop)","Gemy" +"1465352390034","df1","Gemy" +"1465352467970","ind1 <- order(USArrests$UrbanPop)","Gemy" +"1465352467976","df1 <- USArrests[ind1,]","Gemy" +"1465352472871","df1","Gemy" +"1465352649827","ind2 <- order(USArrests$Assault_cat, USArrests$UrbanPop)","Gemy" +"1465352670907","df2 <- USArrests[ind2,]","Gemy" +"1465352672407","df2","Gemy" +"1465352875718","which(USArrests$UrbanPop > 80)","Gemy" +"1465352942751","colnames(which(USArrests$UrbanPop > 80))","Gemy" +"1465352972521","USArrests[which(USArrests$UrbanPop > 80)]","Gemy" +"1465352982007","USArrests$UrbanPop[which(USArrests$UrbanPop > 80)]","Gemy" +"1465353005238","USArrests$UrbanPop[5]","Gemy" +"1465353091122","USArrests[which(USArrests$UrbanPop > 80)]","Gemy" +"1465353428351","ind3 <- which(USArrests$UrbanPop > 80)","Gemy" +"1465353428356","ind3","Gemy" +"1465353428357","names(USArrests[ind3])","Gemy" +"1465353700630","df1 <- subset(USArrests, USArrests$UrbanPop > 80)","Gemy" +"1465353702221","df1","Gemy" +"1465353868116","?by","Gemy" +"1465353991015","by(data = USArrests$Murder, INDICES = USArrests$Assault_cat, FUN = mean)","Gemy" +"1465354197755","by(data = USArrests$Murder, INDICES = USArrests$Assault_cat, FUN = mean, na.rm = TRUE)","Gemy" +"1465354216707","","Gemy" +"1465354216711","","Gemy" +"1465354216711","TASK 1","Gemy" +"1465354216711","","Gemy" +"1465354216712","","Gemy" +"1465354216712","dim(USArrests) ","Gemy" +"1465354216713","names(USArrests) ","Gemy" +"1465354216714","head(USArrests)","Gemy" +"1465354216738","?USArrests","Gemy" +"1465354216865","","Gemy" +"1465354216866","","Gemy" +"1465354216866","","Gemy" +"1465354216866","","Gemy" +"1465354216867","","Gemy" +"1465354216867","is.data.frame(USArrests) ","Gemy" +"1465354216868","","Gemy" +"1465354216868","","Gemy" +"1465354216868","colnames(USArrests)","Gemy" +"1465354216869","","Gemy" +"1465354216869","rownames(USArrests)","Gemy" +"1465354216873","","Gemy" +"1465354216873","","Gemy" +"1465354216874","plot (USArrests$Murder, USArrests$Assault)","Gemy" +"1465354216915","","Gemy" +"1465354216915","","Gemy" +"1465354216916","","Gemy" +"1465354216916","","Gemy" +"1465354216916","","Gemy" +"1465354216917","USArrests$Assault_cat <- NA","Gemy" +"1465354216917","USArrests$Assault_cat[USArrests$Assault<110] <- Low","Gemy" +"1465354216918","USArrests$Assault_cat[USArrests$Assault>=110 & USArrests$Assault<=160] <- Middle-low","Gemy" +"1465354216918","USArrests$Assault_cat[USArrests$Assault>=160 & USArrests$Assault<=250] <- Middle-high","Gemy" +"1465354216919","USArrests$Assault_cat[ USArrests$Assault >= 250] <- High","Gemy" +"1465354216919","USArrests$Assault_cat[is.na(USArrests$Assault)]<- NA","Gemy" +"1465354216920","head(USArrests)","Gemy" +"1465354216924","USArrests$Assault_cat <- factor(USArrests$Assault_cat,","Gemy" +"1465354216924","levels =c(Low, Middle-low, Middle-high, High),","Gemy" +"1465354216925","ordered = TRUE)","Gemy" +"1465354216926","","Gemy" +"1465354216926","","Gemy" +"1465354216926","","Gemy" +"1465354216926","USArrests <- within(USArrests, {Assault_cat2 <- NA","Gemy" +"1465354216927","Assault_cat2[Assault < 110] <- Low","Gemy" +"1465354216927","Assault_cat2[Assault >= 110 & Assault <= 160] <- Middle-low","Gemy" +"1465354216927","Assault_cat2[Assault >= 160 & Assault <= 250] <- Middle-high","Gemy" +"1465354216928","Assault_cat2[Assault >250] <- High","Gemy" +"1465354216928","Assault_cat2[is.na(Assault)] <- NA})","Gemy" +"1465354216930","USArrests","Gemy" +"1465354216944","","Gemy" +"1465354216944","","Gemy" +"1465354216945","ind1 <- order(USArrests$UrbanPop)","Gemy" +"1465354216946","df1 <- USArrests[ind1,]","Gemy" +"1465354216947","df1","Gemy" +"1465354216956","","Gemy" +"1465354216956","","Gemy" +"1465354216957","","Gemy" +"1465354216957","ind2 <- order(USArrests$Assault_cat, USArrests$UrbanPop)","Gemy" +"1465354216958","df2 <- USArrests[ind2,]","Gemy" +"1465354216959","df2","Gemy" +"1465354216967","","Gemy" +"1465354216967","","Gemy" +"1465354216969","ind3 <- which(USArrests$UrbanPop > 80)","Gemy" +"1465354216970","ind3","Gemy" +"1465354216971","","Gemy" +"1465354216972","","Gemy" +"1465354216973","df3 <- subset(USArrests, USArrests$UrbanPop > 80)","Gemy" +"1465354216975","","Gemy" +"1465354216975","","Gemy" +"1465354216976","","Gemy" +"1465354216976","by(data = USArrests$Murder, INDICES = USArrests$Assault_cat, FUN = mean)","Gemy" +"1465354217048","","Gemy" +"1465354217048","","Gemy" +"1465354217049","","Gemy" +"1465354217049","","Gemy" +"1465354303938","","Gemy" +"1465354303940","","Gemy" +"1465354303941","","Gemy" +"1465354303942","","Gemy" +"1465354303943","","Gemy" +"1465354303944","dim(USArrests) ","Gemy" +"1465354303945","names(USArrests) ","Gemy" +"1465354303946","head(USArrests)","Gemy" +"1465354303991","?USArrests","Gemy" +"1465354304200","","Gemy" +"1465354304200","","Gemy" +"1465354304219","","Gemy" +"1465354304220","","Gemy" +"1465354304222","","Gemy" +"1465354304224","is.data.frame(USArrests) ","Gemy" +"1465354304226","","Gemy" +"1465354304227","","Gemy" +"1465354304227","colnames(USArrests)","Gemy" +"1465354304229","","Gemy" +"1465354304230","rownames(USArrests)","Gemy" +"1465354304236","","Gemy" +"1465354304237","","Gemy" +"1465354304238","plot (USArrests$Murder, USArrests$Assault)","Gemy" +"1465354304324","","Gemy" +"1465354304328","","Gemy" +"1465354304329","","Gemy" +"1465354304329","","Gemy" +"1465354304330","","Gemy" +"1465354304332","USArrests$Assault_cat <- NA","Gemy" +"1465354304335","USArrests$Assault_cat[USArrests$Assault<110] <- Low","Gemy" +"1465354304336","USArrests$Assault_cat[USArrests$Assault>=110 & USArrests$Assault<=160] <- Middle-low","Gemy" +"1465354304338","USArrests$Assault_cat[USArrests$Assault>=160 & USArrests$Assault<=250] <- Middle-high","Gemy" +"1465354304854","USArrests$Assault_cat[ USArrests$Assault >= 250] <- High","Gemy" +"1465354304856","USArrests$Assault_cat[is.na(USArrests$Assault)]<- NA","Gemy" +"1465354304858","head(USArrests)","Gemy" +"1465354304878","USArrests$Assault_cat <- factor(USArrests$Assault_cat,","Gemy" +"1465354304879","levels =c(Low, Middle-low, Middle-high, High),","Gemy" +"1465354304881","ordered = TRUE)","Gemy" +"1465354304885","","Gemy" +"1465354304886","","Gemy" +"1465354304887","","Gemy" +"1465354304889","USArrests <- within(USArrests, {Assault_cat2 <- NA","Gemy" +"1465354304890","Assault_cat2[Assault < 110] <- Low","Gemy" +"1465354304891","Assault_cat2[Assault >= 110 & Assault <= 160] <- Middle-low","Gemy" +"1465354304891","Assault_cat2[Assault >= 160 & Assault <= 250] <- Middle-high","Gemy" +"1465354304892","Assault_cat2[Assault >250] <- High","Gemy" +"1465354304893","Assault_cat2[is.na(Assault)] <- NA})","Gemy" +"1465354304896","USArrests","Gemy" +"1465354304918","","Gemy" +"1465354304918","","Gemy" +"1465354304919","ind1 <- order(USArrests$UrbanPop)","Gemy" +"1465354304921","df1 <- USArrests[ind1,]","Gemy" +"1465354304924","df1","Gemy" +"1465354304939","","Gemy" +"1465354304941","","Gemy" +"1465354304946","","Gemy" +"1465354304947","ind2 <- order(USArrests$Assault_cat, USArrests$UrbanPop)","Gemy" +"1465354304964","df2 <- USArrests[ind2,]","Gemy" +"1465354304971","df2","Gemy" +"1465354305049","","Gemy" +"1465354305049","","Gemy" +"1465354305050","ind3 <- which(USArrests$UrbanPop > 80)","Gemy" +"1465354305051","ind3","Gemy" +"1465354305053","","Gemy" +"1465354305062","","Gemy" +"1465354305068","df3 <- subset(USArrests, USArrests$UrbanPop > 80)","Gemy" +"1465354305081","","Gemy" +"1465354305081","","Gemy" +"1465354305082","","Gemy" +"1465354305082","by(data = USArrests$Murder, INDICES = USArrests$Assault_cat, FUN = mean)","Gemy" +"1465354305091","","Gemy" +"1465354305092","","Gemy" +"1465354305094","","Gemy" +"1465354305095","","Gemy" +"1465399866096","View(mydata)","Gemy" +"1465399967382","summary(mydata$income)","Gemy" +"1465400054358","mydata$rc_income <- NA","Gemy" +"1465400105743","mydata$rc_income <- mydata$income","Gemy" +"1465400112822","mydata$income","Gemy" +"1465400139736","mydata$rc_income[is.na(mydata$income)] <- NA","Gemy" +"1465400149318","summary(mydata$income)","Gemy" +"1465400197979","mydata$rc_income[mydata$income == -] <-NA","Gemy" +"1465400215339","mydata$rc_income[mydata$income == -] <-NA","Gemy" +"1465400221779","summary(mydata$income)","Gemy" +"1465400295811","edit(mydata)","Gemy" +"1465400451221","leadership","Gemy" +"1465400467423","is.na(leadership$age)","Gemy" +"1465400478622","is.na(mydata$world_rank)","Gemy" +"1465400500243","is.na(mydata$income)","Gemy" +"1465400630388","mean(leadership$age)","Gemy" +"1465400640896","mean(leadership$age, na.rm = TRUE )","Gemy" +"1465400664600","sd(leadership$age)","Gemy" +"1465400664608","sd(leadership$age, na.rm = TRUE)","Gemy" +"1465400664609","table(leadership$age)","Gemy" +"1465400664611","table(leadership$age, useNA = ifany)","Gemy" +"1465400680497","df6 <- na.omit(leadership)","Gemy" +"1465400694353","dim(df6)","Gemy" +"1465400698866","df6","Gemy" +"1465400723726","mydata1 <- na.omit(mydata)","Gemy" +"1465400729235","dim(mydata1)","Gemy" +"1465400734489","dim(mydata)","Gemy" +"1465400739315","mydata1","Gemy" +"1465400768620","df6","Gemy" +"1465400786742","str(leadership)","Gemy" +"1465400794245","summary(leadership)","Gemy" +"1465400840653","View(mydata)","Gemy" +"1465400852910","View(mydata)","Gemy" +"1465401075416","apply(X = leadership[, 4","Gemy" +"9], 2, mean)","","Gemy" +"1465401093976","?apply","Gemy" +"1465401156352","apply(X = leadership[, 4","Gemy" +"9], 2, mean, na.rm = TRUE)","","Gemy" +"1465401213874","load(~/Documents/Intro to R /ecls.Rdata)","Gemy" +"1465401232968","head(ecls)","Gemy" +"1465401274367","apply(X = ecls, 2, FUN = mean)","Gemy" +"1465401287512","apply(X = leadership, MARGIN = 2, FUN = mean)","Gemy" +"1465401540047","?by","Gemy" +"1465401576287","by(data = leadership$age, INDICES = leadership$age_cat, mean)","Gemy" +"1465401585038","by(data = leadership$age, INDICES = leadership$country, FUN = mean)","Gemy" +"1465401741452","leadership$mean1 <- (leadership$q1 + leadership$q2 + leadership$q3 +","Gemy" +"1465401741458","leadership$q4 + leadership$q5)/5","Gemy" +"1465401741459","leadership","Gemy" +"1465401741475","","Gemy" +"1465401741476","leadership$mean2 <- apply(leadership[, 5","Gemy" +"9], 1, mean)","","Gemy" +"1465401741478","leadership","Gemy" +"1465401947961","leadership <- transform(leadership, mean3 = (q1 + q2 + q3 + q4 + q5)/5)","Gemy" +"1465401947967","leadership","Gemy" +"1465401958577","leadership$mean2 == leadership$mean3","Gemy" +"1465402057374","leadership <- subset(x = leadership, select = )","Gemy" +"1465402057375","colnames(leadership)[ind6] <- qmeans","Gemy" +"1465402057379","leadership","Gemy" +"1465402106270","ind6","Gemy" +"1465402168058","leadership <- leadership[,11","Gemy" +"12]","","Gemy" +"1465402170529","leadership","Gemy" +"1465402217946","View(df4)","Gemy" +"1465402300311","leadership <- df4[, -c(11,12)]","Gemy" +"1465402302671","leadership","Gemy" +"1465402323651","na.omit(leadership)","Gemy" +"1465402327592","leadership","Gemy" +"1465402476230","manager <- c(67, 211, 263, 211, 67, 263, 162, 121, 243, 263, 211, 121, 211,","Gemy" +"1465402476236","243, 211, 158, 30, 30, 243, 76, 243, 67, 162, 243, 158)","Gemy" +"1465402476237","country <- c(US, UK, UK, UK, US, UK, US, US, UK, UK, UK,","Gemy" +"1465402476238","US, UK, UK, UK, US, US, US, UK, US, UK, US,","Gemy" +"1465402476238","US, UK, US)","Gemy" +"1465402476239","gender <- c(F, M, M, M, F, M, F, F, M, M, M, F, M,","Gemy" +"1465402476239","M, M, F, F, F, M, M, M, F, F, M, F)","Gemy" +"1465402476240","age <- c(64, 46, 49, 31, -9999, 67, 22, 18, 64, 24, 37, 36, 18, 20, 49, 28, 40,","Gemy" +"1465402476241","39, 54, 47, 35, 49, 81, 58, 50)","Gemy" +"1465402476241","q1 <- c(5, 3, 3, 3, 3, 1, 5, 5, 4, 3, 3, 4, 4, 3, 3, NA, 2, 1, 4, 4, 5, 4, 4, 3, 3)","Gemy" +"1465402476242","q2 <- c(4, 5, 2, 2, 2, 4, 2, 1, 1, 4, 3, 4, 1, 4, 1, 4, 4, 1, 2, 4, 4, 1, 3, 2, 2)","Gemy" +"1465402476243","q3 <- c(5, 4, 5, 4, 3, 4, 5, 4, 4, 2, 3, 4, 3, 2, 4, 3, 2, 1, 4, NA, 3, 2, 5, 5, 5)","Gemy" +"1465402476243","q4 <- c(3, 2, 5, 4, 4, 3, 3, 4, 3, 2, 3, 3, 1, 3, 4, 4, 1, 4, 3, NA, 2, 3, 2, 2, 4)","Gemy" +"1465402476244","q5 <- c(5, 4, 1, 3, 4, 4, 2, 5, 1, 2, 3, 2, 5, 4, 3, 3, 2, 3, 3, NA, 3, 3, 2, 4, 3)","Gemy" +"1465402476244","leadership <- data.frame(manager, country, gender, age, q1, q2, q3,","Gemy" +"1465402476245","q4, q5, stringsAsFactors=FALSE)","Gemy" +"1465402476248","leadership","Gemy" +"1465402481668","na.omit(leadership)","Gemy" +"1465402483460","leadership","Gemy" +"1465402501396","leadership <- na.omit(leadership)","Gemy" +"1465402537068","by(data = leadership$q1, INDICES = leadership$gender, mean)","Gemy" +"1465402556529","by(data = leadership$q1, INDICES = leadership$gender, mean, na.rm = TRUE)","Gemy" +"1465402661253","if (4==5) {print(correct)} else {print(incorrect)}","Gemy" +"1465402703137","ifelse(4 == 4, correct, incorrect)","Gemy" +"1465402703138","ifelse(4 == 5, correct, incorrect)","Gemy" +"1465402748653","for (i in 1","Gemy" +"10) print(i)","","Gemy" +"1465402826428","for ( i in 1","Gemy" +" 10) rnorm( 10)","","Gemy" +"1465402843237","for ( i in 1","Gemy" +" 10) {rnorm( 10)}","","Gemy" +"1465402874875","for ( i in 1","Gemy" +" 10) {print(rnorm( 10))}","","Gemy" +"1465402904203","for ( i in 1","Gemy" +" 10) {print(rnorm( i))}","","Gemy" +"1465403000025","(out1 <- NULL)","Gemy" +"1465403029801","for( i in 1","Gemy" +" 10) out[i] <- u","","Gemy" +"1465403033161","for( i in 1","Gemy" +" 10) out[i] <- i","","Gemy" +"1465403044552","for (i in 1","Gemy" +"10) out1[i] <- i","","Gemy" +"1465403046896","out1","Gemy" +"1465403209590","for (i in 1","Gemy" +"10) out1[i] <- 2*i - 1","","Gemy" +"1465403209596","out1","Gemy" +"1465403226983","for (i in 1","Gemy" +"12) out1[i] <- 2*i - 1","","Gemy" +"1465403226984","out1","Gemy" +"1465403310971","","Gemy" +"1465403310977","for (i in 1","Gemy" +"10)","","Gemy" +"1465403310977","{","Gemy" +"1465403310977","if (i == 3 | i == 7) next","Gemy" +"1465403310978","print(i)","Gemy" +"1465403310978","}","Gemy" +"1465403310979","","Gemy" +"1465403310979","for (i in 1","Gemy" +"10)","","Gemy" +"1465403310979","{","Gemy" +"1465403310979","if (i == 3 | i == 7) break","Gemy" +"1465403310980","print(i)","Gemy" +"1465403310980","}","Gemy" +"1465403375946","for (i in 1","Gemy" +"10)","","Gemy" +"1465403375947","{","Gemy" +"1465403375951","if (i == 3) stop(Don't include 3 or 7 indexes or you will see this error.)","Gemy" +"1465403375951","print(i)","Gemy" +"1465403375952","}","Gemy" +"1465403399108","for (i in 1","Gemy" +"10)","","Gemy" +"1465403399110","{","Gemy" +"1465403399110","if (i == 3 | i == 7) stop(Don't include 3 or 7 indexes or you will see this error.)","Gemy" +"1465403399110","print(i)","Gemy" +"1465403399111","}","Gemy" +"1465403426064","out2 <- NA","Gemy" +"1465403431496","out2 <- NULL","Gemy" +"1465403568149","for( i in 8","Gemy" +"80) {if i %/% 8, print(i)}","","Gemy" +"1465403584965","?%/%","Gemy" +"1465403589436","?%%","Gemy" +"1465403610964","%%","Gemy" +"1465403615916","5%%1","Gemy" +"1465403621147","5%/%","Gemy" +"1465403623611","1","Gemy" +"1465403643169","out2 <- NULL","Gemy" +"1465403679691","for (i in 8","Gemy" +" 80), {if ( i %/% 8, print(i))}","","Gemy" +"1465403691154","for (i in 8","Gemy" +" 80), {if ( i %/% 8) print(i))}","","Gemy" +"1465403708697","for (i in 8","Gemy" +" 80), {if ( i %/% 8) break print(i))}","","Gemy" +"1465403713996","for (i in 8","Gemy" +" 80), {if ( i %/% 8) next print(i))}","","Gemy" +"1465403740686","for ( i in 1","Gemy" +" 10), out2[i] <- 8*i","","Gemy" +"1465403749464","for ( i in 1","Gemy" +" 10), {out2[i] <- 8*i}","","Gemy" +"1465403766511","for ( i in 1","Gemy" +" 10) {out2[i] <- 8*i}","","Gemy" +"1465403777344","for (i in 8","Gemy" +" 80) {if ( i %/% 8) print(i))}","","Gemy" +"1465403785881","out2","Gemy" +"1465403794488","seq(8","Gemy" +"80)","","Gemy" +"1465403802774","seq(8","Gemy" +"80, 8)","","Gemy" +"1465403810513","seq(8,80, 8)","Gemy" +"1465403856935","for ( i in 8","Gemy" +"80), {out3[i] <- i%/%8}","","Gemy" +"1465403862845","for ( i in 8","Gemy" +"80) {out3[i] <- i%/%8}","","Gemy" +"1465403869390","out3 <- NULL","Gemy" +"1465403871135","for ( i in 8","Gemy" +"80) {out3[i] <- i%/%8}","","Gemy" +"1465403873385","out3","Gemy" +"1465403881886","for ( i in 8","Gemy" +"80) {out3[i] <- i%%8}","","Gemy" +"1465403883775","out3","Gemy" +"1465403912981","out2","Gemy" +"1465403922683","seq(8, 80, 8)","Gemy" +"1465404189282","","Gemy" +"1465404189287","fun1 <- function(x, y) ","Gemy" +"1465404189288","{","Gemy" +"1465404189288","x + y - 2 ","Gemy" +"1465404189289","}","Gemy" +"1465404189289","fun1(3, 4)","Gemy" +"1465404189290","fun1(1000, 20)","Gemy" +"1465404257067","","Gemy" +"1465404257068","","Gemy" +"1465404257072","fun2 <- function(x)","Gemy" +"1465404257072","{","Gemy" +"1465404257073","3*x^2 - 2*x - 10","Gemy" +"1465404257073","}","Gemy" +"1465404257074","fun2(1)","Gemy" +"1465404257074","fun2(10)","Gemy" +"1465404379440","fun2(1","Gemy" +"10)","","Gemy" +"1465404379442","fun3 <- function(name)","Gemy" +"1465404379442","{","Gemy" +"1465404379442","paste0(Hello, , name)","Gemy" +"1465404379443","}","Gemy" +"1465404379443","fun3(Bryan Keller)","Gemy" +"1465404403782","un3 <- function(name = Bryan Keller)","Gemy" +"1465404403784","{","Gemy" +"1465404403787","paste0(Hello, , name)","Gemy" +"1465404403787","}","Gemy" +"1465404403788","fun3()","Gemy" +"1465404403789","fun3(George Washington)","Gemy" +"1465404458351","fun3 <- function(name = Bryan Keller)","Gemy" +"1465404458352","{","Gemy" +"1465404458355","paste0(Hello, , name)","Gemy" +"1465404458356","}","Gemy" +"1465404458356","fun3()","Gemy" +"1465404458357","fun3(George Washington)","Gemy" +"1465404510055","str(mydata)","Gemy" +"1465404612521","fun4 <- function(firstname = Bryan, lastname = Keller)","Gemy" +"1465404612526","{","Gemy" +"1465404612527","paste0(Hello, , firstname, , lastname)","Gemy" +"1465404612527","}","Gemy" +"1465404612528","fun4()","Gemy" +"1465404612528","fun4(George Washington)","Gemy" +"1465404612529","fun4(George, Washington)","Gemy" +"1465404612529","fun4(Washington, George)","Gemy" +"1465404612530","fun4(lastname = Washington, firstname = George)","Gemy" +"1465404673231","{","Gemy" +"1465404673232","if (parametric) {","Gemy" +"1465404673236","mean_x <- mean(x)","Gemy" +"1465404673237","sd_x <- sd(x)","Gemy" +"1465404673237","out <- c(mean = mean_x, sd = sd_x)","Gemy" +"1465404673237","} else {","Gemy" +"1465404673238","median_x <- median(x)","Gemy" +"1465404673238","iqr_x <- diff(quantile(x = x, probs = c(.25, .75)))","Gemy" +"1465404673239","out <- c(median = median_x, IQR = iqr_x)","Gemy" +"1465404673240","}","Gemy" +"1465404673240","out","Gemy" +"1465404673240","}","Gemy" +"1465404680850","mysummary <- function(x, parametric = TRUE)","Gemy" +"1465404680851","{","Gemy" +"1465404680855","if (parametric) {","Gemy" +"1465404680856","mean_x <- mean(x)","Gemy" +"1465404680856","sd_x <- sd(x)","Gemy" +"1465404680856","out <- c(mean = mean_x, sd = sd_x)","Gemy" +"1465404680857","} else {","Gemy" +"1465404680857","median_x <- median(x)","Gemy" +"1465404680857","iqr_x <- diff(quantile(x = x, probs = c(.25, .75)))","Gemy" +"1465404680858","out <- c(median = median_x, IQR = iqr_x)","Gemy" +"1465404680858","}","Gemy" +"1465404680859","out","Gemy" +"1465404680859","}","Gemy" +"1465404792950","set.seed(123456)","Gemy" +"1465404792955","vec1 <- runif(200, 0, 100)","Gemy" +"1465404792957","hist(vec1, breaks = 25)","Gemy" +"1465404793019","mysummary(x = vec1, parametric = TRUE)","Gemy" +"1465404793020","mysummary(x = vec1, parametric = FALSE)","Gemy" +"1465404793023","set.seed(123456)","Gemy" +"1465404793023","vec2 <- rexp(200, .01)","Gemy" +"1465404793024","hist(vec2, breaks = 25)","Gemy" +"1465404793065","mysummary(x = vec2, parametric = TRUE)","Gemy" +"1465404793066","mysummary(x = vec2, parametric = FALSE)","Gemy" +"1465404939668","head(ecls)","Gemy" +"1465404958692","str(ecls)","Gemy" +"1465405005174","","Gemy" +"1465405005175","plot(x = ecls$RIRT, y = ecls$MIRT)","Gemy" +"1465405055064","","Gemy" +"1465405055069","plot(x = ecls$RIRT, y = ecls$MIRT)","Gemy" +"1465405055110","","Gemy" +"1465405055111","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465405055111","xlab = Kindergarten Reading Score,","Gemy" +"1465405055111","ylab = Kindergarten Math Score)","Gemy" +"1465405055157","","Gemy" +"1465405066040","","Gemy" +"1465405066045","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465405066045","xlab = Kindergarten Reading Score,","Gemy" +"1465405066046","ylab = Kindergarten Math Score,","Gemy" +"1465405066046","main = ECLS-K Subsample Math and Reading Scores)","Gemy" +"1465405180388","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465405180395","xlab = Kindergarten Reading Score,","Gemy" +"1465405180395","ylab = Kindergarten Math Score,","Gemy" +"1465405180395","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465405180396","pch = 8) ","Gemy" +"1465405228812","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465405228817","xlab = Kindergarten Reading Score,","Gemy" +"1465405228817","ylab = Kindergarten Math Score,","Gemy" +"1465405228818","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465405228818","pch = 8) ","Gemy" +"1465405248553","","Gemy" +"1465405248558","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465405248559","xlab = Kindergarten Reading Score,","Gemy" +"1465405248559","ylab = Kindergarten Math Score,","Gemy" +"1465405248560","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465405248560","pch = 21, col = blue, bg = red) ","Gemy" +"1465405259859","","Gemy" +"1465405259861","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465405259861","xlab = Kindergarten Reading Score,","Gemy" +"1465405259862","ylab = Kindergarten Math Score,","Gemy" +"1465405259862","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465405259863","pch = 21, col = blue, bg = red, lwd = 2)","Gemy" +"1465405287435","","Gemy" +"1465405287438","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465405287438","xlab = Kindergarten Reading Score,","Gemy" +"1465405287439","ylab = Kindergarten Math Score,","Gemy" +"1465405287439","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465405287439","pch = 21, col = blue, bg = red, lwd = 2,","Gemy" +"1465405287440","cex = 2) ","Gemy" +"1465405306573","","Gemy" +"1465405306573","colors()","Gemy" +"1465405325708","","Gemy" +"1465405325708","col2rgb(yellow)","Gemy" +"1465405325709","col2rgb(red)","Gemy" +"1465405434463","palette()","Gemy" +"1465405434469","barplot(rep(1,8), yaxt = n, col = 1","Gemy" +"8, names.arg = palette())","","Gemy" +"1465405434499","","Gemy" +"1465405434499","rgb(red = 255, green = 255, blue = 0, alpha = 255, maxColorValue = 255)","Gemy" +"1465405434500","","Gemy" +"1465405434500","","Gemy" +"1465405871498","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465405871503","xlab = Kindergarten Reading Score,","Gemy" +"1465405871504","ylab = Kindergarten Math Score,","Gemy" +"1465405871504","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465405871504","pch = 19, col = rgb(0, 255, 100, alpha = 255, maxColorValue = 255))","Gemy" +"1465405871553","","Gemy" +"1465405871553","","Gemy" +"1465405871554","dim(ecls) ","Gemy" +"1465405871555","","Gemy" +"1465405871555","col_vec <- rep(c(red, blue), 269)","Gemy" +"1465405871556","length(col_vec) ","Gemy" +"1465405871557","col_vec <- c(col_vec, red)","Gemy" +"1465405871558","length(col_vec)","Gemy" +"1465405902013","","Gemy" +"1465405902014","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465405902018","xlab = Kindergarten Reading Score,","Gemy" +"1465405902018","ylab = Kindergarten Math Score,","Gemy" +"1465405902018","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465405902019","pch = 19, col = col_vec)","Gemy" +"1465405960243","","Gemy" +"1465405960244","","Gemy" +"1465405960248","","Gemy" +"1465405960248","(spec_ed_col <- c(black, red)[(ecls$F5SPECS == 1) + 1])","Gemy" +"1465405960256","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465405960257","xlab = Kindergarten Reading Score,","Gemy" +"1465405960257","ylab = Kindergarten Math Score,","Gemy" +"1465405960257","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465405960258","col = spec_ed_col)","Gemy" +"1465696205136","manager <- c(67, 211, 263, 211, 67, 263, 162, 121, 243, 263, 211, 121, 211,","Gemy" +"1465696205144","243, 211, 158, 30, 30, 243, 76, 243, 67, 162, 243, 158)","Gemy" +"1465696205145","country <- c(US, UK, UK, UK, US, UK, US, US, UK, UK, UK,","Gemy" +"1465696205145","US, UK, UK, UK, US, US, US, UK, US, UK, US,","Gemy" +"1465696205146","US, UK, US)","Gemy" +"1465696205146","gender <- c(F, M, M, M, F, M, F, F, M, M, M, F, M,","Gemy" +"1465696205146","M, M, F, F, F, M, M, M, F, F, M, F)","Gemy" +"1465696205147","age <- c(64, 46, 49, 31, -9999, 67, 22, 18, 64, 24, 37, 36, 18, 20, 49, 28, 40,","Gemy" +"1465696205149","39, 54, 47, 35, 49, 81, 58, 50)","Gemy" +"1465696205150","q1 <- c(5, 3, 3, 3, 3, 1, 5, 5, 4, 3, 3, 4, 4, 3, 3, NA, 2, 1, 4, 4, 5, 4, 4, 3, 3)","Gemy" +"1465696205150","q2 <- c(4, 5, 2, 2, 2, 4, 2, 1, 1, 4, 3, 4, 1, 4, 1, 4, 4, 1, 2, 4, 4, 1, 3, 2, 2)","Gemy" +"1465696205151","q3 <- c(5, 4, 5, 4, 3, 4, 5, 4, 4, 2, 3, 4, 3, 2, 4, 3, 2, 1, 4, NA, 3, 2, 5, 5, 5)","Gemy" +"1465696205152","q4 <- c(3, 2, 5, 4, 4, 3, 3, 4, 3, 2, 3, 3, 1, 3, 4, 4, 1, 4, 3, NA, 2, 3, 2, 2, 4)","Gemy" +"1465696205152","q5 <- c(5, 4, 1, 3, 4, 4, 2, 5, 1, 2, 3, 2, 5, 4, 3, 3, 2, 3, 3, NA, 3, 3, 2, 4, 3)","Gemy" +"1465696205153","leadership <- data.frame(manager, country, gender, age, q1, q2, q3,","Gemy" +"1465696205153","q4, q5, stringsAsFactors=FALSE)","Gemy" +"1465696205157","leadership","Gemy" +"1465696247588","which(leadership$age == -9999)","Gemy" +"1465696275078","leadership$age[which(leadership$age == -9999)]","Gemy" +"1465696289410","leadership$age[which(leadership$age == -9999)] <- NA","Gemy" +"1465696292950","leadership","Gemy" +"1465696308115","mydata","Gemy" +"1465826586994","fun2 <- function(x = 50,y = 10)","Gemy" +"1465826587019","{ y/x }","Gemy" +"1465826605178","View(fun2)","Gemy" +"1465826617471","fun2(50,10)","Gemy" +"1465826631663","fun2(10)","Gemy" +"1465826726362","fun2 <- function(x = 50,y = 10)","Gemy" +"1465826726363","{ x/y }","Gemy" +"1465826732049","fun2","Gemy" +"1465826737873","fun2 (10,10)","Gemy" +"1465826744630","fun2(20)","Gemy" +"1465826781444","fun4 <- function(firstname = Bryan, lastname = Keller)","Gemy" +"1465826781445","{","Gemy" +"1465826781449","paste0(Hello, , firstname, , lastname)","Gemy" +"1465826781450","}","Gemy" +"1465826781450","fun4()","Gemy" +"1465826781451","fun4(George Washington)","Gemy" +"1465826781451","fun4(George, Washington)","Gemy" +"1465826781452","fun4(Washington, George)","Gemy" +"1465826781452","fun4(lastname = Washington, firstname = George)","Gemy" +"1465826806860","fun2()","Gemy" +"1465826994729","fun2 <- function(x = 50,y = 10)","Gemy" +"1465826994735","{ x/y","Gemy" +"1465826994736","if (y == 0) stop (if y = 0 you will see this error message) }","Gemy" +"1465827003712","fun2(,0)","Gemy" +"1465827262617","fun2()","Gemy" +"1465827340515","fun2 <- function(x = 50,y = 10)","Gemy" +"1465827340516","{ x/y","Gemy" +"1465827340520","{ if (y == 0) stop (if y = 0 you will see this error message) }","Gemy" +"1465827340520","}","Gemy" +"1465827345632","fun2(,0)","Gemy" +"1465827348982","fun2(0)","Gemy" +"1465827353714","fun2()","Gemy" +"1465827361705","fun2(,)","Gemy" +"1465827385513","fun2","Gemy" +"1465827471029","fun2 <- function(x = 50,y = 10)","Gemy" +"1465827471030","{ x/y","Gemy" +"1465827471030","{ for (y == 0) stop (if y = 0 you will see this error message) }","Gemy" +"1465827471031","}","Gemy" +"1465827491386","fun2 <- function(x = 50,y = 10)","Gemy" +"1465827491387","{ x/y","Gemy" +"1465827491391","{for (y = 0) stop (if y = 0 you will see this error message) }","Gemy" +"1465827491392","}","Gemy" +"1465827509753","fun2 <- function(x = 50,y = 10)","Gemy" +"1465827509755","{ x/y","Gemy" +"1465827509758","for (y = 0) stop (if y = 0 you will see this error message) }","Gemy" +"1465827519435","fun2 <- function(x = 50,y = 10)","Gemy" +"1465827519436","{ x/y","Gemy" +"1465827519437","if (y = 0) stop (if y = 0 you will see this error message) }","Gemy" +"1465827552930","fun2 <- function(x = 50,y = 10)","Gemy" +"1465827552936","{ x/y","Gemy" +"1465827552936","for (y == 0) stop (if y = 0 you will see this error message) }","Gemy" +"1465827560611","fun2 <- function(x = 50,y = 10)","Gemy" +"1465827560612","{ x/y","Gemy" +"1465827560616","if (y == 0) stop (if y = 0 you will see this error message) }","Gemy" +"1465827603992","fun2 <- function(x = 50,y = 10)","Gemy" +"1465827603993","{ x/y","Gemy" +"1465827603997","if (y == 0) stop (if y = 0 you will see this error message)","Gemy" +"1465827603997","print (x/y)}","Gemy" +"1465827609451","fun2(,0)","Gemy" +"1465827612879","fun2()","Gemy" +"1465827676204","fun2(30,10)","Gemy" +"1465827709145","fun2( y = 15, x= 60)","Gemy" +"1465827755786","fun2 ( x = 1","Gemy" +"30, y = pi)","","Gemy" +"1465827864680","fun2 ( x = seven, y =10)","Gemy" +"1465827925445","fun2( x =2, y =0)","Gemy" +"1465827971273","","Gemy" +"1465827971273","","Gemy" +"1465827971277","","Gemy" +"1465827971278","","Gemy" +"1465827971280","fun2 <- function(x = 50,y = 10)","Gemy" +"1465827971280","{ x/y }","Gemy" +"1465827971281","fun2()","Gemy" +"1465827971281","","Gemy" +"1465827971282","","Gemy" +"1465827971282","fun2 <- function(x = 50,y = 10)","Gemy" +"1465827971283","{ x/y","Gemy" +"1465827971283","if (y == 0) stop (if y = 0 you will see this error message)","Gemy" +"1465827971284","print (x/y)}","Gemy" +"1465827971285","","Gemy" +"1465827971285","","Gemy" +"1465827971286","","Gemy" +"1465827971286","fun2() ","Gemy" +"1465827971287","","Gemy" +"1465827971288","fun2(30,10) ","Gemy" +"1465827971288","","Gemy" +"1465827971289","fun2( y = 15, x= 60) ","Gemy" +"1465827971289","","Gemy" +"1465827971290","fun2 ( x = 1","Gemy" +"30, y = pi) ","","Gemy" +"1465827971291","","Gemy" +"1465827971291","","Gemy" +"1465827971292","fun2 ( x = seven, y =10)","Gemy" +"1465827971292","","Gemy" +"1465827971293","","Gemy" +"1465827971293","fun2( x =2, y =0)","Gemy" +"1465827971294","","Gemy" +"1465827971294","","Gemy" +"1465828012409","fun2 <- function(x = 50,y = 10)","Gemy" +"1465828012409","{","Gemy" +"1465828012413","if (y == 0) stop (if y = 0 you will see this error message)","Gemy" +"1465828012414","print (x/y)}","Gemy" +"1465828016815","fun2()","Gemy" +"1465828028090","","Gemy" +"1465828028090","","Gemy" +"1465828028095","","Gemy" +"1465828028095","","Gemy" +"1465828028096","fun2 <- function(x = 50,y = 10)","Gemy" +"1465828028096","{ x/y }","Gemy" +"1465828028097","fun2()","Gemy" +"1465828028098","","Gemy" +"1465828028098","","Gemy" +"1465828028098","fun2 <- function(x = 50,y = 10)","Gemy" +"1465828028099","{","Gemy" +"1465828028099","if (y == 0) stop (if y = 0 you will see this error message)","Gemy" +"1465828028099","print (x/y)}","Gemy" +"1465828028100","","Gemy" +"1465828028101","","Gemy" +"1465828028102","","Gemy" +"1465828028102","fun2() ","Gemy" +"1465828028103","","Gemy" +"1465828028104","fun2(30,10) ","Gemy" +"1465828028105","","Gemy" +"1465828028106","fun2( y = 15, x= 60) ","Gemy" +"1465828028106","","Gemy" +"1465828028107","fun2 ( x = 1","Gemy" +"30, y = pi) ","","Gemy" +"1465828028108","","Gemy" +"1465828028108","","Gemy" +"1465828028109","fun2 ( x = seven, y =10)","Gemy" +"1465828028109","","Gemy" +"1465828028110","","Gemy" +"1465828028111","fun2( x =2, y =0)","Gemy" +"1465828028112","","Gemy" +"1465828028113","","Gemy" +"1465828073695","","Gemy" +"1465828073695","","Gemy" +"1465828073696","","Gemy" +"1465828073696","","Gemy" +"1465828073697","fun2 <- function(x = 50,y = 10)","Gemy" +"1465828073697","{ x/y }","Gemy" +"1465828073697","fun2()","Gemy" +"1465828073698","","Gemy" +"1465828073698","","Gemy" +"1465828073699","fun2 <- function(x = 50,y = 10)","Gemy" +"1465828073699","{ print (x/y)","Gemy" +"1465828073699","if (y == 0) stop (if y = 0 you will see this error message)","Gemy" +"1465828073700","}","Gemy" +"1465828073701","","Gemy" +"1465828073701","","Gemy" +"1465828073702","","Gemy" +"1465828073702","fun2() ","Gemy" +"1465828073703","","Gemy" +"1465828073704","fun2(30,10) ","Gemy" +"1465828073704","","Gemy" +"1465828073705","fun2( y = 15, x= 60) ","Gemy" +"1465828073705","","Gemy" +"1465828073706","fun2 ( x = 1","Gemy" +"30, y = pi) ","","Gemy" +"1465828073707","","Gemy" +"1465828073708","","Gemy" +"1465828073709","fun2 ( x = seven, y =10)","Gemy" +"1465828073710","","Gemy" +"1465828073710","","Gemy" +"1465828073711","fun2( x =2, y =0)","Gemy" +"1465828073712","","Gemy" +"1465828073712","","Gemy" +"1465828164397","","Gemy" +"1465828164406","","Gemy" +"1465828164406","","Gemy" +"1465828164406","","Gemy" +"1465828164407","fun2 <- function(x = 50,y = 10)","Gemy" +"1465828164407","{ x/y }","Gemy" +"1465828164408","fun2()","Gemy" +"1465828164409","","Gemy" +"1465828164409","","Gemy" +"1465828164410","fun2 <- function(x = 50,y = 10)","Gemy" +"1465828164410","{ print (x/y)","Gemy" +"1465828164410","if (y == 0) stop (if y = 0 you will see this error message)","Gemy" +"1465828164411","}","Gemy" +"1465828164413","","Gemy" +"1465828164413","","Gemy" +"1465828164415","","Gemy" +"1465828164415","fun2() ","Gemy" +"1465828164416","","Gemy" +"1465828164417","fun2(30,10) ","Gemy" +"1465828164417","","Gemy" +"1465828164418","fun2( y = 15, x= 60) ","Gemy" +"1465828164419","","Gemy" +"1465828164419","fun2 ( x = 1","Gemy" +"30, y = pi)","","Gemy" +"1465828164420","","Gemy" +"1465828164421","","Gemy" +"1465828164421","","Gemy" +"1465828164421","fun2 ( x = seven, y =10)","Gemy" +"1465828164422","","Gemy" +"1465828164422","","Gemy" +"1465828164423","fun2( x =2, y =0)","Gemy" +"1465828164424","","Gemy" +"1465828164424","","Gemy" +"1465828164424","","Gemy" +"1465831537812","head(ecls)","Gemy" +"1465831553866","load(~/Documents/Intro to R /ecls.Rdata)","Gemy" +"1465831575694","?abline","Gemy" +"1465831631678","(rirt_means <- by(data = ecls$RIRT, INDICES = ecls$F5SPECS, FUN = mean))","Gemy" +"1465831711524","abline(v = rirt_means[1], col = black, lwd = 2)","Gemy" +"1465831732805","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831732807","xlab = Kindergarten Reading Score,","Gemy" +"1465831732811","ylab = Kindergarten Math Score,","Gemy" +"1465831732811","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465831732812","col = spec_ed_col)","Gemy" +"1465831742916","","Gemy" +"1465831742916","","Gemy" +"1465831742917","","Gemy" +"1465831742918","","Gemy" +"1465831742918","","Gemy" +"1465831742919","","Gemy" +"1465831742920","","Gemy" +"1465831742920","","Gemy" +"1465831742921","","Gemy" +"1465831742921","","Gemy" +"1465831742921","","Gemy" +"1465831742922","","Gemy" +"1465831742922","","Gemy" +"1465831742923","","Gemy" +"1465831742923","","Gemy" +"1465831742924","","Gemy" +"1465831742924","","Gemy" +"1465831742924","","Gemy" +"1465831742925","","Gemy" +"1465831742926","","Gemy" +"1465831742926","","Gemy" +"1465831742926","","Gemy" +"1465831742927","","Gemy" +"1465831742927","head(ecls)","Gemy" +"1465831742931","str(ecls)","Gemy" +"1465831742939","","Gemy" +"1465831742939","plot(x = ecls$RIRT, y = ecls$MIRT)","Gemy" +"1465831743014","","Gemy" +"1465831743015","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831743015","xlab = Kindergarten Reading Score,","Gemy" +"1465831743015","ylab = Kindergarten Math Score)","Gemy" +"1465831743057","","Gemy" +"1465831743058","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831743058","xlab = Kindergarten Reading Score,","Gemy" +"1465831743058","ylab = Kindergarten Math Score,","Gemy" +"1465831743059","main = ECLS-K Subsample Math and Reading Scores)","Gemy" +"1465831743098","","Gemy" +"1465831743099","","Gemy" +"1465831743099","","Gemy" +"1465831743100","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831743100","xlab = Kindergarten Reading Score,","Gemy" +"1465831743100","ylab = Kindergarten Math Score,","Gemy" +"1465831743101","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465831743101","pch = 8) ","Gemy" +"1465831743144","","Gemy" +"1465831743145","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831743145","xlab = Kindergarten Reading Score,","Gemy" +"1465831743145","ylab = Kindergarten Math Score,","Gemy" +"1465831743146","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465831743146","pch = 21, col = blue, bg = red) ","Gemy" +"1465831743187","","Gemy" +"1465831743188","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831743188","xlab = Kindergarten Reading Score,","Gemy" +"1465831743188","ylab = Kindergarten Math Score,","Gemy" +"1465831743189","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465831743189","pch = 21, col = blue, bg = red, lwd = 2) ","Gemy" +"1465831743244","","Gemy" +"1465831743244","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831743245","xlab = Kindergarten Reading Score,","Gemy" +"1465831743245","ylab = Kindergarten Math Score,","Gemy" +"1465831743245","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465831743246","pch = 21, col = blue, bg = red, lwd = 2,","Gemy" +"1465831743246","cex = 2) ","Gemy" +"1465831743317","","Gemy" +"1465831743317","colors()","Gemy" +"1465831743333","","Gemy" +"1465831743334","col2rgb(yellow)","Gemy" +"1465831743335","col2rgb(red)","Gemy" +"1465831743335","","Gemy" +"1465831743336","","Gemy" +"1465831743336","palette()","Gemy" +"1465831743336","barplot(rep(1,8), yaxt = n, col = 1","Gemy" +"8, names.arg = palette())","","Gemy" +"1465831743369","","Gemy" +"1465831743370","rgb(red = 255, green = 255, blue = 0, alpha = 255, maxColorValue = 255)","Gemy" +"1465831743371","","Gemy" +"1465831743371","","Gemy" +"1465831743372","","Gemy" +"1465831743372","","Gemy" +"1465831743372","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831743373","xlab = Kindergarten Reading Score,","Gemy" +"1465831743373","ylab = Kindergarten Math Score,","Gemy" +"1465831743373","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465831743374","pch = 19, col = rgb(255, 0, 0, 100, maxColorValue = 255))","Gemy" +"1465831743425","","Gemy" +"1465831743425","","Gemy" +"1465831743426","","Gemy" +"1465831743426","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831743427","xlab = Kindergarten Reading Score,","Gemy" +"1465831743427","ylab = Kindergarten Math Score,","Gemy" +"1465831743427","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465831743428","pch = 19, col = rgb(0, 255, 100, alpha = 255, maxColorValue = 255))","Gemy" +"1465831743483","","Gemy" +"1465831743484","","Gemy" +"1465831743484","dim(ecls) ","Gemy" +"1465831743484","","Gemy" +"1465831743485","col_vec <- rep(c(red, blue), 269)","Gemy" +"1465831743485","length(col_vec) ","Gemy" +"1465831743486","col_vec <- c(col_vec, red)","Gemy" +"1465831743486","length(col_vec)","Gemy" +"1465831743487","","Gemy" +"1465831743488","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831743488","xlab = Kindergarten Reading Score,","Gemy" +"1465831743488","ylab = Kindergarten Math Score,","Gemy" +"1465831743489","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465831743489","pch = 19, col = col_vec)","Gemy" +"1465831743543","","Gemy" +"1465831743544","","Gemy" +"1465831743544","","Gemy" +"1465831743545","(spec_ed_col <- c(black, red)[(ecls$F5SPECS == 1) + 1])","Gemy" +"1465831743554","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465831743554","xlab = Kindergarten Reading Score,","Gemy" +"1465831743555","ylab = Kindergarten Math Score,","Gemy" +"1465831743555","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465831743555","col = spec_ed_col)","Gemy" +"1465831751990","abline(v = rirt_means[1], col = black, lwd = 2) ","Gemy" +"1465831751992","abline(v = rirt_means[2], col = red, lwd = 2)","Gemy" +"1465831767155","mirt_means <- by(data = ecls$MIRT, INDICES = ecls$F5SPECS, FUN = mean)","Gemy" +"1465831788118","abline(h = mirt_means[1], col = black, lwd = 2) ","Gemy" +"1465831788120","abline(h = mirt_means[2], col = red, lwd = 2)","Gemy" +"1465831852173","?points","Gemy" +"1465831920229","","Gemy" +"1465831920230","getwd","Gemy" +"1465831920234","setwd(dir = /Users/Gemy/Documents/Intro to R /)","Gemy" +"1465831920235","mydata = read.csv(timesData.csv)","Gemy" +"1465831920299","mydata","Gemy" +"1465831920608","mydata <- data.frame(mydata)","Gemy" +"1465831920610","mydata","Gemy" +"1465831920908","View(mydata)","Gemy" +"1465831920911","str(mydata)","Gemy" +"1465831944208","points(x = rirt_means[1], y = mirt_means[1], col = green, pch = 19)","Gemy" +"1465831953519","points(x = rirt_means[2], y = mirt_means[2], col = green, pch = 19)","Gemy" +"1465832027150","str(mydata)","Gemy" +"1465832165912","plot(x = mydata$research, y = mydata$world_rank,","Gemy" +"1465832165913","xlab = Research Score ,","Gemy" +"1465832165913","ylab = University World Rank,","Gemy" +"1465832165914","main = Relationship between University Research Score and University World Rank,","Gemy" +"1465832165914","col = green)","Gemy" +"1465832233726","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1465832233726","xlab = Kindergarten Reading Score,","Gemy" +"1465832233731","ylab = Kindergarten Math Score,","Gemy" +"1465832233731","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1465832233731","col = spec_ed_col)","Gemy" +"1465832339158","?lm","Gemy" +"1465832428070","lm1 <- lm(MIRT ~ RIRT, data = ecls )","Gemy" +"1465832437212","summary(lm1)","Gemy" +"1465832443569","coef(lm1)","Gemy" +"1465832477772","plot(x = mydata$research, y = mydata$world_rank,","Gemy" +"1465832477773","xlab = Research Score ,","Gemy" +"1465832477777","ylab = University World Rank,","Gemy" +"1465832477778","main = Relationship between University Research Score and University World Rank,","Gemy" +"1465832477778","col = green)","Gemy" +"1465832519361","plot(x = mydata$research, y = mydata$world_rank,","Gemy" +"1465832519362","xlab = Research Score ,","Gemy" +"1465832519366","ylab = University World Rank,","Gemy" +"1465832519366","main = University Research Score v.s University World Rank,","Gemy" +"1465832519367","col = green)","Gemy" +"1465832545029","abline(a = coef(lm1)[1], b = coef(lm1)[2], lwd = 3)","Gemy" +"1465832638593","plot(x = mydata$teaching, y = mydata$total_score,","Gemy" +"1465832638594","xlab = Teaching Score ,","Gemy" +"1465832638594","ylab = University Total Score,","Gemy" +"1465832638595","main = University Research Score v.s University World Rank,","Gemy" +"1465832638595","col = red)","Gemy" +"1465832705190","plot(x = mydata$research, y = mydata$total_score,","Gemy" +"1465832705196","xlab = Research Score ,","Gemy" +"1465832705196","ylab = University Total Score,","Gemy" +"1465832705197","main = Teaching Score v.s University Total Score,","Gemy" +"1465832705197","col = red)","Gemy" +"1465832725890","plot(x = mydata$research, y = mydata$total_score,","Gemy" +"1465832725895","xlab = Research Score ,","Gemy" +"1465832725896","ylab = University Total Score,","Gemy" +"1465832725896","main = Teaching Score v.s University Total Score,","Gemy" +"1465832725896","col = yellow)","Gemy" +"1465832754536","abline(lm1, lwd = 3)","Gemy" +"1465832773222","","Gemy" +"1465832773223","lm1 <- lm(MIRT ~ RIRT, data = ecls )","Gemy" +"1465832773229","summary(lm1)","Gemy" +"1465832773234","coef(lm1)","Gemy" +"1465832773235","abline(a = coef(lm1)[1], b = coef(lm1)[2], lwd = 3)","Gemy" +"1465832773236","","Gemy" +"1465832773236","abline(lm1, lwd = 3)","Gemy" +"1465832800512","?state.x77","Gemy" +"1465832888739","abline(a = coef(lm1)[1], b = coef(lm1)[2], lwd = 3, col = red)","Gemy" +"1465832902764","abline(lm1, lwd = 3)","Gemy" +"1465832919547","abline(lm1, lwd = 6)","Gemy" +"1465833069070","?state.x77","Gemy" +"1465833069098","","Gemy" +"1465833069099","df.x77 <- data.frame(state.x77)","Gemy" +"1465833069100","str(df.x77)","Gemy" +"1465833069112","","Gemy" +"1465833069112","plot(x = df.x77$Murder, y = df.x77$Life.Exp,","Gemy" +"1465833069112","xlab = Muder Rate per 100,000,","Gemy" +"1465833069113","ylab = Average Life Expectancy,","Gemy" +"1465833069113","main = 1977 State Data)","Gemy" +"1465833081451","abline(lm(df.x77$Life.Exp ~ df.x77$Murder))","Gemy" +"1465833081454","","Gemy" +"1465833081456","plot(x = df.x77$Murder, y = df.x77$Life.Exp,","Gemy" +"1465833081457","xlab = Muder Rate per 100,000,","Gemy" +"1465833081457","ylab = Average Life Expectancy,","Gemy" +"1465833081457","main = 1977 State Data,","Gemy" +"1465833081458","type = n) ","Gemy" +"1465833099477","","Gemy" +"1465833099477","text(x = df.x77$Murder, y = df.x77$Life.Exp,","Gemy" +"1465833099481","labels = state.abb)","Gemy" +"1465833179884","","Gemy" +"1465833179889","plot(x = df.x77$Murder, y = df.x77$Life.Exp,","Gemy" +"1465833179890","xlab = Muder Rate per 100,000,","Gemy" +"1465833179890","ylab = Average Life Expectancy,","Gemy" +"1465833179890","main = 1977 State Data,","Gemy" +"1465833179890","type = n) ","Gemy" +"1465833214894","library(plyr)","Gemy" +"1465833223296","levels(state.region)","Gemy" +"1465833262271","palette()","Gemy" +"1465833284907","reg_num <- mapvalues(as.character(state.region),","Gemy" +"1465833284907","from = levels(state.region),","Gemy" +"1465833284912","to = 1","Gemy" +"4)","","Gemy" +"1465833291598","class(reg_num)","Gemy" +"1465833298958","(as.numeric(reg_num))","Gemy" +"1465833314325","?mapvalues","Gemy" +"1465833432739","text(x = df.x77$Murder, y = df.x77$Life.Exp,","Gemy" +"1465833432740","labels = state.abb,","Gemy" +"1465833432744","col = reg_num)","Gemy" +"1465833442278","","Gemy" +"1465833442279","legend(x = topright, legend = levels(state.region),","Gemy" +"1465833442283","col = 1","Gemy" +"4, lty = 1, lwd = 10)","","Gemy" +"1465833476465","?legend","Gemy" +"1465833837881","library(car)","Gemy" +"1465833869720","install.packages(car)","Gemy" +"1465833967967","install.packages(car)","Gemy" +"1465833973385","install.packages(car)","Gemy" +"1465833986601","library(Car)","Gemy" +"1465833992414","library(car)","Gemy" +"1465834398067","library(car)","Gemy" +"1465834414821","library(car)","Gemy" +"1465834515396","plot(x = mydata$income, y = mydata$total_score,","Gemy" +"1465834515401","xlab = Country's National Income,","Gemy" +"1465834515401","ylab = University Total Ranking Score ,","Gemy" +"1465834515401","main = Country National Income v.s University World Total Score,","Gemy" +"1465834515402","col = green)","Gemy" +"1465834548950","plot(x = mydata$teaching, y = mydata$total_score,","Gemy" +"1465834548955","xlab = Teaching Score ,","Gemy" +"1465834548955","ylab = University Total Score,","Gemy" +"1465834548956","main = Teaching Score v.s University Total Score,","Gemy" +"1465834548956","col = red)","Gemy" +"1465834549037","plot(x = mydata$research, y = mydata$total_score,","Gemy" +"1465834549037","xlab = Research Score ,","Gemy" +"1465834549037","ylab = University Total Score,","Gemy" +"1465834549038","main = Teaching Score v.s University Total Score,","Gemy" +"1465834549038","col = yellow)","Gemy" +"1465834549120","plot(x = mydata$num_students, y = mydata$total_score,","Gemy" +"1465834549121","xlab = Number of Students ,","Gemy" +"1465834549121","ylab = University Total Score,","Gemy" +"1465834549122","main = Number of Students v.s University Total Score,","Gemy" +"1465834549122","col = blue)","Gemy" +"1465834560722","plot(x = mydata$international_students, y = mydata$total_score,","Gemy" +"1465834560723","xlab = Percentage of International Students ,","Gemy" +"1465834560724","ylab = University Total Score,","Gemy" +"1465834560724","main = Percentage of International Students v.s University Total Score,","Gemy" +"1465834560724","col = blue)","Gemy" +"1465834561735","plot(x = mydata$student_staff_ratio, y = mydata$total_score,","Gemy" +"1465834561735","xlab = Student - Staff Ratio ,","Gemy" +"1465834561739","ylab = University Total Score,","Gemy" +"1465834561740","main = Student-Staff Ratio v.s University Total Score,","Gemy" +"1465834561740","col = gray)","Gemy" +"1465834696003","head(Salaries)","Gemy" +"1465834712616","dim(Salaries)","Gemy" +"1465834720824","names(Salaries)","Gemy" +"1465834727362","str(Salaries)","Gemy" +"1465834802375","?car","Gemy" +"1465834949355","table(sex)","Gemy" +"1465834959617","(tab1 <- table(Salaries$rank))","Gemy" +"1465835003127","","Gemy" +"1465835003128","barplot(height = tab1)","Gemy" +"1465835027400","","Gemy" +"1465835027401","barplot(height = tab1,","Gemy" +"1465835027405","xlab = Rank,","Gemy" +"1465835027406","ylab = Frequency,","Gemy" +"1465835027406","main = Simple bar plot)","Gemy" +"1465835036688","","Gemy" +"1465835036688","barplot(height = tab1,","Gemy" +"1465835036693","xlab = Frequency,","Gemy" +"1465835036693","ylab = Rank,","Gemy" +"1465835036693","main = Horizontal bar plot,","Gemy" +"1465835036694","horiz = TRUE)","Gemy" +"1465835128654","(tab2 <- table(Salaries$rank, Salaries$discipline))","Gemy" +"1465835128661","barplot(tab2, beside = FALSE, ","Gemy" +"1465835128661","xlab = Discipline,","Gemy" +"1465835128662","ylab = Frequency,","Gemy" +"1465835128662","legend = rownames(tab2)) ","Gemy" +"1465835160368","colors()[grep(gray, x = colors())]","Gemy" +"1465835290563","barplot(tab2, beside = FALSE,","Gemy" +"1465835290564","xlab = Discipline,","Gemy" +"1465835290564","ylab = Frequency,","Gemy" +"1465835290565","col = c(gray25, gray50, gray75))","Gemy" +"1465835290590","legend(x = .45, y = 150, legend = rownames(tab2),","Gemy" +"1465835290590","fill = c(gray25, gray50, gray75),","Gemy" +"1465835290591","bg = white)","Gemy" +"1465835312033","","Gemy" +"1465835312034","barplot(tab2, beside = TRUE,","Gemy" +"1465835312035","xlab = Discipline,","Gemy" +"1465835312035","ylab = Frequency,","Gemy" +"1465835312035","col = c(gray30, gray75, gray90),","Gemy" +"1465835312036","main = Rank by Discipline)","Gemy" +"1465835312077","legend(x = 1.2, y = 100, legend = rownames(tab2),","Gemy" +"1465835312078","fill = c(gray30, gray75, gray90)) ","Gemy" +"1465835426694","load(~/Documents/Intro to R /ecls.Rdata)","Gemy" +"1465835493314","head(ecls)","Gemy" +"1465835524712","tab3 <- table(ecls$GENDER, ecls$F5SPECS)","Gemy" +"1465835540150","barplot( tab3, beside = TRUE, )","Gemy" +"1465835579940","barplot( tab3, beside = TRUE, xlab = Gender, ylab = Special Ed, legend = rownames(tab3))","Gemy" +"1465835613951","tab3","Gemy" +"1465835733237","barplot( tab3, beside = TRUE, xlab = Gender, ylab = Special Ed,","Gemy" +"1465835733243","col = c(gray30, gray75),","Gemy" +"1465835733244","main = Special Ed by Gender,","Gemy" +"1465835733244","legend = rownames(tab3))","Gemy" +"1465835759558","barplot( tab3, beside = FALSE, xlab = Gender, ylab = Special Ed,","Gemy" +"1465835759558","col = c(gray30, gray75),","Gemy" +"1465835759563","main = Special Ed by Gender,","Gemy" +"1465835759563","legend = rownames(tab3))","Gemy" +"1465836095385","?subset","Gemy" +"1465836126036","head(ecls)","Gemy" +"1465836473069","histdat <- c(0.2,0.2,0.6,0.6,1.1,","Gemy" +"1465836473074","1.2,1.5,1.6,1.8,2.3,","Gemy" +"1465836473075","3.5,3.8,4.4,4.7,5.3,","Gemy" +"1465836473076","6.4,6.7,7.5,7.6,12.6)","Gemy" +"1465836473077","h1 <- hist(histdat)","Gemy" +"1465836552331","h1","Gemy" +"1465836719091","hist(histdat, freq = FALSE)","Gemy" +"1465836719140","","Gemy" +"1465836719141","attach(Salaries)","Gemy" +"1465836795923","","Gemy" +"1465836795924","","Gemy" +"1465836795928","h2 <- hist(yrs.since.phd, xlab = Years Since PhD,","Gemy" +"1465836795929","main = Histogram of Years Since PhD)","Gemy" +"1465836870051","h2","Gemy" +"1465836879681","plot(h1$mids, h1$counts, type = h)","Gemy" +"1465836879716","plot(h1$mids, h1$counts, type = S)","Gemy" +"1465836999657","range(yrs.since.phd)","Gemy" +"1465836999664","brks <- seq(0, 60, 10)","Gemy" +"1465836999665","hist(yrs.since.phd, breaks = brks, xlab = Years Since PhD)","Gemy" +"1465836999732","brks <- seq(0, 60, 2)","Gemy" +"1465836999733","hist(yrs.since.phd, breaks = brks, xlab = Years Since PhD)","Gemy" +"1465836999777","","Gemy" +"1465836999777","","Gemy" +"1465836999777","hist(yrs.since.phd, breaks = 10)","Gemy" +"1465836999818","hist(yrs.since.phd, breaks = 20)","Gemy" +"1465836999855","hist(yrs.since.phd, breaks = 30)","Gemy" +"1465836999902","hist(yrs.since.phd, breaks = 40)","Gemy" +"1465836999942","hist(yrs.since.phd, breaks = 50)","Gemy" +"1465836999984","hist(yrs.since.phd, breaks = 80)","Gemy" +"1465837052378","head(Salaries)","Gemy" +"1465837070025","range(yrs.service)","Gemy" +"1465837100217","brks1 <- seq( 0, 60, 10)","Gemy" +"1465837126353","hist(yrs.service, breaks = brks1, xlab = Years Since Service )","Gemy" +"1465837153721","hist(yrs.service, breaks = 10)","Gemy" +"1465837183587","hist(yrs.service, breaks = 20)","Gemy" +"1465837190270","hist(yrs.service, breaks = 30)","Gemy" +"1465837256983","h3 <- hist(yrs.service, xlab = Years Since Service , main = Histogram of Years Since Service)","Gemy" +"1465837333460","h4 <- hist (salary, xlab = SAlary)","Gemy" +"1465837376683","range(salary)","Gemy" +"1465837388665","hist(salary, breaks = 100000)","Gemy" +"1465837396230","hist(salary, breaks = 10000)","Gemy" +"1465837405946","hist(salary, breaks = 100)","Gemy" +"1465837473119","d1 <- density(salary)","Gemy" +"1465837473132","plot(d1,","Gemy" +"1465837473133","xlab = Salary in Dollars,","Gemy" +"1465837473133","main = Kernel Density Plot of Academic Salaries)","Gemy" +"1465837692591","","Gemy" +"1465837692598","","Gemy" +"1465837692598","hist(salary, breaks = 25,","Gemy" +"1465837692602","xlab = Salary in Dollars,","Gemy" +"1465837692603","main = Academic Salaries,","Gemy" +"1465837692604","freq = FALSE) ","Gemy" +"1465837692695","","Gemy" +"1465837692695","lines(d1, col = blue, lwd = 3)","Gemy" +"1465837692702","","Gemy" +"1465837692703","","Gemy" +"1465837692703","h3 <- hist(salary, breaks = 25,","Gemy" +"1465837692704","xlab = Salary in Dollars,","Gemy" +"1465837692705","main = Academic Salaries,","Gemy" +"1465837692706","freq = TRUE) ","Gemy" +"1465837714620","h1","Gemy" +"1465837719865","h3","Gemy" +"1465837777154","points(x = d1$x, y = d1$y*1985000, col = blue,","Gemy" +"1465837777155","lwd = 3, type = l)","Gemy" +"1465838041707","range(salary)","Gemy" +"1465838041715","xfit <- seq(30000, 250000, length = 100)","Gemy" +"1465838041719","yfit <- dnorm(xfit, mean = mean(salary), sd = sd(salary))*1985000","Gemy" +"1465838041723","","Gemy" +"1465838041723","lines(xfit, yfit, col = red, lwd = 3)","Gemy" +"1465838052212","head(ecls)","Gemy" +"1465838173532","h4 <- hist(elcs$C6R4MSCL, breaks = 25,","Gemy" +"1465838173538","xlab = 5th Grade Math Score)","Gemy" +"1465838185591","h4 <- hist(ecls$C6R4MSCL, breaks = 25,","Gemy" +"1465838185596","xlab = 5th Grade Math Score)","Gemy" +"1465838228963","h4 <- hist(ecls$C6R4MSCL, breaks = 25,","Gemy" +"1465838228964","xlab = 5th Grade Math Score","Gemy" +"1465838228964","main = Math Score,","Gemy" +"1465838228965","freq = FALSE))","Gemy" +"1465838237920","h4 <- hist(ecls$C6R4MSCL, breaks = 25,","Gemy" +"1465838237920","xlab = 5th Grade Math Score,","Gemy" +"1465838237925","main = Math Score,","Gemy" +"1465838237925","freq = FALSE))","Gemy" +"1465838249561","range(ecls$C6R4MSCL","Gemy" +"1465838250976",")","Gemy" +"1465838284474","h4 <- hist(ecls$C6R4MSCL, breaks = 25,","Gemy" +"1465838284481","xlab = 5th Grade Math Score,","Gemy" +"1465838284483","main = Math Score,","Gemy" +"1465838284486",")","Gemy" +"1465838321054","d2 <- density(ecls$C6R4MSCL)","Gemy" +"1465838327825","d2","Gemy" +"1465838354143","lines(d2, col = blue, lwd = 3)","Gemy" +"1465838462365","h4","Gemy" +"1465838482543","dim(ecls)","Gemy" +"1465838519857","points( x= d2$x, y = d2$y*539, type = l"") +1465838523515:) +1465847116820:plot(x = mydata$teaching, y = mydata$total_score, +1465847116827:xlab = Teaching Score , +1465847116827:ylab = University Total Score, +1465847116827:main = Teaching Score v.s University Total Score, +1465847116828:col = red) +1465847145220:pallete() +1465847149557:palete() +1465847167122:color +1465847170741:?pallete +1465847183444:mydata = read.csv(timesData.csv) +1465847183447:mydata +1465847183450:mydata <- data.frame(mydata) +1465847183450:mydata +1465847183451:View(mydata) +1465847183452:str(mydata) +1465847191849:#### Data Final Project ##### +1465847191850:getwd +1465847191854:setwd(dir = /Users/Gemy/Documents/Intro to R /) +1465847191855:mydata = read.csv(timesData.csv) +1465847191918:mydata +1465847192216:mydata <- data.frame(mydata) +1465847192217:mydata +1465847192502:View(mydata) +1465847192507:str(mydata) +1465847199380:plot(x = mydata$teaching, y = mydata$total_score, +1465847199380:xlab = Teaching Score , +1465847199384:ylab = University Total Score, +1465847199385:main = Teaching Score v.s University Total Score, +1465847199385:col = red) +1465847199466:plot(x = mydata$research, y = mydata$total_score, +1465847199467:xlab = Research Score , +1465847199467:ylab = University Total Score, +1465847199467:main = Teaching Score v.s University Total Score, +1465847199468:col = green) +1465847199541:plot(x = mydata$num_students, y = mydata$total_score, +1465847199541:xlab = Number of Students , +1465847199542:ylab = University Total Score, +1465847199542:main = Number of Students v.s University Total Score, +1465847199542:col = blue) +1465847206703:plot(x = mydata$international_students, y = mydata$total_score, +1465847206704:xlab = Percentage of International Students , +1465847206704:ylab = University Total Score, +1465847206704:main = Percentage of International Students v.s University Total Score, +1465847206704:col = gray0) +1465847207707:plot(x = mydata$student_staff_ratio, y = mydata$total_score, +1465847207708:xlab = Student - Staff Ratio , +1465847207708:ylab = University Total Score, +1465847207708:main = Student-Staff Ratio v.s University Total Score, +1465847207709:col = gray) +1465847479903:plot(x = mydata$student_staff_ratio, y = mydata$total_score, +1465847479908:xlab = Student - Staff Ratio , +1465847479908:ylab = University Total Score, +1465847479908:main = Student-Staff Ratio v.s University Total Score, +1465847479909:col = gray) +1465847584624:plot(x = mydata$international_students, y = mydata$total_score, +1465847584629:xlab = Percentage of International Students , +1465847584630:ylab = University Total Score, +1465847584630:main = Percentage of International Students v.s University Total Score, +1465847584630:col = gray0) +1465847606975:plot(x = mydata$international_students, y = mydata$total_score, +1465847606976:xlab = Percentage of International Students , +1465847606976:ylab = University Total Score, +1465847606977:main = Percentage of International Students v.s University Total Score, +1465847606977:col = blue) +1465847639079:plot(x = mydata$num_students, y = mydata$total_score, +1465847639080:xlab = Number of Students , +1465847639084:ylab = University Total Score, +1465847639085:main = Number of Students v.s University Total Score, +1465847639085:col = blue) +1465847718765:plot(x = mydata$international_students, y = mydata$num_students, +1465847718770:xlab = Percentage of International Students , +1465847718770:ylab = Number of Students in University, +1465847718771:main = Number of International Students, +1465847718771:col = blue) +1465847736427:plot(x = mydata$research, y = mydata$total_score, +1465847736428:xlab = Research Score , +1465847736432:ylab = University Total Score, +1465847736433:main = Teaching Score v.s University Total Score, +1465847736433:col = green) +1465847755245:plot(x = mydata$research, y = mydata$total_score, +1465847755245:xlab = Research Score , +1465847755250:ylab = University Total Score, +1465847755250:main = Research Score v.s University Total Score, +1465847755250:col = green) +1465847883559:plot(x = mydata$teaching, y = mydata$total_score, +1465847883564:xlab = Teaching Score , +1465847883564:ylab = University Total Score, +1465847883564:main = Teaching Score v.s University Total Score, +1465847883565:col = red) +1465847894286:plot(x = mydata$student_staff_ratio, y = mydata$total_score, +1465847894287:xlab = Student - Staff Ratio , +1465847894287:ylab = University Total Score, +1465847894288:main = Student-Staff Ratio v.s University Total Score, +1465847894288:col = gray) +1465847993658:plot(x = mydata$research, y = mydata$teaching, +1465847993659:xlab = Research Quality , +1465847993660:ylab = Teaching Quality , +1465847993660:main = Research Quality v.s Teaching Quality , +1465847993660:col = red) +1465954604944:mydata +1465954628323:frequency(country) +1465954637898:frequency(mydata$country +1465954639742:) +1465954739008:attach(mydata) +1465954756538:mean(teaching) +1465954764581:library(ggplot2) +1465954774823:install.packages(ggplot2) +1465954797117:install.packages(ggplot2) +1465954819010:library(ggplot2) +1465954830103:nrow(mydata) +1465954841473:ncol(mydata) +1465954936343:edit(mydata) +1465955086905:country[2206] <- United Kingdom +1465955096985:country[2206] <- United Kingdom +1465955148440:mydata$country[2206] <- United Kingdom +1465955158474:mydata$country[2206] +1465955203169:mydata$country +1465955265515:country +1465955272375:country[1710] +1465955286741:world_rank +1465955325012:university_name +1465955333668:country +1465955350058:sort(countru) +1465955352877:sort(country +1465955354334:) +1465955409993:table(country) +1465955449340:which(country == Unisted States of America) +1465955462140:which(country == Unisted States of America) +1465955479115:country[2020] <- United States of America +1465955496871:mydata$country[2020] <- United States of America +1465955554516:table(country) +1465955682863:edit(mydata) +1465956667085:getwd +1465956667098:setwd(dir = /Users/Gemy/Documents/Intro to R /) +1465956667099:mydata = read.csv(timesData.csv) +1465956667208:mydata +1465956667574:mydata <- data.frame(mydata) +1465956667576:mydata +1465956677114:View(mydata) +1465956757873:getwd +1465956757879:setwd(dir = /Users/Gemy/Documents/Intro to R /) +1465956757880:mydata = read.csv(timesData.csv) +1465956757951:mydata +1465956758325:mydata <- data.frame(mydata) +1465956758327:mydata +1465956772632:View(mydata) +1465956800608:which(mydata$international == - +1465956801918:) +1465956888532:mydata$rc_international <- international +1465956905106:mydata$rc_international <- mydata$international +1465956920550:head(mydata) +1465956971206:attach(mydata) +1465957037283:rc_international[which(rc_international == -)] <- NA +1465957054539:rc_international +1465957102535:View(mydata) +1465957140720:which[rc_international == NA] +1465957149343:which (rc_international == NA) +1465957200148:md.pattern(rc_international) +1465957205761:md.pattern(mydata +1465957210289:md.pattern(mydata) +1465957212521:md.pattern(mydata) +1465957230955:library(class) +1465957234601:md.pattern(mydata) +1465957256263:library(mice) +1465957263255:install.packages(mice) +1465957270787:library(mice) +1465957279563:md.pattern(mydata) +1465957682704:getwd +1465957682709:setwd(dir = /Users/Gemy/Documents/Intro to R /) +1465957682710:mydata = read.csv(timesData.csv) +1465957682789:mydata +1465957683166:mydata <- data.frame(mydata) +1465957687133:View(mydata) +1465957698520:md.pattern(mydata) +1465957892888:plot(x = mydata$total_score, y = mydata$world_rank, +1465957892894:xlab = Total_Score, +1465957892894:ylab = World Rank , +1465957892894:main = Total Score vs. World Rank , +1465957892895:col = blue) +1465958225593:library(car) +1465958332727:reg1 <- glm(world_rank~teaching+international+research+citations+income, data = mydata) +1465958345860:reg1 +1465958395148:pred1 <- predict(reg1,mydata) +1465958412886:plot(mydata$world_rank, pred1) +1465958419242:pred1 +1465958558762:attach(mydata) +1465958610072:View(smd_vr) +1465958622145:View(smd_vr_DF) +1465958622885:View(smd_vr_DF) +1465958648078:attach(mydata) +1465958666730:getwd +1465958666736:setwd(dir = /Users/Gemy/Documents/Intro to R /) +1465958666737:mydata = read.csv(timesData.csv) +1465958666829:mydata +1465958667199:mydata <- data.frame(mydata) +1465958690790:attach(mydata) +1465958711000:detach(mydata) +1465958836938:tab1 <- table(mydata$world_rank) +1465958848851:barplot(height = tab1) +1465958880110:barplot (height = tab1,) +1465958892405:barplot(height = tab1, +1465958907533:xlab = World Rank +1465958914868:ylab = Frequency +1465958966793:barplot(height = tab1, xlab = World Rank, ylab = Frequency, main = Simple World Rank Bar Plot +1465958968216:) +1465959029196:tab1 <- table(mydata$world_rank) +1465959029199:barplot(height = tab1, xlab = World Rank, ylab = Frequency, main = Simple World Rank Bar Plot +1465959053619:tab1 <- table(mydata$world_rank) +1465959053621:barplot(height = tab1, xlab = World Rank, ylab = Frequency, main = Simple World Rank Bar Plot, +1465959069560:tab1 <- table(mydata$world_rank) +1465959069565:barplot(height = tab1, xlab = World Rank, ylab = Frequency, main = Simple World Rank Bar Plot, +1465959069565:horiz = TRUE) +1465959084172:barplot(height = tab1, xlab = World Rank, ylab = Frequency, main = Simple World Rank Bar Plot, +1465959084178:horiz = TRUE) +1465959129449:tab2 <- table(mydata$world_rank, mydata$research) +1465959130828:tab2 +1465959188903:barplot(tab2, beside = FALSE, +1465959188908:xlab = Research, +1465959188908:ylab = Frequency +1465959188909:legend = rownames(tab2)) +1465959195631:barplot(tab2, beside = FALSE, +1465959195632:xlab = Research, +1465959195636:ylab = Frequency, +1465959195637:legend = rownames(tab2)) +1465959259508:getwd +1465959259509:setwd(dir = /Users/Gemy/Documents/Intro to R /) +1465959259510:mydata = read.csv(timesData.csv) +1465959259570:mydata +1465959259868:mydata <- data.frame(mydata) +1465959272368:tab1 <- table(mydata$world_rank) +1465959272370:barplot(height = tab1, xlab = World Rank, ylab = Frequency, +1465959272374:main = Simple World Rank Bar Plot) +1465959344797:hist(mydata$country, freq = FALSE) +1465959361755:hist(mydata$teaching, freq = FALSE) +1465959464180:reg1 <- glm(world_rank~teaching+international+research+citations+income, data = mydata) +1465959464192:reg1 +1465959464194:pred1 <- predict(reg1, mydata) +1465959464197:pred1 +1465959464282:plot(mydata$world_rank, pred1) +1465959464362:abline(pred1) +1465959473543:abline(reg1) +1465959563491:spineplot(mydata$world_rank ~ mydata$research) +1465959576347:spineplot(mydata$world_rank ~ mydata$country) +1465959587857:is.factor(mydata$country) +1465959612808:spineplot(mydata$country ~ mydata$world_rank) +1465959708734:lines(pred1) +1465959722889:plot(mydata$world_rank, pred1) +1465959722967:lines(pred1) +1465959797814:attach(mydata) +1465959857735:top100 <- data.frame(mydata[1:100]) +1465959881871:top100 <- data.frame(mydata[1:100,]) +1465959900079:top100 <- droplevels(top100) +1465959903412:?droplevel +1465959912932:View(top100) +1465959938237:View(mydata) +1465959998193:sort(year, world_rank +1465959999345:) +1465960005034:?sort +1465960429060:mydata = read.csv(timesData 2.csv) +1465960441305:mydata <- data.frame(mydata) +1465960443510:View(mydata) +1465960538462:which(mydata$year == 2016) +1465960604110:df1 <- mydata[1804:2029] +1465960609422:df1 <- mydata[1804:2029,] +1465960613086:View(df1) +1465960647694:df1 <- mydata[1804:2004,] +1465960656771:df1 <- mydata[1804:2003,] +1465960750085:top200 <-mydata[1804:2003,] +1465960944197:View(top200) +1465960964876:str(top200) +1465961063945:attach(top200) +1465961077040:table(year) +1465961115905:table(mydata$year) +1465961165403:which(mydata$year == 2016) +1465961205498:top800 <- mydata[1804:2603] +1465961208499:top800 <- mydata[1804:2603,] +1465961281030:View(top800) +1465961329022:tab1 <- table(top800$world_rank) +1465961329028:barplot(height = tab1, xlab = World Rank, ylab = Frequency, +1465961329028:main = Simple World Rank Bar Plot) +1465961419745:attach(top800) +1465961443461:tab3 <- table(world_rank, teaching) +1465961452825:barplot(table3) +1465961459000:barplot(tab3) +1465961515884:tab4 <- table(world_rank, country) +1465961522292:barplot(tab4) +1465961645104:detach(top800) +1465961660576:table(top800$country) +1465961713743:table(top800$country, top800$university_name) +1465961895731:attach(top800) +1465961910752:tab2 <- table(country) +1465961926939:barplot(height = tab2) +1465962054586:barplot(height = tab2, xlab = Country, ylab =Number of Universities, +1465962054592:main = Top Universities by Country) +1465962084351:barplot(height = tab2, xlab = Country, ylab =Number of Universities, +1465962084352:main = Top Universities by Country, horiz = TRUE) +1465962113259:summary(country) +1465962167613:barplot(height = tab2, xlab = Country, ylab =Number of Universities, +1465962167614:main = Top Universities by Country, legend = rownames(tab2)) +1465962202370:colors()[grep(gray, x = colors())] +1465962303553:barplot(height = tab2, beside = TRUE, xlab = Country, ylab =Number of Universities, +1465962303559:main = Top Universities by Country, legend = rownames(tab2)) +1465962310417:barplot(height = tab2, beside = TRUE, xlab = Country, ylab =Number of Universities, +1465962310418:main = Top Universities by Country) +1465962317448:barplot(height = tab2, beside = FALSE, xlab = Country, ylab =Number of Universities, +1465962317449:main = Top Universities by Country) +1465962373421:barplot(height = tab2, beside = FALSE, xlab = Country, ylab =Number of Universities, +1465962373427:main = Top Universities by Country, col = c(red, green, gray) +1465962386100:) +1465962487274:h1 <- hist(country) +1465962503422:h1 <- hist(world_rank) +1465962523975:h1 <- hist(num_students) +1465962535447:str(num_students) +1465962545901:is.numeric(num_students) +1465962557461:as.numeric(num_students) +1465962569824:str(top800) +1465962613478:top800$number_students <- as.numeric(num_students) +1465962620718:head(top800) +1465962695412:as.numeric(international_students) +1465962803332:detach(top800) +1465962807444:head(top800) +1465962832074:top800$number_students <- as.numeric(num_students) +1465962840106:head(top800) +1465962863885:str(top800) +1465962872093:write.csv(top800) +1465962908491:?write.csv +1465962938483:write.csv(top800, file =top800.csv) +1465963048027:str(top800) +1465963081455:as.character(top800$university_name) +1465963140050:str(top800) +1465964108519:read.csv(top800.csv) +1465964117222:View(top800) +1465964144527:data <- read.csv(top800.csv) +1465964146840:View(data) +1465964159347:head(data) +1465964206298:str(data) +1465964241250:detach(top800) +1465964274280:data$university_name <- as.character(data$university_name) +1465964285217:str(data) +1465964321599:data$country <- as.character(data$country) +1465964399334:datafinal <- read.csv(top800.csv) +1465964399363:datafinal$university_name <- as.character(datafinal$university_name) +1465964399364:str(data) +1465964399388:datafinal$country <- as.character(datafinal$country) +1465964423848:str(datafinal) +1465964441284:table(country) +1465964968955:getwd +1465964968962:setwd(dir = /Users/Gemy/Documents/Intro to R /) +1465964985609:datafinal <- read.csv(top800.csv) +1465964998970:head(datafinal) +1465965018558:str(datafinal) +1465965057980:as.numeric(datafinal$student_staff_ratio) +1465965081084:as.numeric(datafinal$female_male_ratio +1465965082937:) +1465965222565:datafinal <- read.csv(top800.csv) +1465965222591:head(datafinal) +1465965229392:str(datafinal) +1465965275905:md.pattern(datafinal) +1465965281793:library(mice) +1465965288109:md.pattern(datafinal) +1465965335797:library(mice) +1465965335803:md.pattern(datafinal) +1465965342739:na.rm(datafinal) +1465965364011:View(datafinal) +1465965548741:mydata2 = read.csv(timesData 2.csv) +1465965558230:top800 <- mydata2[1804:2603,] +1465965566368:write.csv(top800, file =top8001.csv) +1465965942104:plot(x = datafinal$total_score, y = datafinal$world_rank, +1465965942109:xlab = Total_Score, +1465965942110:ylab = World Rank , +1465965942110:main = Total Score vs. World Rank , +1465965942110:col = blue) +1465965979986:tab1 <- table(datafinal$world_rank) +1465965979992:barplot(height = tab1, xlab = World Rank, ylab = Frequency, +1465965979993:main = Simple World Rank Bar Plot) +1465966004466:### Barplots +1465966004471:tab1 <- table(datafinal$country) +1465966004472:barplot(height = tab1, xlab = Country, ylab = Frequency, +1465966004472:main = Simple World Rank Bar Plot) +1465966229405:library(plyr) +1465966233901:levels(state.region) +1465966247436:levels(region) +1465966281162:library(plyr) +1465966281163:levels(state.region) +1465966281167:as.character(state.region) +1465966281169:reg_num <- mapvalues(as.character(state.region), +1465966281169:from = levels(state.region), +1465966281170:to = 1:4) +1465966281170:class(reg_num) +1465966281171:(as.numeric(reg_num)) +1465966281172:### Add colored state abbreviations by region +1465966281172:text(x = df.x77$Murder, y = df.x77$Life.Exp, +1465966281172:labels = state.abb, +1465966281173:col = reg_num) +1465966321392:df.x77 <- data.frame(state.x77) +1465966321394:str(df.x77) +1465966325297:plot(x = df.x77$Murder, y = df.x77$Life.Exp, +1465966325298:xlab = Muder Rate per 100,000, +1465966325302:ylab = Average Life Expectancy, +1465966325302:main = 1977 State Data) +1465966449497:plot(x = datafinal$research, y = datafinal$teaching, +1465966449499:xlab = Research Quality , +1465966449499:ylab = Teaching Quality , +1465966449499:main = Research Quality v.s Teaching Quality , +1465966449500:col = red) +1465966449542:abline(lm(datafinal$research ~ datafinal$teaching)) +1465966577847:text(x = datafinal$research, y = datafinal$teaching, labels = datafinal$university_name) +1465966612852:plot(x = datafinal$total_score, y = datafinal$world_rank, +1465966612854:xlab = Total_Score, +1465966612854:ylab = World Rank , +1465966612854:main = Total Score vs. World Rank , +1465966612855:col = blue) +1465966858905:datafinal <-na.omit(datafinal) +1465966863671:str(datafinal) +1465966880307:head(datafinal) +1465967196778:library(countrycode) +1465967227774:attach(datafinal) +1465967235331:table(country) +1465967624072:datafinal$Region <- recode(datafinal$country, c(Australia,Thailand,South Korea, Singapore, Taiwan, Indonesia) = Asia"" +1465967647451:datafinal$Region <- recode(datafinal$country, c(Australia,Thailand,South Korea, Singapore, Taiwan, Indonesia) = Asia) +1465967687826:datafinal$Region <- recode(datafinal$country, c(Australia,Thailand,South Korea, Singapore, Taiwan, Indonesia) = Asia"") +1465967739608:datafinal$Region <- recode(datafinal$country, c(Australia,Thailand,South Korea, Singapore, Taiwan, Indonesia) = Asia) +1465967759240:library(car) +1465967767765:install.packages(car) +1465967777598:install.packages(car) +1465967792808:library(car) +1465967803287:datafinal$Region <- recode(datafinal$country, c(Australia,Thailand,South Korea, Singapore, Taiwan, Indonesia) = Asia) +1465967809598:Region +1465967835280:table(country) +1465969128500:datafinal$Region <- recode(datafinal$country, c(Thailand,South Korea, Singapore, Taiwan, Indonesia, Bangladesh,China,Hong Kong,India,Iran,Israel,Japan,Lebanon,Macau,Malaysia,Oman,Pakistan,Qatar,Russian Federation,Turkey,Saudi Arabia,United Arab Emirates) = Asia, c(Argentina, Brazil,Chile, Colombia) = South America , c(Australia,New Zealand) = Oceania, c(Austria,Belarus, Belgium, United Kingdom, Switzerland,Cyprus, Czech Republic, Denmark,Estonia,Finland,France, Germany,Greece, Hungary, Iceland,Italy,Latvia,Lithuania, Luxembourg,Netherlands,Norway, Poland, Portugal, Spain, Sweden,Republic of Ireland,Romania,Serbia,Slovakia,Slovenia,Ukraine) =Europe, c(Canada, United States of America,Mexico) =North America, c(South Africa, Uganda,Egypt,Ghana,Kenya,Morocco,Nigeria ) = Africa) +1465969162922:datafinal$Region <- recode(datafinal$country, c(Thailand,South Korea, Singapore, Taiwan, Indonesia, Bangladesh,China,Hong Kong,India,Iran,Israel,Japan,Lebanon,Macau,Malaysia,Oman,Pakistan,Qatar,Russian Federation,Turkey,Saudi Arabia,United Arab Emirates) = Asia) +1465969192155:datafinal$Region <- recode(datafinal$country, c(Argentina, Brazil,Chile, Colombia) = South America , c(Australia,New Zealand) = Oceania, c(Austria,Belarus, Belgium, United Kingdom, Switzerland,Cyprus, Czech Republic, Denmark,Estonia,Finland,France, Germany,Greece, Hungary, Iceland,Italy,Latvia,Lithuania, Luxembourg,Netherlands,Norway, Poland, Portugal, Spain, Sweden,Republic of Ireland,Romania,Serbia,Slovakia,Slovenia,Ukraine) =Europe, c(Canada, United States of America,Mexico) =North America, c(South Africa, Uganda,Egypt,Ghana,Kenya,Morocco,Nigeria ) = Africa) +1465969236570:datafinal$Region <- recode(datafinal$country, c(Argentina, Brazil,Chile, Colombia) = South America; c(Australia,New Zealand) = Oceania; c(Austria,Belarus, Belgium, United Kingdom, Switzerland,Cyprus, Czech Republic, Denmark,Estonia,Finland,France, Germany,Greece, Hungary, Iceland,Italy,Latvia,Lithuania, Luxembourg,Netherlands,Norway, Poland, Portugal, Spain, Sweden,Republic of Ireland,Romania,Serbia,Slovakia,Slovenia,Ukraine) =Europe; c(Canada, United States of America,Mexico) =North America; c(South Africa, Uganda,Egypt,Ghana,Kenya,Morocco,Nigeria ) = Africa) +1465969247129:attach(datafinal) +1465969352739:detach(datafinal) +1465969357879:head(datafinal) +1465969409039:tab1 <- table(datafinal$Region) +1465969409046:barplot(height = tab1, xlab = Region, ylab = Frequency, +1465969409046:main = Region Distribution in Top 800) +1465969439087:table(datafinal$Region) +1465969465373:datafinal$Region <- recode(datafinal$country, c(Thailand,South Korea,","Gemy" +"1465969465378","Singapore, Taiwan, Indonesia, Bangladesh,China,","Gemy" +"1465969465379","Hong Kong,India,Iran,Israel,Japan,Lebanon,Macau,","Gemy" +"1465969465379","Malaysia,Oman,Pakistan,Qatar,Russian Federation,Turkey,","Gemy" +"1465969465379","Saudi Arabia,United Arab Emirates) = Asia) +1465969479485:table(datafinal$Region) +1465969500362:atafinal$Region <- recode(datafinal$country, c(Argentina, Brazil,Chile, Colombia) = South America;","Gemy" +"1465969500367","c(Australia,New Zealand) = Oceania;","Gemy" +"1465969500368","c(Austria,Belarus, Belgium, United Kingdom, Switzerland,Cyprus, Czech Republic,","Gemy" +"1465969500368","Denmark,Estonia,Finland,France, Germany,Greece, Hungary, Iceland,Italy,","Gemy" +"1465969500368","Latvia,Lithuania, Luxembourg,Netherlands,Norway, Poland, Portugal, Spain,","Gemy" +"1465969500369","Sweden,Republic of Ireland,Romania,Serbia,Slovakia,Slovenia,Ukraine) =Europe;","Gemy" +"1465969500369","c(Canada, United States of America,Mexico) =North America;","Gemy" +"1465969500369","c(South Africa, Uganda,Egypt,Ghana,Kenya,Morocco,Nigeria ) = Africa) +1465969511505:datafinal$Region <- recode(datafinal$country, c(Argentina, Brazil,Chile, Colombia) = South America;","Gemy" +"1465969511505","c(Australia,New Zealand) = Oceania;","Gemy" +"1465969511509","c(Austria,Belarus, Belgium, United Kingdom, Switzerland,Cyprus, Czech Republic,","Gemy" +"1465969511510","Denmark,Estonia,Finland,France, Germany,Greece, Hungary, Iceland,Italy,","Gemy" +"1465969511510","Latvia,Lithuania, Luxembourg,Netherlands,Norway, Poland, Portugal, Spain,","Gemy" +"1465969511510","Sweden,Republic of Ireland,Romania,Serbia,Slovakia,Slovenia,Ukraine) =Europe;","Gemy" +"1465969511511","c(Canada, United States of America,Mexico) =North America;","Gemy" +"1465969511511","c(South Africa, Uganda,Egypt,Ghana,Kenya,Morocco,Nigeria ) = Africa) +1465969544975:datafinal$Region <- recode(datafinal$country, c(Thailand,South Korea,","Gemy" +"1465969544980","Singapore, Taiwan, Indonesia, Bangladesh,China,","Gemy" +"1465969544980","Hong Kong,India,Iran,Israel,Japan,Lebanon,Macau,","Gemy" +"1465969544980","Malaysia,Oman,Pakistan,Qatar,Russian Federation,Turkey,","Gemy" +"1465969544980","Saudi Arabia,United Arab Emirates) = Asia); +1465969544982:c(Argentina, Brazil,Chile, Colombia) = South America;","Gemy" +"1465969544983","c(Australia,New Zealand) = Oceania;","Gemy" +"1465969544983","c(Austria,Belarus, Belgium, United Kingdom, Switzerland,Cyprus, Czech Republic,","Gemy" +"1465969544983","Denmark,Estonia,Finland,France, Germany,Greece, Hungary, Iceland,Italy,","Gemy" +"1465969544984","Latvia,Lithuania, Luxembourg,Netherlands,Norway, Poland, Portugal, Spain,","Gemy" +"1465969544984","Sweden,Republic of Ireland,Romania,Serbia,Slovakia,Slovenia,Ukraine) =Europe;","Gemy" +"1465969544984","c(Canada, United States of America,Mexico) =North America;","Gemy" +"1465969544985","c(South Africa, Uganda,Egypt,Ghana,Kenya,Morocco,Nigeria ) = Africa) +1465969562207:datafinal$Region <- recode(datafinal$country, c(Thailand,South Korea,","Gemy" +"1465969562212","Singapore, Taiwan, Indonesia, Bangladesh,China,","Gemy" +"1465969562212","Hong Kong,India,Iran,Israel,Japan,Lebanon,Macau,","Gemy" +"1465969562212","Malaysia,Oman,Pakistan,Qatar,Russian Federation,Turkey,","Gemy" +"1465969562213","Saudi Arabia,United Arab Emirates) = Asia;","Gemy" +"1465969562213","c('Argentina', 'Brazil','Chile', 'Colombia') = 'South America'; +1465969562214:c('Australia','New Zealand') = 'Oceania'; +1465969562214:c('Austria','Belarus', 'Belgium', 'United Kingdom', 'Switzerland','Cyprus', 'Czech Republic', +1465969562214:'Denmark','Estonia','Finland','France', 'Germany','Greece', 'Hungary', 'Iceland','Italy', +1465969562215:'Latvia','Lithuania', 'Luxembourg','Netherlands','Norway', 'Poland', 'Portugal', 'Spain', +1465969562215:'Sweden','Republic of Ireland','Romania','Serbia','Slovakia','Slovenia','Ukraine') ='Europe'; +1465969562215:c('Canada', 'United States of America','Mexico') ='North America'; +1465969562216:c('South Africa', 'Uganda','Egypt','Ghana','Kenya','Morocco','Nigeria' ) = 'Africa')","Gemy" +"1465969603920","Saudi Arabia,United Arab Emirates) = Asia;c(Argentina, Brazil,Chile, Colombia) = South America;","Gemy" +"1465969610150","Saudi Arabia,United Arab Emirates) = Asia;c(Argentina, Brazil,Chile, Colombia) = South America;","Gemy" +"1465969642186","datafinal$Region <- recode(datafinal$country, c('Thailand','South Korea', +1465969642187:'Singapore', 'Taiwan', 'Indonesia', 'Bangladesh','China', +1465969642192:'Hong Kong','India','Iran','Israel','Japan','Lebanon','Macau', +1465969642192:'Malaysia','Oman','Pakistan','Qatar','Russian Federation','Turkey', +1465969642193:'Saudi Arabia','United Arab Emirates') = 'Asia';c('Argentina', 'Brazil','Chile', 'Colombia') = 'South America'; +1465969642193:c('Australia','New Zealand') = 'Oceania'; +1465969642194:c('Austria','Belarus', 'Belgium', 'United Kingdom', 'Switzerland','Cyprus', 'Czech Republic', +1465969642195:'Denmark','Estonia','Finland','France', 'Germany','Greece', 'Hungary', 'Iceland','Italy', +1465969642195:'Latvia','Lithuania', 'Luxembourg','Netherlands','Norway', 'Poland', 'Portugal', 'Spain', +1465969642195:'Sweden','Republic of Ireland','Romania','Serbia','Slovakia','Slovenia','Ukraine') ='Europe'; +1465969642196:c('Canada', 'United States of America','Mexico') ='North America'; +1465969642197:c('South Africa', 'Uganda','Egypt','Ghana','Kenya','Morocco','Nigeria' ) = 'Africa')","Gemy" +"1465969697502","datafinal$Region <- recode(datafinal$country, c('Thailand','South Korea', +1465969697508:'Singapore', 'Taiwan', 'Indonesia', 'Bangladesh','China', +1465969697508:'Hong Kong','India','Iran','Israel','Japan','Lebanon','Macau', +1465969697508:'Malaysia','Oman','Pakistan','Qatar','Russian Federation','Turkey', +1465969697509:'Saudi Arabia','United Arab Emirates') = 'Asia'; +1465969697509:c('Argentina', 'Brazil','Chile', 'Colombia') = 'South America'; +1465969697510:c('Australia','New Zealand') = 'Oceania'; +1465969697511:c('Austria','Belarus', 'Belgium', 'United Kingdom', 'Switzerland','Cyprus', 'Czech Republic', +1465969697511:'Denmark','Estonia','Finland','France', 'Germany','Greece', 'Hungary', 'Iceland','Italy', +1465969697511:'Latvia','Lithuania', 'Luxembourg','Netherlands','Norway', 'Poland', 'Portugal', 'Spain', +1465969697511:'Sweden','Republic of Ireland','Romania','Serbia','Slovakia','Slovenia','Ukraine') ='Europe'; +1465969697512:c('Canada', 'United States of America','Mexico') ='North America'; +1465969697512:c('South Africa', 'Uganda','Egypt','Ghana','Kenya','Morocco','Nigeria' ) = 'Africa')","Gemy" +"1465969734100","datafinal$Region <- recode(datafinal$country, c('Thailand','South Korea', 'Singapore', 'Taiwan', 'Indonesia', 'Bangladesh','China','Hong Kong','India','Iran','Israel','Japan','Lebanon','Macau','Malaysia','Oman','Pakistan','Qatar','Russian Federation','Turkey','Saudi Arabia','United Arab Emirates') = 'Asia')","Gemy" +"1465969754267","datafinal$Region <- recode(datafinal$country, c('Thailand','South Korea', 'Singapore', 'Taiwan', 'Indonesia', 'Bangladesh','China','Hong Kong','India','Iran','Israel','Japan','Lebanon','Macau','Malaysia','Oman','Pakistan','Qatar','Russian Federation','Turkey','Saudi Arabia','United Arab Emirates') = 'Asia')","Gemy" +"1465969791659","recode(datafinal$Region, c('Argentina', 'Brazil','Chile', 'Colombia') = 'South America'; c('Australia','New Zealand') = 'Oceania'; c('Austria','Belarus', 'Belgium', 'United Kingdom', 'Switzerland','Cyprus', 'Czech Republic', 'Denmark','Estonia','Finland','France', 'Germany','Greece', 'Hungary', 'Iceland','Italy','Latvia','Lithuania', 'Luxembourg','Netherlands','Norway', 'Poland', 'Portugal', 'Spain', 'Sweden','Republic of Ireland','Romania','Serbia','Slovakia','Slovenia','Ukraine') ='Europe'; c('Canada', 'United States of America','Mexico') ='North America'; c('South Africa', 'Uganda','Egypt','Ghana','Kenya','Morocco','Nigeria' ) = 'Africa')","Gemy" +"1465969809898","head(datafinal$Region)","Gemy" +"1465969847270","head(datfinal)","Gemy" +"1465969851548","head(datafinal)","Gemy" +"1465969889778","datafinal$Region <- recode(datafinal$country, c('Thailand','South Korea', 'Singapore', 'Taiwan', 'Indonesia', 'Bangladesh','China','Hong Kong','India','Iran','Israel','Japan','Lebanon','Macau','Malaysia','Oman','Pakistan','Qatar','Russian Federation','Turkey','Saudi Arabia','United Arab Emirates') = 'Asia')","Gemy" +"1465969893714","datafinal$Region <- recode(datafinal$country, c('Thailand','South Korea', 'Singapore', 'Taiwan', 'Indonesia', 'Bangladesh','China','Hong Kong','India','Iran','Israel','Japan','Lebanon','Macau','Malaysia','Oman','Pakistan','Qatar','Russian Federation','Turkey','Saudi Arabia','United Arab Emirates') = 'Asia')","Gemy" +"1465969902901","head(finaldata)","Gemy" +"1465969913219","head(datafinal)","Gemy" +"1465969937969","datafinal$Region <- recode(datafinal$country, c('Thailand','South Korea', 'Singapore', 'Taiwan', 'Indonesia', 'Bangladesh','China','Hong Kong','India','Iran','Israel','Japan','Lebanon','Macau','Malaysia','Oman','Pakistan','Qatar','Russian Federation','Turkey','Saudi Arabia','United Arab Emirates') = 'Asia')","Gemy" +"1465969953176","recode(datafinal$Region, c('Argentina', 'Brazil','Chile', 'Colombia') = 'South America'; c('Australia','New Zealand') = 'Oceania'; c('Austria','Belarus', 'Belgium', 'United Kingdom', 'Switzerland','Cyprus', 'Czech Republic', 'Denmark','Estonia','Finland','France', 'Germany','Greece', 'Hungary', 'Iceland','Italy','Latvia','Lithuania', 'Luxembourg','Netherlands','Norway', 'Poland', 'Portugal', 'Spain', 'Sweden','Republic of Ireland','Romania','Serbia','Slovakia','Slovenia','Ukraine') ='Europe'; c('Canada', 'United States of America','Mexico') ='North America'; c('South Africa', 'Uganda','Egypt','Ghana','Kenya','Morocco','Nigeria' ) = 'Africa')","Gemy" +"1465969960605","head(datafinal)","Gemy" +"1465969989584","datafinal$Region <- recode(datafinal$country, c('Thailand','South Korea', +1465969989589:'Singapore', 'Taiwan', 'Indonesia', 'Bangladesh','China', +1465969989590:'Hong Kong','India','Iran','Israel','Japan','Lebanon','Macau', +1465969989590:'Malaysia','Oman','Pakistan','Qatar','Russian Federation','Turkey', +1465969989590:'Saudi Arabia','United Arab Emirates') = 'Asia'; +1465969989591:c('Argentina', 'Brazil','Chile', 'Colombia') = 'South America'; +1465969989591:c('Australia','New Zealand') = 'Oceania'; +1465969989591:c('Austria','Belarus', 'Belgium', 'United Kingdom', 'Switzerland','Cyprus', 'Czech Republic', +1465969989592:'Denmark','Estonia','Finland','France', 'Germany','Greece', 'Hungary', 'Iceland','Italy', +1465969989592:'Latvia','Lithuania', 'Luxembourg','Netherlands','Norway', 'Poland', 'Portugal', 'Spain', +1465969989592:'Sweden','Republic of Ireland','Romania','Serbia','Slovakia','Slovenia','Ukraine') ='Europe'; +1465969989592:c('Canada', 'United States of America','Mexico') ='North America'; +1465969989593:c('South Africa', 'Uganda','Egypt','Ghana','Kenya','Morocco','Nigeria' ) = 'Africa')","Gemy" +"1465969999949","head(datafinal)","Gemy" +"1465970017342","tab1 <- table(datafinal$Region)","Gemy" +"1465970017348","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1465970017349","main = Region Distribution in Top 800)","Gemy" +"1465970081200","datafinal$Region <- recode(datafinal$country, c('Thailand','South Korea', +1465970081205:'Singapore', 'Taiwan', 'Indonesia', 'Bangladesh','China', +1465970081206:'Hong Kong','India','Iran','Israel','Japan','Lebanon','Macau', +1465970081206:'Malaysia','Oman','Pakistan','Qatar','Russian Federation','Turkey', +1465970081206:'Saudi Arabia','United Arab Emirates','Jordan') = 'Asia'; +1465970081207:c('Argentina', 'Brazil','Chile', 'Colombia') = 'South America'; +1465970081207:c('Australia','New Zealand') = 'Oceania'; +1465970081207:c('Austria','Belarus', 'Belgium', 'United Kingdom', 'Switzerland','Cyprus', 'Czech Republic', +1465970081208:'Denmark','Estonia','Finland','France', 'Germany','Greece', 'Hungary', 'Iceland','Italy', +1465970081208:'Latvia','Lithuania', 'Luxembourg','Netherlands','Norway', 'Poland', 'Portugal', 'Spain', +1465970081208:'Sweden','Republic of Ireland','Romania','Serbia','Slovakia','Slovenia','Ukraine') ='Europe'; +1465970081209:c('Canada', 'United States of America','Mexico') ='North America'; +1465970081209:c('South Africa', 'Uganda','Egypt','Ghana','Kenya','Morocco','Nigeria' ) = 'Africa')","Gemy" +"1465970112215","table(datafinal$Region)","Gemy" +"1465970209472","str(datafinal)","Gemy" +"1465970278815","color <- mapvalues(as.character(datafinal$Region))","Gemy" +"1465970310431","color <- mapvalues(as.character(datafinal$Region), from = levels(datafinal$Region), to = 1","Gemy" +"6)","","Gemy" +"1465970314311","class(color)","Gemy" +"1465970350726","tab1 <- table(datafinal$Region)","Gemy" +"1465970350727","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1465970350731","main = Region Distribution in Top 800,","Gemy" +"1465970350731","col = color)","Gemy" +"1465970404246","palete()","Gemy" +"1465970410484","pallete()","Gemy" +"1465970431061","palette()","Gemy" +"1465970461267","tab1 <- table(datafinal$Region)","Gemy" +"1465970461268","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1465970461272","main = Region Distribution in Top 800,","Gemy" +"1465970461273","col = red,green,blue,gray,yellow,magnenta)","Gemy" +"1465970514223","tab1 <- table(datafinal$Region)","Gemy" +"1465970514224","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1465970514225","main = Region Distribution in Top 800,","Gemy" +"1465970514225","col = c(red,green,blue,gray,yellow,magnenta) )","Gemy" +"1465970529759","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1465970529760","main = Region Distribution in Top 800,","Gemy" +"1465970529764","col = c(red,green,blue,gray,yellow,cyan) )","Gemy" +"1465970628447","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1465970628456","main = Region Distribution in Top 800,","Gemy" +"1465970628456","legend = rownames(tab1)","Gemy" +"1465970628457","col = c(red,green,blue,gray,yellow,cyan) )","Gemy" +"1465970644567","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1465970644572","main = Region Distribution in Top 800,","Gemy" +"1465970644573","legend = rownames(tab1),","Gemy" +"1465970644573","col = c(red,green,blue,gray,yellow,cyan) )","Gemy" +"1465970722999","hist(num_students)","Gemy" +"1465970753219","hist(num_students, freq = FALSE)","Gemy" +"1465970780934","attach(datafinal)","Gemy" +"1465970787300","mean(num_students)","Gemy" +"1465970832705","h1 <- hist(num_students, breaks = 20000)","Gemy" +"1465970843971","range(num_students)","Gemy" +"1465970878783","brks <- seq(462, 379231, 1000)","Gemy" +"1465970898144","hist(num_students, breaks= brks)","Gemy" +"1465970929680","st(num_students)","Gemy" +"1465970934657","std(num_students)","Gemy" +"1465970951549","brks <- seq(462, 379231, 500)","Gemy" +"1465970955605","hist(num_students, breaks= brks)","Gemy" +"1465970973326","brks <- seq(462, 379231, 501","Gemy" +"1465970976068",")","Gemy" +"1465970978157","hist(num_students, breaks= brks)","Gemy" +"1465971003368","str(datafinal)","Gemy" +"1465971015307","hist(international_students)","Gemy" +"1465971038538","hist(international_students, breaks =brks)","Gemy" +"1465971051162","range(international_students)","Gemy" +"1465971071482","brks <- seq(0, 0.82, 0.1)","Gemy" +"1465971079619","hist(international_students, breaks =brks)","Gemy" +"1465971098232","brks <- seq(0.00, 0.82, 0.01)","Gemy" +"1465971100497","hist(international_students, breaks =brks)","Gemy" +"1465971228534","datafinal$int_stud <- international_students","Gemy" +"1465971234790","datafinal$int_stud <- international_students*100","Gemy" +"1465971246936","head(datafinal)","Gemy" +"1465971411858","range(int_stud)","Gemy" +"1465971411864","brks <- seq(0, 82, 10)","Gemy" +"1465971411865","hist(int_stud, breaks =brks,","Gemy" +"1465971411866","xlab = Percentage of International Students,","Gemy" +"1465971411866","main = Percentage of International Students ,","Gemy" +"1465971411866","freq = TRUE)","Gemy" +"1465971435714","range(datafinal$international_students)","Gemy" +"1465971435715","range(datafinal$int_stud)","Gemy" +"1465971435719","brks <- seq(0, 82, 10)","Gemy" +"1465971445145","hist(datafinal$int_stud, breaks =brks,","Gemy" +"1465971445151","xlab = Percentage of International Students,","Gemy" +"1465971445151","main = Percentage of International Students ,","Gemy" +"1465971445151","freq = TRUE)","Gemy" +"1465971462649","brks <- seq(0, 82, 2)","Gemy" +"1465971462651","hist(datafinal$int_stud, breaks =brks,","Gemy" +"1465971462654","xlab = Percentage of International Students,","Gemy" +"1465971462655","main = Percentage of International Students ,","Gemy" +"1465971462656","freq = TRUE)","Gemy" +"1465971482649","hist(datafinal$int_stud, breaks =brks,","Gemy" +"1465971482654","xlab = Percentage of International Students,","Gemy" +"1465971482655","main = Percentage of International Students ,","Gemy" +"1465971482655","freq = FALSE)","Gemy" +"1465971589691","d1 <- density(int_stud)","Gemy" +"1465971606579","plot(d1)","Gemy" +"1465971629865","d1 <- density(datafinal$int_stud)","Gemy" +"1465971633968","plot(d1)","Gemy" +"1465971705522","d1 <- density(datafinal$int_stud)","Gemy" +"1465971705528","plot(d1, xlab = Percentage of International Students,","Gemy" +"1465971705529","main = Kernel Density Plot of Percentage of International Students )","Gemy" +"1465971805784","hist(datafinal$int_stud, breaks =brks,","Gemy" +"1465971805784","xlab = Percentage of International Students,","Gemy" +"1465971805789","main = Percentage of International Students ,","Gemy" +"1465971805789","freq = FALSE)","Gemy" +"1465971805818","lines(d1, col = red, lwd =3)","Gemy" +"1465971865514","mean(international_students)","Gemy" +"1465972001375","range(datafinal$student_staff_ratio)","Gemy" +"1465972084277","brks <- seq(0.6, 162.6, 10.6)","Gemy" +"1465972090548","brks1 <- seq(0.6, 162.6, 10.6)","Gemy" +"1465972134021","brks1 <- seq(0.6, 162.6, 10.6)","Gemy" +"1465972134027","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972134028","xlab = Student - Staff Ratio,","Gemy" +"1465972134028","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972134028","freq = TRUE)","Gemy" +"1465972151883","brks1 <- seq(0.6, 162.6, 3.6)","Gemy" +"1465972151890","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972151891","xlab = Student - Staff Ratio,","Gemy" +"1465972151891","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972151891","freq = TRUE)","Gemy" +"1465972158940","brks1 <- seq(0.6, 162.6, 20.6)","Gemy" +"1465972158941","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972158942","xlab = Student - Staff Ratio,","Gemy" +"1465972158942","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972158942","freq = TRUE)","Gemy" +"1465972168219","brks1 <- seq(0.6, 162.6, 5.6)","Gemy" +"1465972168220","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972168224","xlab = Student - Staff Ratio,","Gemy" +"1465972168224","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972168225","freq = TRUE)","Gemy" +"1465972174524","brks1 <- seq(0.6, 162.6, 6.6)","Gemy" +"1465972174526","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972174526","xlab = Student - Staff Ratio,","Gemy" +"1465972174526","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972174527","freq = TRUE)","Gemy" +"1465972182786","brks1 <- seq(0.6, 162.6, 6)","Gemy" +"1465972182788","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972182791","xlab = Student - Staff Ratio,","Gemy" +"1465972182792","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972182792","freq = TRUE)","Gemy" +"1465972192907","brks1 <- seq(0.6, 162.6, 10)","Gemy" +"1465972192908","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972192909","xlab = Student - Staff Ratio,","Gemy" +"1465972192909","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972192909","freq = TRUE)","Gemy" +"1465972202578","brks1 <- seq(0.6, 162.6, 11)","Gemy" +"1465972202584","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972202584","xlab = Student - Staff Ratio,","Gemy" +"1465972202585","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972202585","freq = TRUE)","Gemy" +"1465972207682","brks1 <- seq(0.6, 162.6, 6)","Gemy" +"1465972207683","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972207687","xlab = Student - Staff Ratio,","Gemy" +"1465972207687","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972207687","freq = TRUE)","Gemy" +"1465972270503","mean(datafinal$student_staff_ratio)","Gemy" +"1465972296117","brks1 <- seq(0.6, 162.6, 18)","Gemy" +"1465972296123","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972296123","xlab = Student - Staff Ratio,","Gemy" +"1465972296124","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972296124","freq = TRUE)","Gemy" +"1465972330791","brks1 <- seq(0.6, 162.6, 6)","Gemy" +"1465972330797","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465972330797","xlab = Student - Staff Ratio,","Gemy" +"1465972330797","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972330798","freq = TRUE)","Gemy" +"1465972330826","mean(datafinal$student_staff_ratio)","Gemy" +"1465972512682","range(datafinal$num_students)","Gemy" +"1465972549257","mean(datafinal$num_students)","Gemy" +"1465972572073","ks3 <- seq(462, 379231, 462 )","Gemy" +"1465972572079","hist(datafinal$num_students, breaks =brks3,","Gemy" +"1465972572079","xlab = Student - Staff Ratio,","Gemy" +"1465972572079","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972572080","freq = TRUE)","Gemy" +"1465972578695","brks3 <- seq(462, 379231, 162 )","Gemy" +"1465972578696","hist(datafinal$num_students, breaks =brks3,","Gemy" +"1465972578700","xlab = Student - Staff Ratio,","Gemy" +"1465972578701","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972578701","freq = TRUE)","Gemy" +"1465972601350","range(datafinal$num_students)","Gemy" +"1465972601355","brks3 <- seq(462, 379231, 24000 )","Gemy" +"1465972601356","hist(datafinal$num_students, breaks =brks3,","Gemy" +"1465972601357","xlab = Student - Staff Ratio,","Gemy" +"1465972601357","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465972601357","freq = TRUE)","Gemy" +"1465972601360","mean(datafinal$num_students)","Gemy" +"1465972631948","range(datafinal$female_male_ratio)","Gemy" +"1465972764060","boxplots(datafinal$world_rank ~ datafinal$Region)","Gemy" +"1465972770686","boxplot(datafinal$world_rank ~ datafinal$Region)","Gemy" +"1465972881154","boxplot(datafinal$world_rank ~ datafinal$Region, xlab = Regions of Universities, ylab = World +1465972881160:University Rank )","Gemy" +"1465972932300","boxplot(datafinal$world_rank ~ datafinal$Region, xlab = Regions of Universities, ylab = World +1465972932305:University Rank, main = Conditional Boxplots between Regions of University and World Rank)","Gemy" +"1465973036231","boxplot(datafinal$world_rank ~ datafinal$Region, xlab = Regions of Universities, ylab = World +1465973036237:University Rank, main = Conditional Boxplots between Regions of University and World Rank","Gemy" +"1465973036237",", col =blue)","Gemy" +"1465973055931","colors()","Gemy" +"1465973080092","boxplot(datafinal$world_rank ~ datafinal$Region, xlab = Regions of Universities, ylab = World +1465973080093:University Rank, main = Conditional Boxplots between Regions of University and World Rank,","Gemy" +"1465973080093","col = tan2)","Gemy" +"1465973360076","plot(x = datafinal$num_students, y = datafinal$world_rank,","Gemy" +"1465973360082","xlab = Number of Students at Universities,","Gemy" +"1465973360083","ylab = University World Rank,","Gemy" +"1465973360083","main = World Rank vs Number of Students at Uni,","Gemy" +"1465973360083","col = tomato3)","Gemy" +"1465973374366","plot(x = datafinal$num_students, y = datafinal$world_rank,","Gemy" +"1465973374367","xlab = Number of Students at Universities,","Gemy" +"1465973374371","ylab = University World Rank,","Gemy" +"1465973374372","main = World Rank vs Number of Students at Uni,","Gemy" +"1465973374372","col = tomato3)","Gemy" +"1465973463320","plot(x = datafinal$student_staff_ratio, y = datafinal$world_rank,","Gemy" +"1465973463325","xlab = Number of Students at Universities,","Gemy" +"1465973463326","ylab = University World Rank,","Gemy" +"1465973463326","main = Number of Students at Uni vs. World Rank ,","Gemy" +"1465973463326","col = tomato3)","Gemy" +"1465973499719","plot(x = datafinal$student_staff_ratio, y = datafinal$world_rank,","Gemy" +"1465973499724","xlab = Student - Staff Ratio,","Gemy" +"1465973499724","ylab = University World Rank,","Gemy" +"1465973499724","main = Student-Staff Ratio vs. World Rank ,","Gemy" +"1465973499725","col = thistle)","Gemy" +"1465973507934","plot(x = datafinal$student_staff_ratio, y = datafinal$world_rank,","Gemy" +"1465973507935","xlab = Student - Staff Ratio,","Gemy" +"1465973507939","ylab = University World Rank,","Gemy" +"1465973507939","main = Student-Staff Ratio vs. World Rank ,","Gemy" +"1465973507940","col = thistle4)","Gemy" +"1465973693625","plot(x = datafinal$female_male_ratio, y = datafinal$world_rank,","Gemy" +"1465973693631","xlab = Student - Staff Ratio,","Gemy" +"1465973693631","ylab = University World Rank,","Gemy" +"1465973693631","main = Student-Staff Ratio vs. World Rank ,","Gemy" +"1465973693632","col = thistle4)","Gemy" +"1465973753410","datafinal$gender_ratio <- as.numeric(datafinal$female_male_ratio)","Gemy" +"1465973763961","head(gender_ratio)","Gemy" +"1465973776836","head(datafinal)","Gemy" +"1465973817760","datafinal$gender_ratio <- datafinal$female_male_ratio *100","Gemy" +"1465974680882","d2 <- density(datafinal$num_students)","Gemy" +"1465974680896","plot(d2, xlab = Number of Students, main = Kernel Density Plot of Number of Students)","Gemy" +"1465974717912","plot(d2, xlab = Number of Students, main = Kernel Density Plot of Number of Students,","Gemy" +"1465974717913","col = skyblue)","Gemy" +"1465974730955","d2 <- density(datafinal$num_students)","Gemy" +"1465974730957","plot(d2, xlab = Number of Students, main = Kernel Density Plot of Number of Students,","Gemy" +"1465974730960","col = plum)","Gemy" +"1465974741634","d2 <- density(datafinal$num_students)","Gemy" +"1465974741636","plot(d2, xlab = Number of Students, main = Kernel Density Plot of Number of Students,","Gemy" +"1465974741639","col = red)","Gemy" +"1465974808622","plot(x = datafinal$total_score, y = datafinal$world_rank,","Gemy" +"1465974808627","xlab = Total_Score,","Gemy" +"1465974808627","ylab = World Rank ,","Gemy" +"1465974808627","main = Total Score vs. World Rank ,","Gemy" +"1465974808628","col = blue)","Gemy" +"1465974814756","plot(x = datafinal$research, y = datafinal$teaching,","Gemy" +"1465974814757","xlab = Research Quality ,","Gemy" +"1465974814761","ylab = Teaching Quality ,","Gemy" +"1465974814761","main = Research Quality v.s Teaching Quality ,","Gemy" +"1465974814762","col = red)","Gemy" +"1465974814815","abline(lm(datafinal$research ~ datafinal$teaching))","Gemy" +"1465975389019","mean(datafinal$int_stud)","Gemy" +"1465976042667","boxplot(datafinal$income ~ datafinal$Region, xlab = Regions of Universities, ylab = Industry Income,","Gemy" +"1465976042673","main = Conditional Boxplots between Regions of University and Industry Income,","Gemy" +"1465976042674","col = tan2)","Gemy" +"1465976072609","boxplot(datafinal$teaching ~ datafinal$Region, xlab = Regions of Universities,","Gemy" +"1465976072610","ylab = Industry Income,","Gemy" +"1465976072614","main = Conditional Boxplots between Regions of University and Industry Income,","Gemy" +"1465976072614","col = tan2)","Gemy" +"1465976120269","boxplot(datafinal$teaching ~ datafinal$Region, xlab = Regions of Universities,","Gemy" +"1465976120274","ylab = Teaching Quality,","Gemy" +"1465976120275","main = Conditional Boxplots between Regions of University and Teaching Quality,","Gemy" +"1465976120275","col = tan2)","Gemy" +"1465976153914","colors()","Gemy" +"1465976198189","boxplot(datafinal$research ~ datafinal$Region, xlab = Regions of Universities,","Gemy" +"1465976198194","ylab = Teaching Quality,","Gemy" +"1465976198195","main = Conditional Boxplots between Regions of University and Teaching Quality,","Gemy" +"1465976198195","col = tan2)","Gemy" +"1465976224040","boxplot(datafinal$citations ~ datafinal$Region, xlab = Regions of Universities,","Gemy" +"1465976224041","ylab = Teaching Quality,","Gemy" +"1465976224045","main = Conditional Boxplots between Regions of University and Teaching Quality,","Gemy" +"1465976224045","col = tan2)","Gemy" +"1465976270480","boxplot(datafinal$citations ~ datafinal$Region, xlab = Regions of Universities,","Gemy" +"1465976270486","ylab = Citations/Research Influence,","Gemy" +"1465976270486","main = Conditional Boxplots between Regions of University and Research Influence,","Gemy" +"1465976270487","col = skyblue4)","Gemy" +"1465976770259","range(datafinal$student_staff_ratio)","Gemy" +"1465976770267","brks1 <- seq(0.6, 162.6, 6)","Gemy" +"1465976770269","hist(datafinal$student_staff_ratio, breaks =brks1,","Gemy" +"1465976770270","xlab = Student - Staff Ratio,","Gemy" +"1465976770270","main = Distribution of Student -Staff Ratio ,","Gemy" +"1465976770270","freq = TRUE)","Gemy" +"1465976808888","mean(datafinal$student_staff_ratio)","Gemy" +"1466395580594","install.packages(ggplot2)","Gemy" +"1466395597355","library(ggplot2)","Gemy" +"1466395619625","data(diamonds)","Gemy" +"1466395628425","?diamonds","Gemy" +"1466395845440","str(diamonds)","Gemy" +"1466395853254","dim(dimond)","Gemy" +"1466395858779","dim(diamonds)","Gemy" +"1466395882051","table diamonds$carat","Gemy" +"1466395907473","table (diamonds$carat)","Gemy" +"1466395931233","summary (diamonds$carat)","Gemy" +"1466395975154","head(diamonds)","Gemy" +"1466396017541","detach diamonds","Gemy" +"1466396023752","detach(diamonds)","Gemy" +"1466396033165","attach diamonds","Gemy" +"1466396040580","attach(diamonds)","Gemy" +"1466396048950","plot ( x = carat, y = price)","Gemy" +"1466396081702","qlot ( x= carat, y = price, data = diamonds)","Gemy" +"1466396092704","qplot ( x= carat, y = price, data = diamonds)","Gemy" +"1466396115517","qplot ( x= carat, y = price, data = diamonds, margins = TRUE)","Gemy" +"1466396134817","qplot ( x= carat, y = price, data = diamonds, margins = TRUE, main = Diamond Data Plot","Gemy" +"1466396136451",")","Gemy" +"1466396161516","qlot ( x = log(carat, y = log(price), data = diamonds)","Gemy" +"1466396164457",")","Gemy" +"1466396170598","qplot ( x = log(carat, y = log(price), data = diamonds)","Gemy" +"1466396172590",")","Gemy" +"1466396184947","qplot(x = log(carat), y = log(price), data = diamonds)","Gemy" +"1466396248710","qplot ( carat, x*y*z, data = diamonds)","Gemy" +"1466396311707","ind1 <- with (diamonds, which (x*y*z > 3500))","Gemy" +"1466396322314","diamonds[ind1,]","Gemy" +"1466398023279","ind2 <- with(diamonds, which(carat ==2))","Gemy" +"1466398033923","diamonds[ind2,]","Gemy" +"1466398127486","set.seed (1410)","Gemy" +"1466398170204","dsmall <- diamonds[sample(nrow(diamonds), 100),]","Gemy" +"1466398181616","dsmall","Gemy" +"1466398210578","qplot(carat, price, data = dsmall, colot = color)","Gemy" +"1466398218620","qplot(carat, price, data = dsmall, color = color)","Gemy" +"1466398242467","qplot(carat, price, data = dsmall, shape = cut )","Gemy" +"1466398259928","qplot(carat, price, data = dsmall, color = color, shape =cut)","Gemy" +"1466398275377","qplot(carat, price, data = dsmall, size = color)","Gemy" +"1466398301287","qplot(carat, price, data = diamonds, alpha = I(1/10))","Gemy" +"1466398327881","qplot(carat, price, data = diamonds, alpha = I(1/100))","Gemy" +"1466400086461","qplot (carat, price, data = dsmall, geom = c(point, smooth))","Gemy" +"1466400238435","qplot(carat, price, data = diamonds, geom = c(point, smooth))","Gemy" +"1466400262860","qplot(carat, price, data = dsmall) + stat_smooth(method = loess,","Gemy" +"1466400262861","span = .2)","Gemy" +"1466400268263","qplot(carat, price, data = dsmall) + stat_smooth(method = loess,","Gemy" +"1466400268264","span = 1)","Gemy" +"1466400281063","library(mgcv)","Gemy" +"1466400294752","qplot(carat, price, data = dsmall) + stat_smooth(method = gam,","Gemy" +"1466400294752","formula = y ~ s(x), size = 1)","Gemy" +"1466400303670","qplot(carat, price, data = diamonds) + stat_smooth(method = gam,","Gemy" +"1466400303671","formula = y ~ s(x), size = 1)","Gemy" +"1466400319108","qplot(carat, price, data = diamonds) + stat_smooth(method = lm)","Gemy" +"1466400327783","qplot(carat, price, data = diamonds) + stat_smooth(method = lm,","Gemy" +"1466400327784","formula = y ~ poly(x, 2, raw = TRUE))","Gemy" +"1466400388198","qplot(carat, price, data = diamonds) + stat_smooth(method = lm, formula = y ~ poly(x, 2, raw = TRUE))","Gemy" +"1466400397843","qplot(carat, price, data = diamonds) + stat_smooth(method = lm,","Gemy" +"1466400397845","formula = y ~ poly(x, 3, raw = TRUE))","Gemy" +"1466400415049","","Gemy" +"1466400415050","library(splines)","Gemy" +"1466400424471","qplot(carat, price, data = diamonds) + stat_smooth(method = lm,","Gemy" +"1466400424473","formula = y ~ ns(x, 5))","Gemy" +"1466400454248","qplot(color, price/carat, data = diamonds, geom = point,","Gemy" +"1466400454248","alpha = I(1/10))","Gemy" +"1466400464999","qplot(color, price/carat, data = diamonds, geom = jitter,","Gemy" +"1466400465000","alpha = I(1/10))","Gemy" +"1466400473443","qplot(color, price/carat, data = diamonds, geom = jitter,","Gemy" +"1466400473444","alpha = I(1/100))","Gemy" +"1466400482262","qplot(color, price/carat, data = diamonds, geom = boxplot,","Gemy" +"1466400482262","alpha = I(1/10))","Gemy" +"1466400490755","qplot(carat, data = diamonds, geom = density)","Gemy" +"1466400495980","qplot(carat, data = diamonds, geom = histogram)","Gemy" +"1466400502937","qplot(carat, data = diamonds, geom = histogram, binwidth = 1)","Gemy" +"1466400503236","qplot(carat, data = diamonds, geom = histogram, binwidth = .1)","Gemy" +"1466400503661","qplot(carat, data = diamonds, geom = histogram, binwidth = .01)","Gemy" +"1466400519056","qplot(carat, data = diamonds, geom = density, color = color)","Gemy" +"1466400524153","qplot(carat, data = diamonds, geom = histogram, fill = color)","Gemy" +"1466400636244","qplot(color, data = diamonds, geom = bar)","Gemy" +"1466400645471","(tab1 <- table(diamonds$color))","Gemy" +"1466400655714","qplot(levels(diamonds$color), geom = bar,","Gemy" +"1466400655714","weight = as.numeric(tab1), xlab = color)","Gemy" +"1466400664935","?economics","Gemy" +"1466400665015","str(economics)","Gemy" +"1466400665037","data(economics)","Gemy" +"1466400677036","qplot(date, unemploy / pop, data = economics, geom = line,","Gemy" +"1466400677037","ylab = Unemployment Rate)","Gemy" +"1466400682888","qplot(date, uempmed, data = economics, geom = line,","Gemy" +"1466400682889","ylab = Median Number of Weeks Unemployed)","Gemy" +"1466400749363","qplot(carat, data = diamonds, facets = color ~ .,","Gemy" +"1466400749373","geom = histogram, binwidth = .1, xlim = c(0,3))","Gemy" +"1466400757932","qplot(carat, data = diamonds, facets = . ~ color,","Gemy" +"1466400757933","geom = histogram, binwidth = .1, xlim = c(0,3))","Gemy" +"1466400765655","qplot(carat, data = diamonds, facets = color ~ cut,","Gemy" +"1466400765655","geom = histogram, binwidth = .1, xlim = c(0,3))","Gemy" +"1466400776640","qplot(carat, ..density.., data = diamonds, facets = color ~ .,","Gemy" +"1466400776640","geom = histogram, binwidth = .1, xlim = c(0,3))","Gemy" +"1466400783989","q1 <- qplot(carat, price, facets = color ~ ., data = diamonds)","Gemy" +"1466400861302","q1 + stat_smooth(method = lm,","Gemy" +"1466400861304","formula = y ~ ns(x, 5))","Gemy" +"1466400887891","(p <- ggplot(diamonds, aes(carat, price)))","Gemy" +"1466400909387","p + layer(geom = point, stat = identity, position = identity)","Gemy" +"1466400924939","p + layer(geom = point, stat = identity, position = identity) +","Gemy" +"1466400924940","facet_wrap( ~ cut)","Gemy" +"1466400933941","p + layer(geom = point, stat = identity, position = identity) +","Gemy" +"1466400933942","facet_wrap( ~ cut) + geom_point(aes(color = cut))","Gemy" +"1466400949249","p + layer(geom = point, stat = identity, position = identity) +","Gemy" +"1466400949250","facet_wrap( ~ cut) + geom_point(aes(color = color))","Gemy" +"1466400999647","p2 <- ggplot(diamonds, aes(x = carat))","Gemy" +"1466400999651","p2 <- p2 + layer(","Gemy" +"1466400999652","geom = bar,","Gemy" +"1466400999652","stat = bin,","Gemy" +"1466400999652","params = list(binwidth = .2, fill = steelblue),","Gemy" +"1466400999653","position = identity","Gemy" +"1466400999653",")","Gemy" +"1466400999655","p2","Gemy" +"1466401006768","?Oxboys","Gemy" +"1466401006847","str(Oxboys)","Gemy" +"1466401006865","Oxboys[1","Gemy" +"20,]","","Gemy" +"1466401017490","p3 <- ggplot(Oxboys, aes(age, height)) + geom_line()","Gemy" +"1466401017495","p3","Gemy" +"1466401024684","p4 <- ggplot(Oxboys, aes(age, height, group = Subject)) +","Gemy" +"1466401024685","geom_line()","Gemy" +"1466401024689","p4","Gemy" +"1466401034549","p4 + geom_smooth(aes(group = Subject), method = lm, se = F)","Gemy" +"1466401038910","p4 + geom_smooth(aes(group = Subject), method = lm, se = F,","Gemy" +"1466401038911","size =.5)","Gemy" +"1466401043301","p4 + geom_smooth(aes(group = 1), method = lm, se = F)","Gemy" +"1466401047436","p4 + geom_smooth(aes(group = 1), method = lm, se = F, size = 2)","Gemy" +"1466401052834","ggplot(diamonds, aes(clarity)) +","Gemy" +"1466401052834","geom_bar()","Gemy" +"1466401059545","ggplot(diamonds, aes(clarity, color = cut)) +","Gemy" +"1466401059550","geom_bar(position = stack)","Gemy" +"1466401064806","ggplot(diamonds, aes(clarity, color = cut)) +","Gemy" +"1466401064807","geom_bar(position = dodge)","Gemy" +"1466401073480","ggplot(diamonds, aes(clarity, color = cut)) +","Gemy" +"1466401073480","geom_bar(position = fill)","Gemy" +"1466401078918","d <- ggplot(diamonds, aes(carat)) + xlim(0,3)","Gemy" +"1466401078920","d + stat_bin(aes(ymax = ..count..), binwidth = .1, geom = area)","Gemy" +"1466401079271","d + stat_bin(aes(size = ..density..), binwidth = .1,","Gemy" +"1466401079271","geom = point, position = identity)","Gemy" +"1466436570389","?economics","Gemy" +"1466436576292","str(economics)","Gemy" +"1466436628086","","Gemy" +"1466436628087","qplot(date, unemploy / pop, data = economics, geom = line,","Gemy" +"1466436628088","ylab = Unemployment Rate)","Gemy" +"1466436628390","","Gemy" +"1466436628390","qplot(date, uempmed, data = economics, geom = line,","Gemy" +"1466436628391","ylab = Median Number of Weeks Unemployed)","Gemy" +"1466436670740","qplot(carat, data = diamonds, facets = color ~ .,","Gemy" +"1466436670741","geom = histogram, binwidth = .1, xlim = c(0,3))","Gemy" +"1466436681188","qplot(carat, data = diamonds, facets = . ~ color,","Gemy" +"1466436681189","geom = histogram, binwidth = .1, xlim = c(0,3))","Gemy" +"1466436727342","qplot(carat, data = diamonds, facets = color ~ cut, geom = histogram, binwidth = .1, xlim = c(0,3))","Gemy" +"1466436779941","str(diamonds)","Gemy" +"1466436799562","qplot(carat, ..density.., data = diamonds, facets = color ~ .,","Gemy" +"1466436799563","geom = histogram, binwidth = .1, xlim = c(0,3))","Gemy" +"1466436822681","qplot(carat, ..density. ., data = diamonds, facets = color ~ .,","Gemy" +"1466436822685","geom = histogram, binwidth = .1, xlim = c(0,3))","Gemy" +"1466436830735","qplot(carat, ..density.., data = diamonds, facets = color ~ .,","Gemy" +"1466436830736","geom = histogram, binwidth = .1, xlim = c(0,3))","Gemy" +"1466436834765","q1 <- qplot(carat, price, facets = color ~ ., data = diamonds)","Gemy" +"1466436896103","q1 + stat_smooth(method = lm,","Gemy" +"1466436896110","formula = y ~ ns(x, 5))","Gemy" +"1466436925360","q1 <- qplot(carat, price, facets = color ~ ., data = diamonds)","Gemy" +"1466437025371","library(nlme)","Gemy" +"1466437034417","library(splines)","Gemy" +"1466437125307","q1 + stat_smooth(method = lm)","Gemy" +"1466437159381","q1 + stat_smooth(method = lm,","Gemy" +"1466437159387","formula = y ~ ns(x, 2))","Gemy" +"1466437302743","q1 + stat_smooth(method = lm,","Gemy" +"1466437302749","formula = y ~ poly(x, degree = 2, raw = TRUE)","Gemy" +"1466437318305",")","Gemy" +"1466437479838","q1 + stat_smooth(method = lm,","Gemy" +"1466437479844","formula = y ~ poly(x, degree = 2, raw = TRUE, color =red)","Gemy" +"1466437498254",")","Gemy" +"1466437586590","q1 + stat_smooth(method = lm,","Gemy" +"1466437586595","formula = y ~ ns(x, 5), col = blue)","Gemy" +"1466437601368","q1 + stat_smooth(method = lm,","Gemy" +"1466437601369","formula = y ~ ns(x, 2), col = red)","Gemy" +"1466437634478","> q1 + stat_smooth(method = lm,","Gemy" +"1466437634479","formula = y ~ poly(x, degree = 2, raw = TRUE, col =red)","Gemy" +"1466437643517","q1 + stat_smooth(method = lm,","Gemy" +"1466437643519","formula = y ~ poly(x, degree = 2, raw = TRUE, col =red)","Gemy" +"1466437645968",")","Gemy" +"1466437856136","?ns","Gemy" +"1466438132799","p + layer(geom = point, stat = identity, position = identity) +","Gemy" +"1466438132805","facet_wrap( ~ cut)","Gemy" +"1466438360357","p2 <- ggplot(diamonds, aes(x = carat))","Gemy" +"1466438360380","p2 <- p2 + layer(","Gemy" +"1466438360381","geom = bar,","Gemy" +"1466438360382","stat = bin,","Gemy" +"1466438360383","params = list(binwidth = .2, fill = steelblue),","Gemy" +"1466438360384","position = identity","Gemy" +"1466438360384",")","Gemy" +"1466438360404","p2","Gemy" +"1466438397386","?Oxboys","Gemy" +"1466438404824","str(Oxboys)","Gemy" +"1466438435462","Oxboys[1","Gemy" +"20,]","","Gemy" +"1466438685186","p3 <- ggplot(Oxboys, aes(age, height)) + geom_line()","Gemy" +"1466438685376","p3","Gemy" +"1466438826662","p4 <- ggplot(Oxboys, aes(age, height, group = Subject)) +","Gemy" +"1466438826668","geom_line()","Gemy" +"1466438826674","p4","Gemy" +"1466438899210","p4 + geom_smooth(aes(group = Subject), method = lm, se = F)","Gemy" +"1466438994498","p4 + geom_smooth(aes(group = 1), method = lm, se = F, size = 2)","Gemy" +"1466439123233","ggplot(diamonds, aes(clarity)) +","Gemy" +"1466439123239","geom_bar()","Gemy" +"1466439144804","ggplot(diamonds, aes(clarity, color = cut)) +","Gemy" +"1466439144810","geom_bar(position = stack)","Gemy" +"1466439209083","","Gemy" +"1466439209088","ggplot(diamonds, aes(clarity, color = cut)) +","Gemy" +"1466439209090","geom_bar(position = dodge)","Gemy" +"1466439359670","ggplot(diamonds, aes(clarity, color = cut)) +","Gemy" +"1466439359671","geom_bar(position = fill)","Gemy" +"1466441605428","body_temp <- read.table(file = http://www.amstat.org/publications/jse/datasets/normtemp.dat.txt,","Gemy" +"1466441605445","header = FALSE, sep = )","Gemy" +"1466441605795","body_temp","Gemy" +"1466441650396","hist(body_temp[,1], freq = FALSE)","Gemy" +"1466441656095","lines(density(body_temp[,1]), lwd = 3, col = blue)","Gemy" +"1466441656110","range(body_temp[,1])","Gemy" +"1466441711194","xfit <- seq(95, 103, length = 100)","Gemy" +"1466441711200","yfit <- dnorm(xfit, mean = mean(body_temp[,1]), sd = sd(body_temp[,1]))","Gemy" +"1466441717966","lines(xfit, yfit, col = red, lwd = 3)","Gemy" +"1466441717971","legend(x = topright, legend = c(Kernel Density, Normal Curve),","Gemy" +"1466441717972","fill = c(blue, red))","Gemy" +"1466441849450","","Gemy" +"1466441849455","qqnorm(body_temp[,1])","Gemy" +"1466441849499","","Gemy" +"1466441849499","qqline(body_temp[,1])","Gemy" +"1466441908857","","Gemy" +"1466441908863","qqnorm(body_temp[,1]) ","Gemy" +"1466441908923","","Gemy" +"1466441908924","qqline(body_temp[,1])","Gemy" +"1466442013070","(obs <- quantile(body_temp[,1], probs = seq(0.025, 0.975, .025)))","Gemy" +"1466442013081","(nrml <- qnorm(seq(0.025, .975, .025)))","Gemy" +"1466442013082","plot(nrml, obs)","Gemy" +"1466442070134","shapiro.test(body_temp[,1])","Gemy" +"1466442070146","","Gemy" +"1466442070146","ks.test(x = body_temp[,1],","Gemy" +"1466442070147","y = pnorm,","Gemy" +"1466442070147","mean = mean(body_temp[,1]),","Gemy" +"1466442070148","sd = sd(body_temp[,1]))","Gemy" +"1466442086669","(t1 <- t.test(body_temp[,1], mu = 98.6, alternative = two.sided))","Gemy" +"1466442086678","attributes(t1)","Gemy" +"1466442086684","","Gemy" +"1466442086686","t1$conf.int","Gemy" +"1466442370792","","Gemy" +"1466442370793","library(coin)","Gemy" +"1466442370796","bt <- data.frame(body_temp)","Gemy" +"1466442370802","independence_test(V1 ~ factor(V2), data = bt, distribution = exact())","Gemy" +"1466442419493","pre <- c(18, 21, 16, 22, 19 ,24 ,17 ,21 ,23 ,18 ,","Gemy" +"1466442419494","14 ,16 ,16 ,19 ,18 ,20 ,12 ,22 ,15 ,17)","Gemy" +"1466442419499","post <- c(22, 25, 17, 24, 16, 29 ,20, 23, 19, 20,","Gemy" +"1466442419499","15, 15, 18, 26, 18, 24, 18, 25, 19, 16)","Gemy" +"1466442426490","(diffs <- post - pre)","Gemy" +"1466442426492","hist(diffs, 10)","Gemy" +"1466442426538","qqnorm(diffs)","Gemy" +"1466442426748","qqline(diffs)","Gemy" +"1466442430395","(t2 <- t.test(diffs, mu = 0, alternative = two.sided))","Gemy" +"1466442666736","load(~/Documents/Intro to R /ecls.Rdata)","Gemy" +"1466442674598","str(ecls)","Gemy" +"1466442784662","mean(ecls$C6R4MSCL)","Gemy" +"1466442794628","wilcox.test(ecls$C6R4MSCL, alternative =greater, mu = 120.7)","Gemy" +"1466442811522","median(ecls$C6R4MSCL)","Gemy" +"1466442830098","wilcox.test(ecls$C6R4MSCL, alternative =greater, mu = 118)","Gemy" +"1466442900532","(t1 <- t.test(ecls$C6R4MSCL, mu = 118, alternative = greater))","Gemy" +"1466442900539","attributes(t1)","Gemy" +"1466562169202","str(datafinal)","Gemy" +"1466562202378","read.csv(datafinal.csv)","Gemy" +"1466562217414","getwd()","Gemy" +"1466562221767","setwd(dir = /Users/Gemy/Documents/Intro to R /)","Gemy" +"1466562252886","datafinal <- read.csv(top800.csv)","Gemy" +"1466562254913","View(datafinal)","Gemy" +"1466562301949","dat <- read.csv(top800.csv)","Gemy" +"1466562471715","str(dat)","Gemy" +"1466562474622","table(dat)","Gemy" +"1466562484315","table(dat$world_rank)","Gemy" +"1466562616397","mydata2 = read.csv(timesData 2.csv)","Gemy" +"1466562616478","mydata2","Gemy" +"1466562616782","mydata2 <- data.frame(mydata2)","Gemy" +"1466562616783","mydata2","Gemy" +"1466562621550","View(mydata2)","Gemy" +"1466562636087","summary(mydata2)","Gemy" +"1466562696466","which(mydata2$year = 2016)","Gemy" +"1466562701881","which(mydata2$year == 2016)","Gemy" +"1466563071499","dat <- read.csv(top800.csv)","Gemy" +"1466563071540","head(dat)","Gemy" +"1466563071551","dat$university_name <- as.character(dat$university_name)","Gemy" +"1466563071553","str(dat)","Gemy" +"1466563071582","","Gemy" +"1466563071583","library(mice)","Gemy" +"1466563073669","md.pattern(dat)","Gemy" +"1466563073671","","Gemy" +"1466563073671","dat <-na.omit(dat)","Gemy" +"1466563073673","head(dat)","Gemy" +"1466563073680","library(car)","Gemy" +"1466563074476","","Gemy" +"1466563074477","dat$Region <- recode(dat$country, c('Thailand','South Korea', +1466563074477:'Singapore', 'Taiwan', 'Indonesia', 'Bangladesh','China', +1466563074477:'Hong Kong','India','Iran','Israel','Japan','Lebanon','Macau', +1466563074478:'Malaysia','Oman','Pakistan','Qatar','Russian Federation','Turkey', +1466563074478:'Saudi Arabia','United Arab Emirates','Jordan') = 'Asia'; +1466563074478:c('Argentina', 'Brazil','Chile', 'Colombia') = 'South America'; +1466563074479:c('Australia','New Zealand') = 'Oceania'; +1466563074479:c('Austria','Belarus', 'Belgium', 'United Kingdom', 'Switzerland','Cyprus', 'Czech Republic', +1466563074479:'Denmark','Estonia','Finland','France', 'Germany','Greece', 'Hungary', 'Iceland','Italy', +1466563074480:'Latvia','Lithuania', 'Luxembourg','Netherlands','Norway', 'Poland', 'Portugal', 'Spain', +1466563074480:'Sweden','Republic of Ireland','Romania','Serbia','Slovakia','Slovenia','Ukraine') ='Europe'; +1466563074480:c('Canada', 'United States of America','Mexico') ='North America'; +1466563074481:c('South Africa', 'Uganda','Egypt','Ghana','Kenya','Morocco','Nigeria' ) = 'Africa')","Gemy" +"1466563074489","table(dat$Region)","Gemy" +"1466563084627","dat$int_stud <- international_students*100","Gemy" +"1466563084632","head(dat)","Gemy" +"1466563132417","which(mydata2$year == 2016)","Gemy" +"1466563156371","write.csv(dat_GP, file =dat_GP.csv)","Gemy" +"1466563174058","write.csv(dat, file =dat.csv)","Gemy" +"1466563183052","str(dat)","Gemy" +"1466563409104","View(dat)","Gemy" +"1466563453086","attach(dat)","Gemy" +"1466563460649","table(world_rank)","Gemy" +"1466563472445","table(country)","Gemy" +"1466563491199","summary(teaching)","Gemy" +"1466563503882","summary(international)","Gemy" +"1466563569708","getwd","Gemy" +"1466563572955","getwd()","Gemy" +"1466563618850","save(/Users/Gemy/Documents/Intro to R/finaldat.Rdata )","Gemy" +"1466563803150","savehistory(history.Rhistory)","Gemy" +"1466563843949","loadhistory(history.Rhistory)","Gemy" +"1466563932050","table(international_students)","Gemy" +"1466563978083","table(research)","Gemy" +"1466564002473","summary(total_score)","Gemy" +"1466564015801","summary()","Gemy" +"1466564019127","summary(dat)","Gemy" +"1466564070347","which(income == -)","Gemy" +"1466564157450","dat$rc_income <- dat$income","Gemy" +"1466564163495","table(rc_income)","Gemy" +"1466564173395","table(dat$rc_income)","Gemy" +"1466564201443","which(income == -) <- NA","Gemy" +"1466564220385","?assign","Gemy" +"1466564297284","which(income == -)","Gemy" +"1466564350911","dat$rc_income[which(income == -)] <- NA","Gemy" +"1466564362585","table(dat$rc_income)","Gemy" +"1466564389323","md.pattern(dat$income)","Gemy" +"1466564507365","dat$tscore <- dat$total_score","Gemy" +"1466564524581","dat$tscore[which(dat$tscore == -)] <- NA","Gemy" +"1466564605142","head(dat)","Gemy" +"1466564642958","is.na(dat$tscore)","Gemy" +"1466564658442","is.na$rc_income","Gemy" +"1466564663960","is.na$dat$rc_income","Gemy" +"1466564672548","is.na(dat$rc_income)","Gemy" +"1466564720020","summary(dat)","Gemy" +"1466564749697","is.na(dat$female_male_ratio.1)","Gemy" +"1466564810107","dat$female_male_ratio.1[which(dat$female_male_ratio == )] <- NA","Gemy" +"1466564818235","is.na(dat$female_male_ratio.1)","Gemy" +"1466564880900","table(dat$female_male_ratio)","Gemy" +"1466564904808","attach(dat)","Gemy" +"1466564930866","which(female_male_ratio == 24/76)","Gemy" +"1466564941201","which(female_male_ratio == 26/74)","Gemy" +"1466564951363","which(female_male_ratio == 27/73)","Gemy" +"1466564958873","24/76","Gemy" +"1466564990144","female_male_ratio[which(female_male_ratio == 27/73)] <- 27/73","Gemy" +"1466565016498","female_male_ratio <- as.numeric(female_male_ratio)","Gemy" +"1466565020164","female_male_ratio[which(female_male_ratio == 27/73)] <- 27/73","Gemy" +"1466565033206","female_male_ratio[which(female_male_ratio == 26/74)] <- 26/74","Gemy" +"1466565048354","female_male_ratio[which(female_male_ratio == 24/76)] <- 24/76","Gemy" +"1466565120256","summary(female_male_ratio)","Gemy" +"1466565157601","table(dat$female_male_ratio)","Gemy" +"1466565205006","27/73","Gemy" +"1466565220984","24/76","Gemy" +"1466565236271","26/74","Gemy" +"1466565246680","female_male_ratio[which(female_male_ratio == 27/73)] <- 0.3698","Gemy" +"1466565246682","female_male_ratio[which(female_male_ratio == 26/74)] <- 0.3514","Gemy" +"1466565246687","female_male_ratio[which(female_male_ratio == 24/76)] <- 0.3158","Gemy" +"1466565273825","32/68","Gemy" +"1466565283427","female_male_ratio[which(female_male_ratio == 32/68)] <- 0.4706","Gemy" +"1466565290423","table(dat$female_male_ratio)","Gemy" +"1466565339688","str(female_male_ratio)","Gemy" +"1466565364062","head(female_male_ratio)","Gemy" +"1466565371368","head(dat)","Gemy" +"1466565409496","str(female_male_ratio)","Gemy" +"1466565471563","dat <- read.csv( dat.csv)","Gemy" +"1466565482096","View(dat)","Gemy" +"1466565492077","str(dat)","Gemy" +"1466565527882","attach(dat)","Gemy" +"1466565548893","which(dat$income == -)","Gemy" +"1466565548900","dat$rc_income <- dat$income","Gemy" +"1466565548901","dat$rc_income[which(income == -)] <- NA","Gemy" +"1466565548902","dat$tscore <- dat$total_score","Gemy" +"1466565548903","dat$tscore[which(dat$tscore == -)] <- NA","Gemy" +"1466565554450","is.na(dat$tscore)","Gemy" +"1466565554464","is.na(dat$rc_income)","Gemy" +"1466565554472","dat$female_male_ratio.1[which(dat$female_male_ratio == )] <- NA","Gemy" +"1466565588659","write.csv(dat, file =dat.csv)","Gemy" +"1466565599987","head(dat)","Gemy" +"1466565657134","min(female_male_ratio)","Gemy" +"1466565665248","table(female_male_ratio)","Gemy" +"1466565701466","table(dat$female_male_ratio)","Gemy" +"1466565710529","str(dat)","Gemy" +"1466565757632","head(data)","Gemy" +"1466565775734","dat <- read.csv( dat.csv)","Gemy" +"1466565778366","View(dat)","Gemy" +"1466565802158","str(dat$female_male_ratio)","Gemy" +"1466566056973","dat <- read.csv( dat.csv)","Gemy" +"1466566061111","View(dat)","Gemy" +"1466566073386","str(dat)","Gemy" +"1466566114194","na.omit(dat)","Gemy" +"1466566145281","dat1 <-na.omit(dat)","Gemy" +"1466566149223","View(dat1)","Gemy" +"1466566187022","md.pattern(dat)","Gemy" +"1466566292168","str(dat)","Gemy" +"1466566304492","dim(dat$citations)","Gemy" +"1466566332128","install.packages(gmodels)","Gemy" +"1466566338944","library(gmodels)","Gemy" +"1466566360667","CrossTable(dat$world_rank, dat$research)","Gemy" +"1466566520615","dat$genderbal <- NA","Gemy" +"1466566690285","dat$genderbal <- factor(dat$genderbal, levels = c(More Female,Balance, More Male, ordered = FALSE)","Gemy" +"1466566692303",")","Gemy" +"1466566775908","summary(dat$female_male_ratio)","Gemy" +"1466567968482","dat <- read.csv( dat.csv)","Gemy" +"1466567975938","str(dat)","Gemy" +"1466567985124","summary(dat$female_male_ratio)","Gemy" +"1466568041021","View(dat)","Gemy" +"1466568424631","range(dat$student_staff_ratio)","Gemy" +"1466568804124","install.packages(ggplot2)","Gemy" +"1466568807664","library(ggplot2)","Gemy" +"1466568836041","names(Dat)","Gemy" +"1466568839262","names(dat)","Gemy" +"1466568885476","qlot(x = dat$research, y = dat$teaching)","Gemy" +"1466568897973","qplot(x = dat$research, y = dat$teaching, data = dat)","Gemy" +"1466568961928","qplot(x = dat$research, y = dat$teaching, data = dat, main = Research and Teaching","Gemy" +"1466568969660",", margins = TRUE)","Gemy" +"1466579872516","qplot(x = dat$female_male_ratio, y = dat$teaching, data = dat, main = Research and Teaching","Gemy" +"1466579874508",")","Gemy" +"1466583310869","summary(mydata2)","Gemy" +"1466583317884","mydata2 = read.csv(timesData 2.csv)","Gemy" +"1466583317977","mydata2","Gemy" +"1466583325036","summary(mydata2)","Gemy" +"1466584056413","table(dat$Region)","Gemy" +"1466584131047","names(dat)","Gemy" +"1466585285529","hist(dat$world_rank)","Gemy" +"1466585428656","hist(dat$Region)","Gemy" +"1466586160798","tab1 <- table(dat$Region)","Gemy" +"barplot(height = tab1, xlab = Region, ylab = Frequency,","","Gemy" +" main = Region Distribution in Top 800,","","Gemy" +" legend = rownames(tab1) )","","Gemy" +"1466586191368","hist(dat$int_stud, breaks =brks,","Gemy" +"1466586191370","xlab = Percentage of International Students,","Gemy" +"1466586191370","main = Percentage of International Students ,","Gemy" +"1466586191371","freq = TRUE)","Gemy" +"1466586217331","dat$int_stud <- international_students*100","Gemy" +"1466586217337","head(dat)","Gemy" +"1466586249627","hist(dat$int_stud, breaks =brks,","Gemy" +"1466586249628","xlab = Percentage of International Students,","Gemy" +"1466586249632","main = Percentage of International Students ,","Gemy" +"1466586249633","freq = TRUE)","Gemy" +"1466586249634","d1 <- density(dat$int_stud)","Gemy" +"1466586249649","plot(d1, xlab = Percentage of International Students,","Gemy" +"1466586249650","main = Kernel Density Plot of Percentage of International Students )","Gemy" +"1466586296979","tab1 <- table(dat$Region)","Gemy" +"1466586296985","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1466586296985","main = Region Distribution in Top 800,","Gemy" +"1466586296986","legend = rownames(tab1),","Gemy" +"1466586296986","col = c(red,green,blue,gray,yellow,cyan) )","Gemy" +"1466586306621","tab1 <- table(dat$Region)","Gemy" +"1466586306623","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1466586306626","main = Region Distribution in Top 800,","Gemy" +"1466586306627","legend = rownames(tab1))","Gemy" +"1466586336804","tab1 <- table(dat$Region)","Gemy" +"1466586336810","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1466586336810","main = Distribution of Regions in Top 800,","Gemy" +"1466586336811","legend = rownames(tab1),","Gemy" +"1466586336811","col = color)","Gemy" +"1466586349829","tab1 <- table(dat$Region)","Gemy" +"1466586349835","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1466586349836","main = Distribution of Regions in Top 800,","Gemy" +"1466586349836","legend = rownames(tab1),","Gemy" +"1466586349837","col = color)","Gemy" +"1466586395517","tab1 <- table(dat$Region)","Gemy" +"1466586395523","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1466586395523","main = Region Distribution in Top 800,","Gemy" +"1466586395524","legend = rownames(tab1),","Gemy" +"1466586395524","col = c(tomato )","Gemy" +"1466586398091",")","Gemy" +"1466586441656","tab1 <- table(dat$Region)","Gemy" +"1466586441658","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1466586441658","main = Region Distribution in Top 800,","Gemy" +"1466586441659","col = c(tomato ))","Gemy" +"1466587143753","tab1 <- table(dat$Region)","Gemy" +"1466587143762","barplot(height = tab1, xlab = Region, ylab = Frequency,","Gemy" +"1466587143762","main = Distribution of Regions in Top 800,","Gemy" +"1466587143763","col = c(tomato ))","Gemy" +"1466587363597","hist(dat$int_stud)","Gemy" +"1466587597219","hist(dat$student_staff_ratio, breaks =brks1,","Gemy" +"1466587597225","xlab = Student - Staff Ratio,","Gemy" +"1466587597225","main = Distribution of Student -Staff Ratio ,","Gemy" +"1466587597226","freq = TRUE)","Gemy" +"1466587597227","d3 <- density(dat$student_staff_ratio)","Gemy" +"1466587597229","lines(d3, col = blue, lwd =3)","Gemy" +"1466587615986","range(dat$student_staff_ratio)","Gemy" +"1466587615987","brks1 <- seq(0.6, 162.6, 6)","Gemy" +"1466587615988","hist(dat$student_staff_ratio, breaks =brks1,","Gemy" +"1466587615988","xlab = Student - Staff Ratio,","Gemy" +"1466587615989","main = Distribution of Student -Staff Ratio ,","Gemy" +"1466587615989","freq = TRUE)","Gemy" +"1466587616015","d3 <- density(dat$student_staff_ratio)","Gemy" +"1466587616017","lines(d3, col = blue, lwd =3)","Gemy" +"1466587649345","range(dat$female_male_ratio)","Gemy" +"1466587681283","hist(dat$female_male_ratio)","Gemy" +"1466587738689","brks3 <- seq(0.0, 4, 0.2)","Gemy" +"1466587770457","hist(dat$female_male_ratio, breaks =brks3,","Gemy" +"1466587770462","xlab = Female-to- Male Ratio,","Gemy" +"1466587770462","main = Distribution of Female-Male Ratio ,","Gemy" +"1466587770463","freq = TRUE)","Gemy" +"1466587782729","brks3 <- seq(0.0, 3, 0.2)","Gemy" +"1466587782734","hist(dat$female_male_ratio, breaks =brks3,","Gemy" +"1466587782735","xlab = Female-to- Male Ratio,","Gemy" +"1466587782735","main = Distribution of Female-Male Ratio ,","Gemy" +"1466587782735","freq = TRUE)","Gemy" +"1466587793616","brks3 <- seq(0.0, 3.5, 0.2)","Gemy" +"1466587793617","hist(dat$female_male_ratio, breaks =brks3,","Gemy" +"1466587793621","xlab = Female-to- Male Ratio,","Gemy" +"1466587793622","main = Distribution of Female-Male Ratio ,","Gemy" +"1466587793622","freq = TRUE)","Gemy" +"1466587800402","brks3 <- seq(0.0, 3.7, 0.2)","Gemy" +"1466587800404","hist(dat$female_male_ratio, breaks =brks3,","Gemy" +"1466587800407","xlab = Female-to- Male Ratio,","Gemy" +"1466587800408","main = Distribution of Female-Male Ratio ,","Gemy" +"1466587800409","freq = TRUE)","Gemy" +"1466587871111","range(dat$student_staff_ratio)","Gemy" +"1466587871112","brks1 <- seq(0.6, 162.6, 12)","Gemy" +"1466587871113","hist(dat$student_staff_ratio, breaks =brks1,","Gemy" +"1466587871114","xlab = Student - Staff Ratio,","Gemy" +"1466587871114","main = Distribution of Student -Staff Ratio ,","Gemy" +"1466587871115","freq = TRUE)","Gemy" +"1466587880166","range(dat$student_staff_ratio)","Gemy" +"1466587880171","brks1 <- seq(0.6, 162.6, 8)","Gemy" +"1466587880172","hist(dat$student_staff_ratio, breaks =brks1,","Gemy" +"1466587880172","xlab = Student - Staff Ratio,","Gemy" +"1466587880172","main = Distribution of Student -Staff Ratio ,","Gemy" +"1466587880173","freq = TRUE)","Gemy" +"1466587888875","range(dat$student_staff_ratio)","Gemy" +"1466587888877","brks1 <- seq(0.6, 162.6, 12)","Gemy" +"1466587888881","hist(dat$student_staff_ratio, breaks =brks1,","Gemy" +"1466587888881","xlab = Student - Staff Ratio,","Gemy" +"1466587888882","main = Distribution of Student -Staff Ratio ,","Gemy" +"1466587888882","freq = TRUE)","Gemy" +"1466587906828","range(dat$student_staff_ratio)","Gemy" +"1466587906833","brks1 <- seq(0.6, 162.6, 6)","Gemy" +"1466587906834","hist(dat$student_staff_ratio, breaks =brks1,","Gemy" +"1466587906834","xlab = Student - Staff Ratio,","Gemy" +"1466587906835","main = Distribution of Student -Staff Ratio ,","Gemy" +"1466587906835","freq = TRUE)","Gemy" +"1466588192997","color()","Gemy" +"1466588200548","colors","Gemy" +"1466588206909","palette()","Gemy" +"1466588222027","colors()","Gemy" +"1466588255488","range(dat$student_staff_ratio)","Gemy" +"1466588255489","brks1 <- seq(0.6, 162.6, 6)","Gemy" +"1466588255491","hist(dat$student_staff_ratio, breaks =brks1,","Gemy" +"1466588255491","xlab = Student - Staff Ratio,","Gemy" +"1466588255491","main = Distribution of Student -Staff Ratio ,","Gemy" +"1466588255492","freq = TRUE,","Gemy" +"1466588255492","col = siena)","Gemy" +"1466588275121","brks1 <- seq(0.6, 162.6, 6)","Gemy" +"1466588275126","hist(dat$student_staff_ratio, breaks =brks1,","Gemy" +"1466588275127","xlab = Student - Staff Ratio,","Gemy" +"1466588275127","main = Distribution of Student -Staff Ratio ,","Gemy" +"1466588275127","freq = TRUE,","Gemy" +"1466588275128","col = violetred1)","Gemy" +"1466588288942","hist(dat$student_staff_ratio, breaks =brks1,","Gemy" +"1466588288947","xlab = Student - Staff Ratio,","Gemy" +"1466588288947","main = Distribution of Student -Staff Ratio ,","Gemy" +"1466588288947","freq = TRUE,","Gemy" +"1466588288948","col = turquoise)","Gemy" +"1466588320181","hist(dat$female_male_ratio, breaks =brks3,","Gemy" +"1466588320186","xlab = Female-to- Male Ratio,","Gemy" +"1466588320186","main = Distribution of Female-Male Ratio ,","Gemy" +"1466588320187","freq = TRUE,","Gemy" +"1466588320187","col = turquoise)","Gemy" +"1466588672508","mean(dat$female_male_ratio)","Gemy" +"1466589026677","boxplot(dat$world_rank ~ dat$int_stud, xlab = Percentage of International Students, ylab = World +1466589026683:University Rank, main = Conditional Boxplots between Percentage of International Students and World Rank,","Gemy" +"1466589026683","col = tan2)","Gemy" +"1466589073923","qplot(dat$int_stud, world_rank, data = dat, color =tan2)","Gemy" +"1466589242167","qplot(dat$int_stud, world_rank, data = dat, geom =boxplot, color =tan2)","Gemy" +"1466589402094","qplot(dat$num_students, int_stud, data = dat, geom =boxplot, color =tan2)","Gemy" +"1466589412630","qplot(dat$num_students, int_stud, data = dat, color =tan2)","Gemy" +"1466589816599","table(dat$Region)","Gemy" +"1466590372543","sum(dat)","Gemy" +"1466590375676","summary(dat)","Gemy" +"1466590557261","library(pastecs)","Gemy" +"1466590563861","install.packages(pastecs)","Gemy" +"1466590573708","install.packages(pastecs)","Gemy" +"1466590581831","install.packages(pastecs)","Gemy" +"1466590589376","install.packages(pastecs)","Gemy" +"1466590602277","library(pastecs)","Gemy" +"1466590633102","stat.desc(dat)","Gemy" +"1466590665012","?stat.desc","Gemy" +"1466590898959","options(scipen=100)","Gemy" +"1466590898965","options(digits=2)","Gemy" +"1466590903030","stat.desc(dat)","Gemy" +"1466591283332","which(dat$female_male_ratio == Inf)","Gemy" +"1466591303583","dat$female_male_ratio==[736] <-NA","Gemy" +"1466591309411","dat$female_male_ratio[736] <-NA","Gemy" +"1466591318220","stat.desc(dat)","Gemy" +"1466592490250","table(dat$Region)","Gemy" +"1466592626089","dat$Af <- NA","Gemy" +"1466592660226","dat$Af[which(dat$Region ==Africa)] <- 1","Gemy" +"1466592671510","table(dat$Af)","Gemy" +"1466592690056","table(dat$Af) <-0","Gemy" +"1466592697954","dat$Af <- 0","Gemy" +"1466592705105","dat$Af[which(dat$Region ==Africa)] <- 1","Gemy" +"1466592713737","dat$Asia <- 0","Gemy" +"1466592720399","dat$Af[which(dat$Region ==Asia)] <- 1","Gemy" +"1466592729879","dat$Europe <- 0","Gemy" +"1466592735751","dat$Af[which(dat$Region ==Europe)] <- 1","Gemy" +"1466592745383","dat$NorthAm <- 0","Gemy" +"1466592783612","dat$NorthAm[which(dat$Region ==North America)] <-1","Gemy" +"1466592801824","dat$Asia[which(dat$Region ==Asia)] <- 1","Gemy" +"1466592814048","dat$Europe[which(dat$Region ==Europe)] <- 1","Gemy" +"1466592822652","dat$Africa <- 0","Gemy" +"1466592832926","dat$Africa[which(dat$Region ==Africa)] <- 1","Gemy" +"1466592849681","dat$Oceania <- 0","Gemy" +"1466592862071","dat$Oceania[which(dat$Region ==Oceania)] <- 1","Gemy" +"1466592870951","dat$SouthAm <- 0","Gemy" +"1466592883576","dat$SouthAm[which(dat$Region ==SouthAm)] <- 1","Gemy" +"1466592893549","table(dat$Asia)","Gemy" +"1466592904039","summary(dat)","Gemy" +"1466592945535","dat$SouthAm[which(dat$Region ==South America)] <- 1","Gemy" +"1466592952422","table(dat$SouthAm)","Gemy" +"1466592984473","stat.desp(dat)","Gemy" +"1466592994402","stat.desc(dat)","Gemy" +"1466593010740","rm(dat$Af)","Gemy" +"1466593103220","dat$Af <- NULL","Gemy" +"1466593200536","dat$Asia <- 0","Gemy" +"1466593200542","dat$Europe <- 0","Gemy" +"1466593200543","dat$Asia[which(dat$Region ==Asia)] <- 1","Gemy" +"1466593200544","dat$Europe[which(dat$Region ==Europe)] <- 1","Gemy" +"1466593200545","dat$Africa <- 0","Gemy" +"1466593200545","dat$Africa[which(dat$Region ==Africa)] <- 1","Gemy" +"1466593200546","dat$Oceania <- 0","Gemy" +"1466593200546","dat$Oceania[which(dat$Region ==Oceania)] <- 1","Gemy" +"1466593200547","dat$SouthAm <- 0","Gemy" +"1466593200548","dat$SouthAm[which(dat$Region ==South America)] <- 1","Gemy" +"1466593233512","head(dat)","Gemy" +"1466593291330","prop.table(dat$Region)","Gemy" +"1466593305251","prop.table(dat$Africa)","Gemy" +"1466593446313","table(dat$Region)","Gemy" +"1466593455403","13/790","Gemy" +"1466593469972","13/790 *100","Gemy" +"1466593499352","frequency(dat$Region)","Gemy" +"1466593597808","prop.table(dat$Region, 1)","Gemy" +"1466593619219","prop.table(table(dat$Region), 1)","Gemy" +"1466593626085","prop.table(table(dat$Region))","Gemy" +"1466593729020","attach(dat)","Gemy" +"1466593745251","chisq.test(citations, world_rank)","Gemy" +"1466593775534","chisq.test(female_male_ratio, world_rank)","Gemy" +"1466593799166","detach(dat)","Gemy" +"1466593821103","chisq.test(dat$citations, dat$world_rank)","Gemy" +"1466593889320","names(dat)","Gemy" +"1466593908561","chisq.test(teaching,world_rank)","Gemy" +"1466593937918","chisq.test(teaching,world_rank)","Gemy" +"1466593939586","chisq.test(teaching,world_rank)","Gemy" +"1466593940319","chisq.test(teaching,world_rank)write.csv(dat, file =dat.csv)","Gemy" +"1466593961428","names(dat)","Gemy" +"1466594055342","chisq.test(teaching,world_rank)","Gemy" +"1466594055889","chisq.test(citations,world_rank)","Gemy" +"1466594055997","chisq.test(international,world_rank)","Gemy" +"1466594056099","chisq.test(research,world_rank)","Gemy" +"1466594056172","chisq.test(num_students,world_rank)","Gemy" +"1466594056517","chisq.test(student-staff-ratio,world_rank)","Gemy" +"1466594056518","chisq.test(income,world_rank)","Gemy" +"1466594056583","chisq.test(int_)stud,world_rank)","Gemy" +"1466594056584","chisq.test(female_male_ratio,world_rank)","Gemy" +"1466594087941","chisq.test(int_stud,world_rank)","Gemy" +"1466594087947","chisq.test(female_male_ratio,world_rank)","Gemy" +"1466594104299","names()","Gemy" +"1466594109046","names(dat)","Gemy" +"1466594124358","chisq.test(int_stud , world_rank)","Gemy" +"1466594124359","chisq.test(female_male_ratio,world_rank)","Gemy" +"1466594143689","chisq.test(dat$int_stud , dat$world_rank)","Gemy" +"1466594281872","attach(dat)","Gemy" +"1466594287301","chisq.test(teaching,world_rank)","Gemy" +"1466594287387","chisq.test(citations,world_rank)","Gemy" +"1466594287715","chisq.test(international,world_rank)","Gemy" +"1466594287795","chisq.test(research,world_rank)","Gemy" +"1466594287865","chisq.test(num_students,world_rank)","Gemy" +"1466594288202","chisq.test(student-staff-ratio,world_rank)","Gemy" +"1466594288203","chisq.test(income,world_rank)","Gemy" +"1466594288270","chisq.test(dat$int_stud , dat$world_rank)","Gemy" +"1466594288284","chisq.test(female_male_ratio,world_rank)","Gemy" +"1466594349565","chisq.test(rc_income,world_rank)","Gemy" +"1466594357263","names()","Gemy" +"1466594359930","names(dat)","Gemy" +"1466594373238","chisq.test(Asia,world_rank)","Gemy" +"1466594414038","chisq.test(Asia,world_rank)","Gemy" +"1466594481499","chisq.test(Asia,world_rank)","Gemy" +"1466594481506","chisq.test(Europe,world_rank)","Gemy" +"1466594481512","chisq.test(NorthAm,world_rank)","Gemy" +"1466594481517","chisq.test(SouthAm,world_rank)","Gemy" +"1466594481522","chisq.test(Europe,world_rank)","Gemy" +"1466595131165","write.csv(dat, file =dat.csv)","Gemy" +"1466595532933","qplot(x = international, y = world_rank , data = dat)","Gemy" +"1466595583106","qplot(x = international, y = world_rank , data = dat, main = International Influence vs World Rank)","Gemy" +"1466595597881","qplot(x = international, y = world_rank , data = dat, main = International Influence vs World Rank,","Gemy" +"1466595597883","margins = TRUE)","Gemy" +"1466595612212","qplot(x = international, y = world_rank , data = dat, main = International Influence vs World Rank,","Gemy" +"1466595612218","margins = TRUE, col = color)","Gemy" +"1466595623285","qplot(x = international, y = world_rank , data = dat, main = International Influence vs World Rank,","Gemy" +"1466595623286","margins = TRUE, colors = color)","Gemy" +"1466595647947","qplot(x = international, y = world_rank , data = dat, main = International Influence vs World Rank,","Gemy" +"1466595647953","margins = TRUE, col = cyan","Gemy" +"1466595649265",")","Gemy" +"1466595692165","qplot(x = international, y = world_rank , data = dat, main = International Influence vs World Rank,","Gemy" +"1466595692170","margins = TRUE, col = cyan, geom = c(point,smooth))","Gemy" +"1466595766671","qplot(x = international, y = world_rank , data = dat, main = International Influence vs World Rank,","Gemy" +"1466595766677","margins = TRUE, col = cyan) + stat_smooth(method = lm)","Gemy" +"1466595795348","qplot(x = international, y = world_rank , data = dat, main = International Influence vs World Rank,","Gemy" +"1466595795353","margins = TRUE, col = cyan) + stat_smooth(method = lm, formlua = y ~ poly(x, 2, raw = TRUE)","Gemy" +"1466595798110",")","Gemy" +"1466595815330","qplot(x = international, y = world_rank , data = dat, main = International Influence vs World Rank,","Gemy" +"1466595815336","margins = TRUE, col = cyan) + stat_smooth(method = lm, formula = y ~ poly(x, 2, raw = TRUE))","Gemy" +"1466595906388","plot(x = dat$num_students, y = dat$world_rank,","Gemy" +"1466595906394","xlab = Number of Students at Universities,","Gemy" +"1466595906394","ylab = University World Rank,","Gemy" +"1466595906395","main = Number of Students at Uni vs. World Rank ,","Gemy" +"1466595906395","col = tomato3)","Gemy" +"1466595950575","plot(x = dat$international, y = dat$world_rank,","Gemy" +"1466595950581","xlab = International Influence,","Gemy" +"1466595950582","ylab = University World Rank,","Gemy" +"1466595950582","main = International Influence vs. World Rank ,","Gemy" +"1466595950583","col = tomato3)","Gemy" +"1466595980810","ncol (dat )","Gemy" +"1466595980815","reg1 <- glm(world_rank~teaching+international+research+citations+income, data = mydata)","Gemy" +"1466595980818","reg1","Gemy" +"1466595980818","pred1 <- predict(reg1, mydata)","Gemy" +"1466595980819","pred1","Gemy" +"1466595980819","plot(mydata$world_rank, pred1)","Gemy" +"1466595980820","-------------------------------------","Gemy" +"1466596002337","ncol (dat )","Gemy" +"1466596002343","reg1 <- glm(world_rank~teaching+international+research+citations+income, data = dat)","Gemy" +"1466596002564","reg1","Gemy" +"1466596002581","pred1 <- predict(reg1, dat)","Gemy" +"1466596002599","pred1","Gemy" +"1466596002616","plot(dat$world_rank, pred1)","Gemy" +"1466596680514","qplot(x = int_stud, y = international , data = dat, main = Number of Students vs International Influence,","Gemy" +"1466596680520","margins = TRUE, col = cyan))","Gemy" +"1466596686769","qplot(x = int_stud, y = international , data = dat, main = Number of Students vs International Influence,","Gemy" +"1466596686770","margins = TRUE, col = cyan)","Gemy" +"1466596849409","qplot(x = int_stud, y = international , data = dat, main = Number of Students vs +1466596849410:International Influence,","Gemy" +"1466596849410","margins = TRUE, col = cyan, geom =c(points,smooth))","Gemy" +"1466596880485","qplot(x = int_stud, y = international , data = dat, main = Number of Students vs +1466596880486:International Influence,","Gemy" +"1466596880486","margins = TRUE, col = cyan, geom =c(point,smooth))","Gemy" +"1466596923300","qplot(x = international, y = int_stud , data = dat, main = Number of Students vs +1466596923305:International Influence,","Gemy" +"1466596923306","margins = TRUE, col = cyan)","Gemy" +"1466596958695","qplot(x = international, y = int_stud , data = dat, main = Number of Students vs +1466596958700:International Influence,","Gemy" +"1466596958701","margins = TRUE, col = cyan, geom =c(point,smooth))","Gemy" +"1466999425278","curve(dnorm, from = -3, to = 3, ylab = Height,","Gemy" +"1466999425286","main = Standard Normal Probability Density,","Gemy" +"1466999425286","lwd = 3, col = 3)","Gemy" +"1466999465156","clt <- function(N = 30, reps = 10000) {","Gemy" +"1466999465162","","Gemy" +"1466999465162","","Gemy" +"1466999465162","","Gemy" +"1466999465163","","Gemy" +"1466999465163","out <- replicate(n = reps, expr = mean(rexp(N)))","Gemy" +"1466999465163","h1 <- hist(out, breaks = 50, main = )","Gemy" +"1466999465163","foo <- function(x) dnorm(x, mean = mean(out), sd = sd(out))*","Gemy" +"1466999465164","diff(h1$breaks[1","Gemy" +"2])*reps","","Gemy" +"1466999465164","curve(foo, from = mean(out) - 5*sd(out),","Gemy" +"1466999465165","to = mean(out) + 5*sd(out), add = TRUE,","Gemy" +"1466999465165","lwd = 2, col = steelblue)","Gemy" +"1466999465166","}","Gemy" +"1466999480977","","Gemy" +"1466999480977","clt(N = 1)","Gemy" +"1466999486703","clt(N = 3)","Gemy" +"1466999486867","clt(N = 5)","Gemy" +"1466999487084","clt(N = 10)","Gemy" +"1466999487309","clt(N = 20)","Gemy" +"1466999487551","clt(N = 50)","Gemy" +"1466999487818","clt(N = 100)","Gemy" +"1466999488129","clt(N = 500)","Gemy" +"1466999497072","curve(dnorm(x), from = -3, to = 3, lwd = 2, ylab = Height,","Gemy" +"1466999497073","main = Normal and t Densities)","Gemy" +"1466999501104","curve(dt(x, df = 1), from = -3, to = 3, lwd = 2, lty = 2, col = 2, add = TRUE)","Gemy" +"1466999501111","curve(dt(x, df = 3), from = -3, to = 3, lwd = 2, lty = 3, col = 3, add = TRUE)","Gemy" +"1466999501113","curve(dt(x, df = 10), from = -3, to = 3, lwd = 2, lty = 4, col = 4, add = TRUE)","Gemy" +"1466999501114","curve(dt(x, df = 30), from = -3, to = 3, lwd = 2, lty = 5, col = 5, add = TRUE)","Gemy" +"1466999501115","legend(x = bottom, legend = c(normal, df=1, df = 3, df = 10, df = 30),","Gemy" +"1466999501116","col = 1","Gemy" +"5, lty = 1","5, lwd = 2)","Gemy" +"1466999509701","curve(dchisq(x, df = 1), from = 0.2, to = 10, lwd = 2, lty = 1, col = 1,","Gemy" +"1466999509702","ylab = Height, main = Chi Square Densities)","Gemy" +"1466999509746","curve(dchisq(x, df = 2), from = 0, to = 10, lwd = 2, lty = 2, col = 2, add = TRUE)","Gemy" +"1466999509748","curve(dchisq(x, df = 3), from = 0, to = 10, lwd = 2, lty = 3, col = 3, add = TRUE)","Gemy" +"1466999509749","curve(dchisq(x, df = 5), from = 0, to = 10, lwd = 2, lty = 4, col = 4, add = TRUE)","Gemy" +"1466999509751","curve(dchisq(x, df = 8), from = 0, to = 10, lwd = 2, lty = 5, col = 5, add = TRUE)","Gemy" +"1466999509752","legend(x = topright, legend = c(df=1, df = 2, df = 3, df = 5, df = 8),","Gemy" +"1466999509752","col = 1","Gemy" +"5, lty = 1","5, lwd = 2)","Gemy" +"1466999534248","runif(n = 5, min = 0, max = 1)","Gemy" +"1466999534249","ru <- runif(10000)","Gemy" +"1466999534251","hist(ru, breaks = 10, probability = TRUE)","Gemy" +"1466999534283","curve(dunif(x), add = TRUE, lwd = 3, col = 2) ","Gemy" +"1466999540933","rnorm(n = 5, mean = 0, sd = 1)","Gemy" +"1466999540939","rn <- rnorm(10000)","Gemy" +"1466999540941","hist(rn, breaks = 100, probability = TRUE)","Gemy" +"1466999540981","curve(dnorm(x), add = TRUE, lwd = 3, col = 2) ","Gemy" +"1466999545799","rt(n = 5,df = 2)","Gemy" +"1466999545801","rand_t <- rt(10000, df = 2)","Gemy" +"1466999545808","hist(rand_t, breaks = 100, prob = TRUE)","Gemy" +"1466999545844","curve(dt(x, df = 2), add = TRUE, lwd = 3, col = 2) ","Gemy" +"1466999551245","curve(dnorm(x), from = -5, to = 5, lwd = 3, col = 3)","Gemy" +"1466999551275","curve(dt(x, df = 2), from = -5, to = 5, lwd = 3, col = 2, add = TRUE)","Gemy" +"1466999551277","legend(3, .2, c(Normal, t (df = 2)), col = 2","Gemy" +"3, lwd = 3)","","Gemy" +"1466999555503","rchisq(5, df = 4)","Gemy" +"1466999555505","rch <- rchisq(n = 10000, df = 4)","Gemy" +"1466999555510","hist(rch, breaks = 100, prob = TRUE)","Gemy" +"1466999555555","curve(dchisq(x, df = 4), add = TRUE, lwd = 3, col = 2)","Gemy" +"1466999573038","install.packages(MASS)","Gemy" +"1466999578075","library(MASS)","Gemy" +"1466999585404","?mvrnorm","Gemy" +"1466999607346","mv_data <- mvrnorm(500, mu = c(0, 0), Sigma = matrix(c(1, .75, .75, 1), 2, 2))","Gemy" +"1466999612786","plot(mv_data)","Gemy" +"1466999616721","abline(lm(mv_data[,2] ~ mv_data[,1]))","Gemy" +"1466999621290","mv_data <- mvrnorm(500, mu = c(0, 0), Sigma = matrix(c(1, -.9, -.9, 1), 2, 2))","Gemy" +"1466999626472","plot(mv_data)","Gemy" +"1466999633785","abline(lm(mv_data[,2] ~ mv_data[,1]))","Gemy" +"1466999637682","mv_data <- mvrnorm(500, mu = c(0, 0), Sigma = matrix(c(1, .2, .2, 1), 2, 2))","Gemy" +"1466999640378","plot(mv_data)","Gemy" +"1466999643931","abline(lm(mv_data[,2] ~ mv_data[,1]))","Gemy" +"1466999665175","body_temp <- read.table(file = http://www.amstat.org/publications/jse/datasets/normtemp.dat.txt,","Gemy" +"1466999665180","header = FALSE, sep = )","Gemy" +"1466999676283","body_temp","Gemy" +"1467000053606","hist(body_temp[,1], freq = FALSE)","Gemy" +"1467000068179","lines(density(body_temp[,1]), lwd = 3, col = blue)","Gemy" +"1467000080312","range(body_temp[,1])","Gemy" +"1467000084897","xfit <- seq(95, 103, length = 100)","Gemy" +"1467000091311","yfit <- dnorm(xfit, mean = mean(body_temp[,1]), sd = sd(body_temp[,1]))","Gemy" +"1467000095631","lines(xfit, yfit, col = red, lwd = 3)","Gemy" +"1467000100202","legend(x = topright, legend = c(Kernel Density, Normal Curve),","Gemy" +"1467000100203","fill = c(blue, red))","Gemy" +"1467000110040","qqnorm(body_temp[,1])","Gemy" +"1467000120185","qqline(body_temp[,1])","Gemy" +"1467000161126","(obs <- quantile(body_temp[,1], probs = seq(0.025, 0.975, .025)))","Gemy" +"1467000167445","(nrml <- qnorm(seq(0.025, .975, .025)))","Gemy" +"1467000172902","plot(nrml, obs)","Gemy" +"1467000182375","shapiro.test(body_temp[,1])","Gemy" +"1467000193203","ks.test(x = body_temp[,1],","Gemy" +"1467000193209","y = pnorm,","Gemy" +"1467000193209","mean = mean(body_temp[,1]),","Gemy" +"1467000193210","sd = sd(body_temp[,1]))","Gemy" +"1467000200218","(t1 <- t.test(body_temp[,1], mu = 98.6, alternative = two.sided))","Gemy" +"1467000200227","attributes(t1)","Gemy" +"1467000207184","","Gemy" +"1467000207189","t1$conf.int","Gemy" +"1467000216115","","Gemy" +"1467000216116","","Gemy" +"1467000216116","","Gemy" +"1467000216117","","Gemy" +"1467000216117","","Gemy" +"1467000216118","","Gemy" +"1467000216118","","Gemy" +"1467000216118","pre <- c(18, 21, 16, 22, 19 ,24 ,17 ,21 ,23 ,18 ,","Gemy" +"1467000216119","14 ,16 ,16 ,19 ,18 ,20 ,12 ,22 ,15 ,17)","Gemy" +"1467000221281","post <- c(22, 25, 17, 24, 16, 29 ,20, 23, 19, 20,","Gemy" +"1467000221282","15, 15, 18, 26, 18, 24, 18, 25, 19, 16)","Gemy" +"1467000227184","(diffs <- post - pre)","Gemy" +"1467000320641","hist(diffs, 10)","Gemy" +"1467000320680","qqnorm(diffs)","Gemy" +"1467000320721","qqline(diffs)","Gemy" +"1467000352135","(t2 <- t.test(diffs, mu = 0, alternative = two.sided))","Gemy" +"1467000375061","","Gemy" +"1467000375066","?wilcox.test","Gemy" +"1467000379830","","Gemy" +"1467000379830","wilcox.test(body_temp[,1], alternative = two.sided, mu = 98.6)","Gemy" +"1467001674512","row1 <- c(45, 8, 7, 2, 7)","Gemy" +"1467001694882","row2 <- c(6,6,9, 5,13,39)","Gemy" +"1467001701286","row1 <- c(45, 8, 7, 2, 7, 69","Gemy" +"1467001705588",")","Gemy" +"1467001720929","row3 <- c(3,6,6,4,18, 37)","Gemy" +"1467001733196","row4 <- c(50, 7,2,2,5)","Gemy" +"1467001754696","Dark_brown <- c(50, 7,2,2,5,67)","Gemy" +"1467001770359","cbind(row1,row2)","Gemy" +"1467001780524","rbind(row1,row2)","Gemy" +"1467001878421","var(males_temp)","Gemy" +"1467001878428","var(females_temp)","Gemy" +"1467001996542","males_temp <- body_temp[,1][body_temp[,2] == 1]","Gemy" +"1467001996548","females_temp <- body_temp[,1][body_temp[,2] == 2]","Gemy" +"1467002004620","var(males_temp)","Gemy" +"1467002004622","var(females_temp)","Gemy" +"1467002015061","install.packages(Rcmdr)","Gemy" +"1467002027485","library(Rcmdr)","Gemy" +"1467002219239","?leveneTest","Gemy" +"1467002219372","?leveneTest","Gemy" +"1467002219441","leveneTest(body_temp[,1], factor(body_temp[,2]))","Gemy" +"1467002284976","black <- c(45, 8,7,2,7,69)","Gemy" +"1467002298989","red <- c(6,6,9,5,13,39)","Gemy" +"1467002311413","blond <- c(3,6,6,4,18,37)","Gemy" +"1467002329284","darkbrown <- c(50,8,2,2,5,67)","Gemy" +"1467002343541","total <- c(104,28,24,13,43,212)","Gemy" +"1467002356377","rbind(black,red,blond, darkbrown, toal)","Gemy" +"1467002359900","rbind(black,red,blond, darkbrown, total)","Gemy" +"1467002412101","dat1 <- rbind(black,red,blond, darkbrown, total)","Gemy" +"1467002419229","dat1","Gemy" +"1467002428954","colnames(dat1)","Gemy" +"1467002469811","colnames(dat1, do.NULL = FALSE)","Gemy" +"1467002502814","colnames(dat1) <- c(Brown, Hazel, Green, Gray, Blue,Total)","Gemy" +"1467002505790","dat1","Gemy" +"1467002555775","table(dat1)","Gemy" +"1467002711931","chisq.test(dat1)","Gemy" +"1467002849688","chisq.test(dat1)$pvalue","Gemy" +"1467003212700","?chisq.test","Gemy" +"1467003410498","library(MASS)","Gemy" +"1467003415392","?MASS","Gemy" +"1467003672607","dat2 <- rbind(blond, darkbrown)","Gemy" +"1467003674412","dat2","Gemy" +"1467003679725","chisq.test(dat2)","Gemy" +"1467004124669","getwd()","Gemy" +"1467004130475","dat","Gemy" +"1467004140479","read.csv(dat)","Gemy" +"1467004156260","read.csv(dat.csv)","Gemy" +"1467004209194","table(dat)","Gemy" +"1467004238169","dat <- read.csv( dat.csv)","Gemy" +"1467004305816","qqnorm(dat)","Gemy" +"1467004326117","qqnorm(dat[,1])","Gemy" +"1467004340430","qqlone(dat[,1])","Gemy" +"1467004346538","qqline(dat[,1])","Gemy" +"1467004402357","dat <- c(, -1,-2)","Gemy" +"1467004420528","dat","Gemy" +"1467004526685","datx<- dat[-c(,1), -c (,2)]","Gemy" +"1467004533817","datx<- dat[-c(,1)]","Gemy" +"1467004608680","datx<- subset(dat, selec = -c(,1))","Gemy" +"1467004620301","datx<- subset(dat, selec = -c(1,2))","Gemy" +"1467004622480","datx","Gemy" +"1467004635161","View(datx)","Gemy" +"1467004703779","datxx <- datx[c(3 )]","Gemy" +"1467004705859","datxx","Gemy" +"1467004754895","shapiro.test(datx[,1])","Gemy" +"1467005389044","","Gemy" +"1467005400661","","Gemy" +"1467005412839","shapiro.test(datx[,1])","Gemy" +"1467005427870","?shapiro.test","Gemy" +"1467005763516","ks.test(x = datx[,1], y =pnorm, mean = mean(datx[,1]), sd=sd(datx[,1]))","Gemy" +"1467005789418","mean(datx[,1])","Gemy" +"1467005902239","?ks.test","Gemy" +"1467006384697","body_temp","Gemy" +"1467006398510","males_temp <- body_temp[,1][body_temp[,2] == 1]","Gemy" +"1467006401472","males_temp","Gemy" +"1467006430024","var(males_temp)","Gemy" +"1467006448818","datx$Region","Gemy" +"1467006455911","table(datx$Region)","Gemy" +"1467006529544","table(datx$Region)","Gemy" +"1467006557327","col(datx)","Gemy" +"1467006568549","colnames(datx)","Gemy" +"1467006590754","datx[,18]","Gemy" +"1467006638798","Africax <- datx[,1][datx[,18] = Africa]","Gemy" +"1467006644525","Africax <- datx[,1][datx[,18] == Africa]","Gemy" +"1467006655326","Asiax <- datx[,1][datx[,18] == Asia]","Gemy" +"1467006670467","Europex <- datx[,1][datx[,18] == Europe]","Gemy" +"1467006701907","Oceaniax <- datx[,1][datx[,18] == Oceania]","Gemy" +"1467006791716","NorthAmex <- datx[,1][datx[,18] == North America]","Gemy" +"1467006808683","SouthAmex <- datx[,1][datx[,18] == South America]","Gemy" +"1467006816232","Africax","Gemy" +"1467006827905","var(Africax)","Gemy" +"1467006837411","var(Asiax)","Gemy" +"1467006844536","install.packages(Rcmdr)","Gemy" +"1467006844550","library(Rcmdr)","Gemy" +"1467006849671","install.packages(Rcmdr)","Gemy" +"1467007050179","laveneTest(datx[,1], factor(datx[,18]))","Gemy" +"1467007061178","?laveneTest","Gemy" +"1467007079997","library(Rcmdr)","Gemy" +"1467007089376","leveneTest(body_temp[,1], factor(body_temp[,2]))","Gemy" +"1467007110089","laveneTest(datx[,1], factor(datx[,18]))","Gemy" +"1467007115473","leveneTest(datx[,1], factor(datx[,18]))","Gemy" +"1467007417624","t3 <- t.test(x=Asiax, y = Africax, var.equal=TRUE, alternative = two.sided))","Gemy" +"1467007423156","t3 <- t.test(x=Asiax, y = Africax, var.equal=TRUE, alternative = two.sided)","Gemy" +"1467007440972","artributes(t3)","Gemy" +"1467007449121","attributes(t3)","Gemy" +"1467007462180","t3","Gemy" +"1467007506151","t3 <- t.test(x=Asiax, y = Africax, var.equal=FALSE, alternative = two.sided)","Gemy" +"1467007512966","t3","Gemy" +"1467007582945","diffs <- Asiax - Africax","Gemy" +"1467007882730","?Levene leveneTest","Gemy" +"1467007888152","?leveneTest","Gemy" +"1467008928369","t.test(x = Asiax, y = NorthAmex, var.equal = FALSE, alternative = two.sided)","Gemy" +"1467009069720","install.packages(coin)","Gemy" +"1467009073969","library(coin)","Gemy" +"1467009074539","bt <- data.frame(body_temp)","Gemy" +"1467009074540","independence_test(V1 ~ factor(V2), data = bt, distribution = exact())","Gemy" +"1467009085149","","Gemy" +"1467009085151","","Gemy" +"1467009085152","","Gemy" +"1467009085152","wilcox.test(males_temp, females_temp, alternative = two.sided,","Gemy" +"1467009085152","conf.int = TRUE, conf.level = 0.95)","Gemy" +"1467009085240","","Gemy" +"1467009085240","independence_test(V1 ~ factor(V2), data = bt, distribution = exact(),","Gemy" +"1467009085241","ytrafo = rank)","Gemy" +"1467009113467","?wilcox.test","Gemy" +"1467010288738","wilcox.test(Asiax,NorthAmex, alternative = two.sided,","Gemy" +"1467010288749","+ conf.int = TRUE, conf.level = 0.95)","Gemy" +"1467010291947","wilcox.test(Asiax,NorthAmex, alternative = two.sided,","Gemy" +"1467010291948","+ conf.int = TRUE, conf.level = 0.95)","Gemy" +"1467010339199","wilcox.test(Asiax,NorthAmex, alternative = two.sided, conf.int = TRUE, conf.level = 0.95)","Gemy" +"1467010513700","y ~ x","Gemy" +"1467010513716","y ~ 1 + x","Gemy" +"1467010521153","y ~ 0 + x","Gemy" +"1467010521156","y ~ -1 + x","Gemy" +"1467010521157","y ~ x - 1","Gemy" +"1467010558166","log(y) ~ x1 + x2","Gemy" +"1467010965280","","Gemy" +"1467010965285","","Gemy" +"1467010965286","","Gemy" +"1467011026915","str(datax)","Gemy" +"1467011033997","string(datx)","Gemy" +"1467011040874","str(datx)","Gemy" +"1467011112943","plot(international_students ~ world_rank, data = datx, pch = 20, col = 1)","Gemy" +"1467011177800","plot(world_rank ~ region, data = datx)","Gemy" +"1467011183384","plot(world_rank ~ Region, data = datx)","Gemy" +"1467011217923","plot(world_rank ~ international_students, data = datx)","Gemy" +"1467011274092","text(x = datx$international_students, y = datx$world_rank, labels = datx$university_name)","Gemy" +"1467011727165","anc <- lm(world_rank ~ int_stud + Asia + Europe + NorthAm +Africa +Oceania + SouthAm + student_staff_ratio +female_male_ratio + teaching)","Gemy" +"1467011775121","anc <- lm(world_rank ~ int_stud + Asia + Europe + NorthAm +Africa +Oceania + SouthAm + student_staff_ratio +female_male_ratio + teaching, data = datx)","Gemy" +"1467011781894","summary(anc)","Gemy" +"1467011824194","anc <- lm(world_rank ~ int_stud + Asia + Europe + NorthAm +Africa +Oceania + SouthAm + student_staff_ratio +female_male_ratio, data = datx)","Gemy" +"1467011828716","summary(anc)","Gemy" +"1467011861419","anc <- lm(world_rank ~ int_stud + Asia + Europe + NorthAm +Africa + SouthAm + student_staff_ratio +female_male_ratio, data = datx)","Gemy" +"1467011866534","summary(anc)","Gemy" +"1467011904626","anc <- lm(world_rank ~ int_stud + Asia + Europe + NorthAm +Africa + Oceania + student_staff_ratio +female_male_ratio, data = datx)","Gemy" +"1467011910250","summary(anc)","Gemy" +"1467011991353","plot(anc)","Gemy" +"1467012012648","crPlots(anc)","Gemy" +"1467012040319","resids <- anc$residuals","Gemy" +"1467012046108","resids","Gemy" +"1467012055367","hist(resids, freq = FALSE)","Gemy" +"1467029197259","str(datax)","Gemy" +"1467029203452","str(datx)","Gemy" +"1467029546979","amc <- lm(int_stud ~ teaching + international + research + citations + rcincome + num_students + student_staff_ratio + female_male_ratio + Asia + Europe + NorthAm + Africa + Oceania, data = datx)","Gemy" +"1467029555188","amc <- lm(int_stud ~ teaching + international + research + citations + rc_income + num_students + student_staff_ratio + female_male_ratio + Asia + Europe + NorthAm + Africa + Oceania, data = datx)","Gemy" +"1467029561437","summary(amc)","Gemy" +"1467029743700","plot(int_stud ~ female_male_ratio, data = datx)","Gemy" +"1467029878595","P1 <- ggplot(datx, aes(x = female_male_ratio, y = int_stud))","Gemy" +"1467029890832","library(ggplot2)","Gemy" +"1467029892660","P1 <- ggplot(datx, aes(x = female_male_ratio, y = int_stud))","Gemy" +"1467029976207","P1","Gemy" +"1467030015584","P1 + layer(geom=point, stat =identity, position = identity)","Gemy" +"1467030067008","P1 + layer(geom = point, stat = identity, position = identity) + geom_text(aes(label = datx$university_name))","Gemy" +"1467030106518","P1 + layer(geom = point, stat = identity, position = identity) + geom_text(aes(label = datx$university_name), hjust =0, vjust =0)","Gemy" +"1467030273825","P1 + layer(geom = point, stat = identity, position = identity) + geom_text(aes(label = datx$university_name), hjust =0, vjust =0, stat_smooth(method =amc, se=FALSE)","Gemy" +"1467030276290",")","Gemy" +"1467030297118","P1 + layer(geom = point, stat = identity, position = identity) + geom_text(aes(label = datx$university_name), hjust =0, vjust =0 + stat_smooth(method =amc, se=FALSE)","Gemy" +"1467030298681",")","Gemy" +"1467031184346","","Gemy" +"1467031223037","","Gemy" +"1467031234469","plot(amc)","Gemy" +"1467031508069","crPlots(lm1)","Gemy" +"1467031510685","crPlots(lm1)","Gemy" +"1467031516454","crPlots(amc)","Gemy" +"1467031762331","resids <- amc$residuals","Gemy" +"1467031765782","resids","Gemy" +"1467031776202","hist(resids, freq = FALSE)","Gemy" +"1467031800186","sresid <- rstudent(amc)","Gemy" +"1467031819474","hist(sresid, freq = FALSE, 25)","Gemy" +"1467034281759","lines(density(sresid), col =blue, lwd=3)","Gemy" +"1467034293214","range(sresid)","Gemy" +"1467034321692","xfit <- seq(-1, 8, length =100)","Gemy" +"1467034347500","yfit <- dnorm(xfit, mean = mean(sresid), sd = sd(sresid))","Gemy" +"1467034362964","lines(xfit, yfit, col =red, lwd =3)","Gemy" +"1467034386765","library(car)","Gemy" +"1467034395033","qqpPlot(amc)","Gemy" +"1467034399503","qqplot(amc)","Gemy" +"1467034404772","qqPlot(amc)","Gemy" +"1467034419169","shapiro.test(sresid)","Gemy" +"1467034493692","ncvTest(amc)","Gemy" +"1467034508466","spreadLevelPlot(amc)","Gemy" +"1467034808396","colnames(datx)","Gemy" +"1467034832145","ks.test(x = datx[,21], y =pnorm, mean = mean(datx[,21]), sd=sd(datx[,21]))","Gemy" +"1467036009873","amc <- lm(int_stud ~ teaching + international + research + citations + rc_income + student_staff_ratio + female_male_ratio + Asia + Europe + NorthAm + Africa + Oceania, data = datx)","Gemy" +"1467036019192","summary(amc)","Gemy" +"1467037398143","crPlots(amc)","Gemy" +"1467037689821","resids <- amc$residuals","Gemy" +"1467037689828","resids","Gemy" +"1467037689855","hist(resids, freq = FALSE)","Gemy" +"1467037689885","sresid <- rstudent(amc)","Gemy" +"1467037689887","hist(sresid, freq = FALSE, 25)","Gemy" +"1467037748314","resids <- amc$residuals","Gemy" +"1467037748316","resids","Gemy" +"1467037756868","hist(resids, freq = FALSE)","Gemy" +"1467037766449","hist(resids, freq = FALSE)","Gemy" +"1467037998647","sresid <- rstudent(amc)","Gemy" +"1467037998653","hist(sresid, freq = FALSE, 25)","Gemy" +"1467038008323","lines(density(sresid), col =blue, lwd=3)","Gemy" +"1467038008326","range(sresid)","Gemy" +"1467038012846","xfit <- seq(-1, 8, length =100)","Gemy" +"1467038012847","yfit <- dnorm(xfit, mean = mean(sresid), sd = sd(sresid))","Gemy" +"1467038012848","lines(xfit, yfit, col =red, lwd =3)","Gemy" +"1467038041470","qqPlot(amc)","Gemy" +"1467039164933","shapiro.test(sresid)","Gemy" +"1467039380257","ncvTest(amc)","Gemy" +"1467039395231","?ncv.test","Gemy" +"1467039440553","spreadLevelPlot(amc)","Gemy" +"1467039633446","vif(amc)","Gemy" +"1467142718335","load(~/Documents/Intro to R /ecls.Rdata)","Gemy" +"1467143143353","str(ecls)","Gemy" +"1467143209381","lm1 <- lm(C6R4MSCL ~ F5SPECS, data = ecls)","Gemy" +"1467143213071","summary(lm1)","Gemy" +"1467143240992","library(ggplot2)","Gemy" +"1467143282287","(p1 <- ggplot(ecls, aes(x = F5SPECS, y = C6R4MSCL)) + xlim(-.5, 1.5) +","Gemy" +"1467143282288","theme(text = element_text(size=20)))","Gemy" +"1467143294428","(p2 <- p1 + geom_jitter(width = 0.2, height = 0.0, color = ecls$F5SPECS+1))","Gemy" +"1467143303048","(p3 <- p2 + geom_abline(slope = 0, intercept = coef(lm1), color = 1, lwd = 2) +","Gemy" +"1467143303049","geom_abline(slope = 0, intercept = sum(coef(lm1)), color = 2, lwd = 2))","Gemy" +"1467213604332","getwd()","Gemy" +"1467213604342","setwd(dir = /Users/Gemy/Documents/Intro to R /)","Gemy" +"1467213629801","dat <- read.csv(top800.csv)","Gemy" +"1467213766101","datx <- read.csv( dat.csv)","Gemy" +"1467213789806","View(datx)","Gemy" +"1467229301970","datx <- read.csv( dat.csv)","Gemy" +"1467229315745","getwd()","Gemy" +"1467229315747","setwd(dir = /Users/Gemy/Documents/Intro to R /)","Gemy" +"1467229318931","datx <- read.csv( dat.csv)","Gemy" +"1467229334380","str(datx)","Gemy" +"1467229474161","attach(datx)","Gemy" +"1467229481087","table(Region)","Gemy" +"1467231288240","colnames(datx)","Gemy" +"1467231326422","datx[,-c(1,2)]","Gemy" +"1467231338443","datx<- datx[,-c(1,2)]","Gemy" +"1467231344172","str(datx)","Gemy" +"1467231356490","ks.test(x = datx[,1], y =pnorm, mean = mean(datx[,1]), sd=sd(datx[,1]))","Gemy" +"1467231391428","colnames(datx)","Gemy" +"1467231416462","ks.test(x = datx[,21], y =pnorm, mean = mean(datx[,21]), sd=sd(datx[,21]))","Gemy" +"1467231442593","table(datx$int_stud)","Gemy" +"1467231453003","attach(datx)","Gemy" +"1467231457704","range(int_stud)","Gemy" +"1467231479819","which(int_student ==82)","Gemy" +"1467231488914","which(int_student == 82)","Gemy" +"1467231509657","View(datx)","Gemy" +"1467231628227","model1 <- lm(int_stud ~ Asiax + Europex + Africax + Oceaniax+ SouthAmex, data = datx)","Gemy" +"1467231628237","summary(model1)","Gemy" +"1467231793478","model1 <- lm(int_stud ~ Asia + Europe + Africa + Oceania+ SouthAme, data = datx)","Gemy" +"1467231793482","summary(model1)","Gemy" +"1467231817740","model1 <- lm(int_stud ~ Asia + Europe + Africa + Oceania+ SouthAm, data = datx)","Gemy" +"1467231817757","summary(model1)","Gemy" +"1467231842313","model2 <- lm(int_stud ~ Asia + Europe + Africa + Oceania+ SouthAm + international + research","Gemy" +"1467231842314","+ citations + rc_income + student_staff_ratio + female_male_ratio, data = datx)","Gemy" +"1467231842322","summary(model2)","Gemy" +"1467231898478","model3 <- lm(int_stud ~ teaching + Asia + Europe + Africa + Oceania+ SouthAm + international + research","Gemy" +"1467231898479","+ citations + rc_income + student_staff_ratio + female_male_ratio, data = datx)","Gemy" +"1467231898489","summary(model3)","Gemy" +"1467231967040","model4 <- lm(int_stud ~ teaching + Asia + Europe + Africa + Oceania+ SouthAm + international + research","Gemy" +"1467231967041","+ citations + rc_income + student_staff_ratio + female_male_ratio + Asia*teaching + Europe*teaching","Gemy" +"1467231967045",", data = datx)","Gemy" +"1467231967052","summary(model4)","Gemy" +"1467231994104","range(datx$female_male_ratio)","Gemy" +"1467232017881","str(datx)","Gemy" +"1467232034760","table(datx$female_male_ratio)","Gemy" +"1467232115506","model4 <- lm(int_stud ~ teaching + Asia + Europe + Africa + Oceania+ SouthAm + international + research","Gemy" +"1467232115507","+ citations + rc_income + student_staff_ratio + female_male_ratio + Asia*international + Europe*teaching","Gemy" +"1467232115511",", data = datx)","Gemy" +"1467232115518","summary(model4)","Gemy" +"1467232146032","model4 <- lm(int_stud ~ teaching^2 + Asia + Europe + Africa + Oceania+ SouthAm + international + research","Gemy" +"1467232146033","+ citations + rc_income + student_staff_ratio + female_male_ratio + Asia*teaching + Europe*teaching","Gemy" +"1467232146037",", data = datx)","Gemy" +"1467232146042","summary(model4)","Gemy" +"1467232260759","model4 <- lm(int_stud ~ teaching + Asia + Europe + Africa + Oceania+ SouthAm + international + research","Gemy" +"1467232260764","+ citations + rc_income + student_staff_ratio + female_male_ratio + Asia*teaching + Europe*teaching","Gemy" +"1467232260764","+ Africa*teaching + Oceania* teaching + SouthAm*teaching, data = datx)","Gemy" +"1467232260771","summary(model4)","Gemy" +"1467232301000","model1 <- lm(int_stud ~ Asia + Europe + Africa + Oceania+ SouthAm + female_male_ratio, data = datx)","Gemy" +"1467232301006","summary(model1)","Gemy" +"1467232326192","model1 <- lm(int_stud ~ Asia + Europe + Africa + Oceania+ SouthAm + teaching, data = datx)","Gemy" +"1467232326203","summary(model1)","Gemy" +"1467232390029","model1 <- lm(int_stud ~ Asia + Europe + Africa + Oceania+ SouthAm + international, data = datx)","Gemy" +"1467232390034","summary(model1)","Gemy" +"1467232403284","model1 <- lm(int_stud ~ Asia + Europe + Africa + Oceania+ SouthAm + research, data = datx)","Gemy" +"1467232403289","summary(model1)","Gemy" +"1467232415076","model1 <- lm(int_stud ~ Asia + Europe + Africa + Oceania+ SouthAm + rc_income, data = datx)","Gemy" +"1467232415081","summary(model1)","Gemy" +"1467232442453","model3 <- lm(int_stud ~ teaching + Asia + Europe + Africa + Oceania+ SouthAm + international + research","Gemy" +"1467232442454","+ citations + rc_income + student_staff_ratio + female_male_ratio, data = datx)","Gemy" +"1467232442467","summary(model3)","Gemy" +"1467234419347","model4 <- lm(int_stud ~ teaching + Asia + Europe + Africa + Oceania+ SouthAm + international + research","Gemy" +"1467234419348","+ citations + rc_income + student_staff_ratio + female_male_ratio + Asia*teaching + Europe*teaching","Gemy" +"1467234419348",", data = datx)","Gemy" +"1467234419353","summary(model4)","Gemy" +"1467234443431","plot(model4)","Gemy" +"1467234495065","crPlots(model4)","Gemy" +"1467234495066","resids <- model4$residuals","Gemy" +"1467234495066","resids","Gemy" +"1467234495085","hist(resids, freq = FALSE)","Gemy" +"1467234495115","sresid <- rstudent(model4)","Gemy" +"1467234495116","hist(sresid, freq = FALSE, 25)","Gemy" +"1467234495143","lines(density(sresid), col =blue, lwd=3)","Gemy" +"1467234495149","range(sresid)","Gemy" +"1467234495149","xfit <- seq(-1, 8, length =100)","Gemy" +"1467234495150","yfit <- dnorm(xfit, mean = mean(sresid), sd = sd(sresid))","Gemy" +"1467234495150","lines(xfit, yfit, col =red, lwd =3)","Gemy" +"1467234495151","library(car)","Gemy" +"1467234497456","qqPlot(model4)","Gemy" +"1467234498100","shapiro.test(sresid)","Gemy" +"1467234498104","lines(density(sresid), col =blue, lwd=3)","Gemy" +"1467234498106","range(sresid)","Gemy" +"1467234498107","xfit <- seq(-1, 8, length =100)","Gemy" +"1467234498107","yfit <- dnorm(xfit, mean = mean(sresid), sd = sd(sresid))","Gemy" +"1467234498108","lines(xfit, yfit, col =red, lwd =3)","Gemy" +"1467234498108","library(car)","Gemy" +"1467234498109","qqPlot(model4)","Gemy" +"1467234498547","shapiro.test(sresid)","Gemy" +"1467234498549","ncvTest(model4)","Gemy" +"1467234498561","?ncv.test","Gemy" +"1467234498622","spreadLevelPlot(model4)","Gemy" +"1467234498683","vif(model4)","Gemy" +"1468097072517","load(~/Documents/Intro to R /ecls.Rdata)","Gemy" +"1468097078353","head(ecls)","Gemy" +"1468097082525","str(ecls)","Gemy" +"1468097106713","plot(x=ecls$RIRT, y = ecls$MIRT)","Gemy" +"1468097174813","plot(x=ecls$RIRT, y = ecls$MIRT, xlab = score 1, ylab =Score2)","Gemy" +"1468097249101","plot(x=ecls$RIRT, y = ecls$MIRT, xlab = score 1, ylab =Score2, main = Hehe)","Gemy" +"1468097387834","plot(x=ecls$RIRT, y = ecls$MIRT, xlab = score 1, ylab =Score2, main = Hehe, pch=8)","Gemy" +"1468097452132","plot(x=ecls$RIRT, y = ecls$MIRT, xlab = score 1, ylab =Score2, main = Hehe, pch=8,","Gemy" +"1468097452133","col = blue, bg =red)","Gemy" +"1468097513426","plot(x=ecls$RIRT, y = ecls$MIRT, xlab = score 1, ylab =Score2, main = Hehe, pch=8,","Gemy" +"1468097513427","col = blue, bg =red, lwd =2)","Gemy" +"1468097527026","plot(x=ecls$RIRT, y = ecls$MIRT, xlab = score 1, ylab =Score2, main = Hehe, pch=8,","Gemy" +"1468097527026","col = blue, bg =red, lwd =2, cex=2)","Gemy" +"1468097569846","colors()","Gemy" +"1468097602900","palette()","Gemy" +"1468097686347","plot(x=ecls$RIRT, y = ecls$MIRT, xlab = score 1, ylab =Score2, main = Hehe, pch=19, col = rgb(255, 0, 0, 100, maxColorValue = 255)","Gemy" +"1468097689210",")","Gemy" +"1468097775330","dim(ecls)","Gemy" +"1468097793858","col_vec <- rep(c(red,blue), 269)","Gemy" +"1468097797056","col_vec","Gemy" +"1468097805769","length(col_vec)","Gemy" +"1468097815917","col_vec <- c(col_vec, red)","Gemy" +"1468097827955","length(col_vec)","Gemy" +"1468097841216","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1468097841216","xlab = Kindergarten Reading Score,","Gemy" +"1468097841221","ylab = Kindergarten Math Score,","Gemy" +"1468097841221","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1468097841221","pch = 19, col = col_vec)","Gemy" +"1468097890217","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1468097901478",")","Gemy" +"1468097962478","special <- c(black,red)[(ecls$F5SPECS ==1)+1 ]","Gemy" +"1468097968133","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1468097968134","xlab = Kindergarten Reading Score,","Gemy" +"1468097968138","ylab = Kindergarten Math Score,","Gemy" +"1468097968138","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1468097968139","col = spec_ed_col)","Gemy" +"1468097975915","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1468097975916","xlab = Kindergarten Reading Score,","Gemy" +"1468097975920","ylab = Kindergarten Math Score,","Gemy" +"1468097975920","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1468097975921","col = spec_ed_col)","Gemy" +"1468097987362","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1468097987363","xlab = Kindergarten Reading Score,","Gemy" +"1468097987367","ylab = Kindergarten Math Score,","Gemy" +"1468097987368","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1468097987368","col = special)","Gemy" +"1468098327908","hey1 <- by(data = ecls$MIRT, INDICES = ecls$F5SPECS, FUN = mean())","Gemy" +"1468098331265","hey1 <- by(data = ecls$MIRT, INDICES = ecls$F5SPECS, FUN = mean)","Gemy" +"1468098351865","hey1","Gemy" +"1468098400438","ablines(v = hey1[1], col =red, lwd =2)","Gemy" +"1468098404483","abline(v = hey1[1], col =red, lwd =2)","Gemy" +"1468098417857","abline(v = hey1[2], col =blue, lwd =2)","Gemy" +"1468098528541","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1468098528542","xlab = Kindergarten Reading Score,","Gemy" +"1468098528546","ylab = Kindergarten Math Score,","Gemy" +"1468098528546","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1468098528546","col = spec_ed_col)","Gemy" +"1468098537605","plot(x = ecls$RIRT, y = ecls$MIRT,","Gemy" +"1468098537606","xlab = Kindergarten Reading Score,","Gemy" +"1468098537610","ylab = Kindergarten Math Score,","Gemy" +"1468098537611","main = ECLS-K Subsample Math and Reading Scores,","Gemy" +"1468098537611","col = special","Gemy" +"1468098537612",")","Gemy" +"1468098572064","points(x = hey1[1], y = hey1[1], col = blue, pch = 19)","Gemy" +"1468099289347","plot(x = c(-4, 4), y = c(-.5, 9.5), type = n, xlab = , ylab = , axes = F,","Gemy" +"1468099289353","main = lty line types)","Gemy" +"1468099289371","abline(h = 9","Gemy" +"4, lty = 1","5, lwd = 2.5)","Gemy" +"1468099289373","legend(-.5, 3.5, legend = 1","Gemy" +"5, lty = 1","5, lwd = 2.5)","Gemy" +"1468099294884","plot(c(-3,3), c(-3,3), type = n, xlab = , ylab = , main = cex sizes)","Gemy" +"1468099294918","cexs <- c(0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25)","Gemy" +"1468099294918","for (i in 1","Gemy" +"3) {","","Gemy" +"1468099294919","for (j in 1","Gemy" +"3) {","","Gemy" +"1468099294919","points(c(-2, 0, 2)[i], c(-2, 0, 2)[j], pch = 19, cex = cexs[3*(i - 1) + j])","Gemy" +"1468099294920","text(c(-2, 0, 2)[i] - 0.5, c(-2, 0, 2)[j], cexs[3*(i - 1) + j])","Gemy" +"1468099300315","plot(c(-3,3), c(-3,3), type = n, xlab = , ylab = , main = cex sizes)","Gemy" +"1468099300316","cexs <- c(0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25)","Gemy" +"1468099300320","for (i in 1","Gemy" +"3) {","","Gemy" +"1468099300321","for (j in 1","Gemy" +"3) {","","Gemy" +"1468099300321","points(c(-2, 0, 2)[i], c(-2, 0, 2)[j], pch = 19, cex = cexs[3*(i - 1) + j])","Gemy" +"1468099300322","text(c(-2, 0, 2)[i] - 0.5, c(-2, 0, 2)[j], cexs[3*(i - 1) + j])","Gemy" +"1468099300322","}","Gemy" +"1468099300323","}","Gemy" +"1468099305184","extras = c(*,., a,A,4,+,-,|,%,#)","Gemy" +"1468099305186","xs <- 0","Gemy" +"5; ys <- 3","8","Gemy" +"1468099305190","plot(x = seq(-.5, 5.5), y = seq(2.5, 8.5), type = n, axes = FALSE, xlab = ,","Gemy" +"1468099305191","ylab = , main = pch symbols)","Gemy" +"1468099305192","abline(v = 0","Gemy" +"5, h = 3","8, col = gray, lty = dotted)","Gemy" +"1468099305192","pchlist <- as.list(0","Gemy" +"25); pchlist[27","36] <- as.list(extras)","Gemy" +"1468099305193","for (i in 1","Gemy" +"6) {","","Gemy" +"1468099305194","for (j in 1","Gemy" +"6) {","","Gemy" +"1468099305194","points(xs[i], ys[j], pch = pchlist[[6*(i - 1) + j]], col = 2, bg = 4, cex = 3, lwd = 2)","Gemy" +"1468099305195","text(xs[i] - 0.3, ys[j], pchlist[[6*(i - 1) + j]], col = 1, cex = 1)","Gemy" +"1468099305196","}","Gemy" +"1468099305197","}","Gemy" +"1473542905229","6+$","Gemy" +"1473542907369","6+3","Gemy" +"1473787468871","install.packages(rmarkdown)","Gemy" +"1473787472577","install.packages(rmarkdown)","Gemy" +"1473787740229","normal100 <- rnorm(n = 100, mean = 45, sd = 10)","Gemy" +"1473787757547","normal100","Gemy" +"1473787814103","mean(normal100)","Gemy" +"1473787826334","std(normal100)","Gemy" +"1473787830559","sd(normal100)","Gemy" +"1473787907803","hist(normal100)","Gemy" +"1473787942227","normal1000 <-rnorm(n=1000)","Gemy" +"1473787948026","hist(rnorm1000)","Gemy" +"1473787956229","hist(normal1000)","Gemy" +"1473787961942","mean(normal1000)","Gemy" +"1473787967287","sd(normal1000)","Gemy" +"1473787989432","normal10000 <- rnorm(n=10000)","Gemy" +"1473787995060","hist(rnorm10000)","Gemy" +"1473788004563","hist(normal10000)","Gemy" +"1473788013181","mean(normal10000)","Gemy" +"1473788018540","sd(normal10000)","Gemy" +"1473788065579","normal10 <-rnorm(10)","Gemy" +"1473788076436","normal100000 <-rnorm(100000)","Gemy" +"1473788169099","sample_means <- (mean(normal10), mean(normal100), mean(normal1000), mean(normal10000), mean(normal10000)","Gemy" +"1473788172350","sample_means <- (mean(normal10), mean(normal100), mean(normal1000), mean(normal10000), mean(normal10000))","Gemy" +"1473788202437","sample_means <- (mean(normal10) mean(normal100) mean(normal1000) mean(normal10000) mean(normal10000))","Gemy" +"1473788403121","sample_mean <- c(mean(normal10), mean(normal100), mean(normal1000), mean(normal10000), mean(normal10000))","Gemy" +"1473788423856","sample_mean <- c(mean(normal10), mean(normal100), mean(normal1000), mean(normal10000), mean(normal10000))","Gemy" +"1473788445369","sample_mean","Gemy" +"1473788467200","length(sample_mean)","Gemy" +"1473788673721","normal1mil <- rnorm( n= 1000000, mean = 3, sd = 4)","Gemy" +"1473788685832","normal1mil <- rnorm( n= 1000000, mean = 3, sd = 4)","Gemy" +"1473788744345","normal1mil <- rnorm( n= 1000000, mean = 3, sd = 2)","Gemy" +"1473788749383","normal1mil","Gemy" +"1473788772917","normal1mil <- rnorm( n= 1000000, mean = 3, sd = 2)","Gemy" +"1473788773039","mean(normal1mil)","Gemy" +"1473788773042","sd(normal1mil)","Gemy" +"1473788835208","mean3 <- which(mean(normal1mil) > 3)","Gemy" +"1473788838627","mean3","Gemy" +"1473789009206","sample_mean <- c(mean(normal10), mean(normal100), mean(normal1000), mean(normal10000), mean(normal10000))","Gemy" +"1473789009208","sample_mean","Gemy" +"1473789009209","length(sample_mean)","Gemy" +"1473789009210","The pattern is that it is decreasing","Gemy" +"1473789136682","mean3","Gemy" +"1473789187022","normal1mil","Gemy" +"1473789210768","mean3 <- normal1mil > 3","Gemy" +"1473789214043","mean3","Gemy" +"1473789231310","mean3 <- which(normal1mil > 3)","Gemy" +"1473789234239","mean3","Gemy" +"1473789254668","mean(mean3)","Gemy" +"1473789335337","normal1mil_mat <- (normal1mil, nrow =100, ncol = 10000)","Gemy" +"1473789360698","normal1mil_mat <- (normal1mil, ncol = 10000, bycol = TRUE)","Gemy" +"1473789384734","normal1mil_mat <- matrix(normal1mil, ncol = 10000, bycol = TRUE)","Gemy" +"1473789394937","normal1mil_mat <- matrix(normal1mil, ncol = 10000)","Gemy" +"1473789403282","normal1mil_mat","Gemy" +"1473789524301","length(normal1mil_mat)","Gemy" +"1473789567742","normal1mil_mat <- matrix(normal1mil, ncol = 10000, nrow =100)","Gemy" +"1473789575633","normal1mil_mat","Gemy" +"1473789619676","sample_mean <- c(mean(normal10), mean(normal100), mean(normal1000), mean(normal10000), mean(normal10000))","Gemy" +"1473789750986","mean(normal1mil_mat[,1234])","Gemy" +"1473789789335","?colSums","Gemy" +"1473789866070","colSums(normal1mil_mat[,1234])","Gemy" +"1473789956473","colSums(normal1mil_mat)","Gemy" +"1473790052352","col1234 <- normal1mil_mat[,1234]","Gemy" +"1473790061299","colSums(col1234)","Gemy" +"1473790085534","colMeans(col1234)","Gemy" +"1473790093335","colMeans(normal1mil_mat)","Gemy" +"1473790140691","colmeans[1234]","Gemy" +"1473790151591","colmeans <- colMeans(normal1mil_mat)","Gemy" +"1473790151594","colmeans[1234]","Gemy" +"1473790193952","hist(colmeans)","Gemy" +"1473790370919","mean(colmeans)","Gemy" +"1473790377604","sd(colmeans)","Gemy" +"1473790502941","mean3 <- c(normal1mil > 3)","Gemy" +"1473790502962","mean(mean3)","Gemy" +"1473790524504","mean3","Gemy" +"1473790533924","mean3 <- which(normal1mil > 3)","Gemy" +"1473790534074","mean3","Gemy" +"1473790551127","normal1mil","Gemy" +"1473790590646","which(normal1mil >3)","Gemy" +"1473790698674","normal1mil[mean3]","Gemy" +"1473790718309","mean(normal1mil[mean3])","Gemy" +"1473797770240","installed.packages(RColorBrewer)","Gemy" +"1473797830095","install.packages(RColorBrewer)","Gemy" +"1474142578012","setwd(~/)","Gemy" +"1474142695091","setwd(/Users/Gemy/Documents/Data Mining Edu/ R Data)","Gemy" +"1474142745650","getwd","Gemy" +"1474142749777","getwed()","Gemy" +"1474142759340","getwd()","Gemy" +"1474142802993","setwd(/Users/Gemy/Documents/Data Mining Edu/R Data)","Gemy" +"1474142805974","getwd","Gemy" +"1474142809850","getwd()","Gemy" +"1474142864422","setwd(/Users/Gemy/Documents/Intro DS/Tutorials/Data)","Gemy" +"1474142866796","getwd","Gemy" +"1474142869650","getwd()","Gemy" +"1474143883070","3+4","Gemy" +"1474145549427","rnorm(n=30)","Gemy" +"1474145679927","1+1","Gemy" +"1474401761282","library(dplyr)","Gemy" +"1474401761291","library(readr)","Gemy" +"1474401761292","library(DT)","Gemy" +"1474401761293","library(RColorBrewer)","Gemy" +"1474401836436","install.packages(dplyr)","Gemy" +"1474401859956","install.packages(readr)","Gemy" +"1474401866177","install.packages(DT)","Gemy" +"1474401871530","install.packages (RColorBrewer)","Gemy" +"1474401871533","library(dplyr)","Gemy" +"1474401872641","library(readr)","Gemy" +"1474401872683","library(DT)","Gemy" +"1474401872803","library(RColorBrewer)","Gemy" +"1474401876310","install.packages(RColorBrewer)","Gemy" +"1474401889823","mlb2014=read_csv(file=data/mlb2014.csv)","Gemy" +"1474401906072","install.packages(dplyr)","Gemy" +"1474401911920","install.packages(readr)","Gemy" +"1474401915247","install.packages(DT)","Gemy" +"1474401918642","install.packages (RColorBrewer)","Gemy" +"1474401921705","library(dplyr)","Gemy" +"1474401922447","library(readr)","Gemy" +"1474401922475","library(DT)","Gemy" +"1474401922572","library(RColorBrewer)","Gemy" +"1474401973729","mlb2014=read_csv(file=data/mlb2014.csv)","Gemy" +"1474401980058","mlb2014=read_csv(file=data/mlb2014.csv, na=c(, -, NA))","Gemy" +"1474401984353","dim(mlb2014)","Gemy" +"1474401984355","datatable(select(sample_n(mlb2014,50), ends_with(G)), options = list(scrollX=T, pageLength = 5))","Gemy" +"1474401991637","table(mlb2014$pos1)","Gemy" +"1474401991641","table(mlb2014$bats)","Gemy" +"1474401991643","table(mlb2014$pos1, mlb2014$bats)","Gemy" +"1474402042453","","Gemy" +"1474402042455","library(dplyr)","Gemy" +"1474402042456","library(readr)","Gemy" +"1474402042457","library(DT)","Gemy" +"1474402042457","library(RColorBrewer)","Gemy" +"1474402042458","","Gemy" +"1474402042458","BaseballSalary=read_csv(file=data/BaseballSalary.csv)","Gemy" +"1474402042527","","Gemy" +"1474402042527","datatable(head(BaseballSalary,50), options = list(scrollX=T, pageLength = 8))","Gemy" +"1474402042630","","Gemy" +"1474402042630","col.use=brewer.pal(10, RdYlBu)","Gemy" +"1474402042650","hist.1985=hist(filter(BaseballSalary, year==1985)$salary,","Gemy" +"1474402042651","main=salaries in 1985,","Gemy" +"1474402042652","xlab=annual salary,","Gemy" +"1474402042653","col=col.use,","Gemy" +"1474402042653","nclass = 50)","Gemy" +"1474402042744","hist(filter(BaseballSalary, year==2004)$salary,","Gemy" +"1474402042744","main=salaries in 2004,","Gemy" +"1474402042745","xlab=annual salary,","Gemy" +"1474402042746","col=col.use,","Gemy" +"1474402042746","nclass = 50)","Gemy" +"1474402042806","par(mfrow=c(2,1))","Gemy" +"1474402042808","hist.1985=hist(filter(BaseballSalary, year==1985)$salary,","Gemy" +"1474402042809","main=salaries in 1985,","Gemy" +"1474402042809","xlab=annual salary,","Gemy" +"1474402042810","col=col.use,","Gemy" +"1474402042810","nclass = 50,","Gemy" +"1474402042811","ylim=c(0, 250))","Gemy" +"1474402042856","hist(filter(BaseballSalary, year==2004)$salary,","Gemy" +"1474402042857","col=col.use,","Gemy" +"1474402042858","breaks=c(hist.1985$breaks, max(BaseballSalary$salary)),","Gemy" +"1474402042858","main=salaries in 2004,","Gemy" +"1474402042859","xlab=annual salary,","Gemy" +"1474402042860","xlim=c(0, 2000000),","Gemy" +"1474402042861","ylim=c(0,250),","Gemy" +"1474402042862","freq=T)","Gemy" +"1474402042894","","Gemy" +"1474402042894","par(mfrow=c(1,1))","Gemy" +"1474402042895","plot(salary~as.factor(year), data=BaseballSalary, col=col.use)","Gemy" +"1474402043084","","Gemy" +"1474402043084","BSTeamYear=BaseballSalary%>%","Gemy" +"1474402043085","group_by(teamID, year)%>%","Gemy" +"1474402043086","summarize(","Gemy" +"1474402043087","count=n(),","Gemy" +"1474402043088","total=sum(salary),","Gemy" +"1474402043089","median=median(salary),","Gemy" +"1474402043089","min=min(salary),","Gemy" +"1474402043090","max=max(salary),","Gemy" +"1474402043091","q1=quantile(salary, .25),","Gemy" +"1474402043092","q3=quantile(salary, .75)","Gemy" +"1474402043093",")","Gemy" +"1474402044438","BSTeamYear=as.data.frame(BSTeamYear)","Gemy" +"1474402044439","sample_n(BSTeamYear, 10)","Gemy" +"1474402044453","","Gemy" +"1474402044454","datatable(filter(BSTeamYear, year==2004), options = list(scrollX=T, pageLength = 10))","Gemy" +"1474402044595","BS2004=filter(BaseballSalary, year==2004)","Gemy" +"1474402044598","plot(as.factor(BS2004$teamID), BS2004$salary, col=col.use, las=2)","Gemy" +"1474402044778","BS2004[which.max(BS2004$salary),]","Gemy" +"1474402092832","col.use=brewer.pal(10, RdYlBu)","Gemy" +"1474402092834","hist.1985=hist(filter(BaseballSalary, year==1985)$salary,","Gemy" +"1474402092834","main=salaries in 1985,","Gemy" +"1474402092835","xlab=annual salary,","Gemy" +"1474402092836","col=col.use,","Gemy" +"1474402092836","nclass = 50)","Gemy" +"1474402092907","hist(filter(BaseballSalary, year==2004)$salary,","Gemy" +"1474402092908","main=salaries in 2004,","Gemy" +"1474402092908","xlab=annual salary,","Gemy" +"1474402092909","col=col.use,","Gemy" +"1474402092909","nclass = 50)","Gemy" +"1474402092964","par(mfrow=c(2,1))","Gemy" +"1474402092965","hist.1985=hist(filter(BaseballSalary, year==1985)$salary,","Gemy" +"1474402092966","main=salaries in 1985,","Gemy" +"1474402092966","xlab=annual salary,","Gemy" +"1474402092967","col=col.use,","Gemy" +"1474402092967","nclass = 50,","Gemy" +"1474402092968","ylim=c(0, 250))","Gemy" +"1474402093017","hist(filter(BaseballSalary, year==2004)$salary,","Gemy" +"1474402093018","col=col.use,","Gemy" +"1474402093019","breaks=c(hist.1985$breaks, max(BaseballSalary$salary)),","Gemy" +"1474402093020","main=salaries in 2004,","Gemy" +"1474402093021","xlab=annual salary,","Gemy" +"1474402093021","xlim=c(0, 2000000),","Gemy" +"1474402093022","ylim=c(0,250),","Gemy" +"1474402093023","freq=T)","Gemy" +"1474402884241","which.max(BS2004$salary)","Gemy" +"1474403065317","View(mlb2014)","Gemy" +"1474403090366","mlb2014=read_csv(file=data/mlb2014.csv)","Gemy" +"1474403263926","mlb2014=read_csv(file=data/mlb2014.csv, na=c(, -, NA))","Gemy" +"1474403289606","dim(mlb2014)","Gemy" +"1474403289607","datatable(select(sample_n(mlb2014,50), ends_with(G)), options = list(scrollX=T, pageLength = 5))","Gemy" +"1474557540603","install.packages(swirl)","Gemy" +"1474557560915","library(swirl)","Gemy" +"1474557567511","swirl()","Gemy" +"1474557787310","swirl()","Gemy" +"1474557823112","H <-read.table(~/.rstudio-desktop/history_database, sep=:, fill=T, stringsAsFactors=F)","Gemy" +"1474557823254","names(H) <- c(time, answer)","Gemy" +"1474557823266","H$id <- YOUR NAME","Gemy" +"1474557823279","write.csv(H, file = lesson1.csv, row.names = FALSE)","Gemy" +"1474557856887","swirl()","Gemy" +"1474557877672","5+7","Gemy" +"1474557911446","x <- 5_7","Gemy" +"1474557917278","x <- 5+7","Gemy" +"1474557925687","x","Gemy" +"1474557934392","y <- x-3","Gemy" +"1474557938049","y","Gemy" +"1474557981679","z <- c(1, 2, 3,4 )","Gemy" +"1474558007269","z <- (1.1, 9, 3.14)","Gemy" +"1474558015222","z <- c(1.1, 9, 3.14)","Gemy" +"1474558024478","?c","Gemy" +"1474558028606","z","Gemy" +"1474558047525","c(z, 555, z)","Gemy" +"1474558066063","bye()","Gemy" +"1474558075555","H <-read.table(~/.rstudio-desktop/history_database, sep=:, fill=T, stringsAsFactors=F)","Gemy" +"1474558075611","names(H) <- c(time, answer)","Gemy" +"1474558075611","H$id <- YOUR NAME","Gemy" +"1474558075612","write.csv(H, file = lesson1.csv, row.names = FALSE)","Gemy" +"1474558097814","H <-read.table(~/.rstudio-desktop/history_database, sep=:, fill=T, stringsAsFactors=F)","Gemy" +"1474558097866","names(H) <- c(time, answer)","Gemy" +"1474558097867","H$id <- Gemy","Gemy" +"1474558097867","write.csv(H, file = lesson1.csv, row.names = FALSE)","Gemy" +"1474558389368","swirl()","Gemy" +"1474558400863","2","Gemy" +"1474558582888","bye()","Gemy" +"1474558589011","swirl()","Gemy" +"1474558664940","x <- c(44, NA, 5, NA)","Gemy" +"1474558669552","x*3","Gemy" +"1474558683902","y <- rnorm(1000)","Gemy" +"1474558693412","z <- rep(NA, 1000)","Gemy" +"1474558718926","my_data <- sample(c(y,z), 100)","Gemy" +"1474558759753","my_na <- is.na(my_data)","Gemy" +"1474558804443","my_na","Gemy" +"1474558833083","my_data ==NA","Gemy" +"1474558908366","sum(my_na)","Gemy" +"1474558919806","my_data","Gemy" +"1474558930427","0/0","Gemy" +"1474558938606","Inf-Inf","Gemy" +"1474559020453","TRUE == TRUE","Gemy" +"1474559035001","(FALSE == TRUE) == FALSE","Gemy" +"1474559115371","6==7","Gemy" +"1474559125771","6<7","Gemy" +"1474559134677","10<=10","Gemy" +"1474559168516","5 !=7","Gemy" +"1474559193688","5 !=7","Gemy" +"1474559210720","5 !==7","Gemy" +"1474559219959","5 !== 7","Gemy" +"1474559234587","!5==7","Gemy" +"1474559358036","FALSE & FALSE","Gemy" +"1474559537777","library(swirl)","Gemy" +"1474559537809","install_course(Exploratory_Data_Analysis)","Gemy" +"1474559633768","info()","Gemy" +"1474559664143","TRUE & c(TRUE, FALSE, FALSE)","Gemy" +"1474559696526","TRUE && c(TRUE, FALSE, FALSE)","Gemy" +"1474559743518","TRUE | c(TRUE, FALSE, FALSE)","Gemy" +"1474559757061","TRUE || c(TRUE, FALSE, FALSE)","Gemy" +"1474559856785","5 > 8 || 6!=8 && 4 > 3.9","Gemy" +"1474560191316","isTRUE(6>4)","Gemy" +"1474560259612","indentical(twins, twins)","Gemy" +"1474560265765","identical(twins, twins)","Gemy" +"1474560423724","xor(5==6, !FALSE)","Gemy" +"1474560627812","ints <- sample(10)","Gemy" +"1474560722227","ints","Gemy" +"1474560730443","ints> 5","Gemy" +"1474560776670","which(ints>7)","Gemy" +"1474560828325","bye()","Gemy" +"1474560843670","H <-read.table(~/.rstudio-desktop/history_database, sep=:, fill=T, stringsAsFactors=F)","Gemy" diff --git a/test.Rmd b/test.Rmd new file mode 100644 index 0000000..f5f623b --- /dev/null +++ b/test.Rmd @@ -0,0 +1,59 @@ +--- +title: "Test" +author: "Gemy Pham" +date: "September 27, 2016" +output: word_document +--- + +#This is a Test File for the Data Mining Class + +*is this going to be italic* + +**I want this to be bold** + +###This is a link to my Github + +[link](https://github.com/gemypham) + +>is this a quote? + +* list of things to try out +* what to do today + + drink + + cool + +-- now I am going to make a table by myself -- + +Table 1 | Table 2 +--------|-------- +Cell 1 | Cell 2 + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +``` + +```{r} + + +``` + + +## R Markdown + +This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see . + +When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: + +```{r iris} +summary(iris) +``` + +## Including Plots + +You can also embed plots, for example: + +```{r pressure, echo=FALSE} +plot(pressure) +``` + +Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.