From 2930203018a0bc0425d791a5c3536d5872e99148 Mon Sep 17 00:00:00 2001 From: BenjaminGreat Date: Wed, 28 Sep 2016 18:03:49 -0400 Subject: [PATCH 1/3] g --- Class 4 Swirl.Rproj | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Class 4 Swirl.Rproj diff --git a/Class 4 Swirl.Rproj b/Class 4 Swirl.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/Class 4 Swirl.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 From bf844d464e9bd43ae5d348b90ae7f9e29ed1978c Mon Sep 17 00:00:00 2001 From: BenjaminGreat Date: Wed, 28 Sep 2016 18:22:11 -0400 Subject: [PATCH 2/3] Hello --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore 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 From 3d953fbe90086423d1605ccd343edc064edb231e Mon Sep 17 00:00:00 2001 From: BenjaminGreat Date: Wed, 28 Sep 2016 18:25:12 -0400 Subject: [PATCH 3/3] helloworld --- lesson1.csv | 6572 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 6572 insertions(+) create mode 100644 lesson1.csv diff --git a/lesson1.csv b/lesson1.csv new file mode 100644 index 0000000..dea115e --- /dev/null +++ b/lesson1.csv @@ -0,0 +1,6572 @@ +"time","answer","id" +"1464019377539","5+2","YOUR NAME" +"1464019482315","77+876","YOUR NAME" +"1464019897647","480install.packages","YOUR NAME" +"1464019914194","install.packages(graphics)","YOUR NAME" +"1464019962821","install.packages(graphics)","YOUR NAME" +"1464020005034","demo(images)","YOUR NAME" +"1464020247405","","YOUR NAME" +"1464020473299","","YOUR NAME" +"1464020485104","","YOUR NAME" +"1464020531638","","YOUR NAME" +"1464020608226","22*4","YOUR NAME" +"1464020682726","7^2","YOUR NAME" +"1464020806966","x <- 5","YOUR NAME" +"1464020814868","x <- 5","YOUR NAME" +"1464020827149","","YOUR NAME" +"1464020834993","x","YOUR NAME" +"1464020842711","x + 7","YOUR NAME" +"1464020847625","x*3","YOUR NAME" +"1464020857499","X ","YOUR NAME" +"1464020876117","y <- 2000","YOUR NAME" +"1464020894512","x + y","YOUR NAME" +"1464021082779","z <- y/x","YOUR NAME" +"1464021251940","","YOUR NAME" +"1464021251951","x","YOUR NAME" +"1464021251961","x + 7","YOUR NAME" +"1464021251973","x*3","YOUR NAME" +"1464021251985","x^2","YOUR NAME" +"1464021336227","x <- 5","YOUR NAME" +"1464021341001","x","YOUR NAME" +"1464021347601","y <- 2000","YOUR NAME" +"1464021352360","z <- y/x","YOUR NAME" +"1464021355402","z","YOUR NAME" +"1464021545515","assign(y,100)","YOUR NAME" +"1464021606328","20","YOUR NAME" +"1","","YOUR NAME" +"1464021619345","20","YOUR NAME" +"1","","YOUR NAME" +"1464021628071","2.3","YOUR NAME" +"24.3","","YOUR NAME" +"1464021665613","seq(from = 2, to = 8, by = 1)","YOUR NAME" +"1464021673092","seq(from = 2, to = 8, by = 0.1)","YOUR NAME" +"1464021686990","seq(from = 2, to = 8, by = 0.01)","YOUR NAME" +"1464021695318","x <- 1","YOUR NAME" +"10","","YOUR NAME" +"1464022104099","x + 3","YOUR NAME" +"1464022146941"," 5 +1464195758878:1:10 == 5 +1464195776009:1:9 == 9:1 +1464195796847:1:10 == c(1, 3, 2, 4, 3, 5, 7, 6, 5, 10) +1464195893828:1:10 +1464195940352:1:10 == 1:2 +1464195947411:1:2 == 1:10 +1464195977989:1:10 == 1:5 +1464195984838:1:10 == 1:4 +1464196023168:vec1 <- c(4.4, 2.5, 6.1, 3.3, 1.6) +1464196208728:which(1:10 == 6) +1464196228521:which(is.na(vect)) +1464196295686:length(which(is.na(vector))) +1464196532234:which(ecls$MIRT > 70 & ecls$RIRT > 70) +1464196699338:(ind <- which(ecls$MIRT > 70 & ecls$RIRT > 70)) +1464196719313:ecls[ind,] +1464660208763:class(5) +1464660210957:is.numeric(5) +1464660217101:is.integer(5) +1464660219124:is.integer(5L) +1464660244140:`class<-`(8) +1464660254622:is.numeric(8) +1464660256692:a<-8 +1464660258931:b<-8L +1464660271800:class<-(8) +1464660274578:is.numeric(8) +1464660276704:a<-8 +1464660467498:x <- xyz +1464660469144:x +1464660473049:class(x) +1464660481549:nchar(x) # Number of characters. +1464660583081:c<-bdnf +1464660584436:c +1464660585858:class<-(character(bdnf)) +1464660607027:class<-(character(bdnf)) +1464660655620:c<-bdnf +1464660656670:c +1464660657673:class<-(bdnf) +1464660692871:class<-(c) +1464660698171:class<-(c) +1464660712219:c<-bdnf +1464660714253:c +1464660716499:class<-(c) +1464661258180:class(TRUE) +1464661261928:class(T) # Abbreviation for TRUE; avoid using it. +1464661269697:T <- 3 +1464661271568:class(T) +1464661276277:rm(T) # Remove T from workspace so it is once again undefined +1464661284637:log0 <- logical(10) +1464661288660:log0 +1464661356332:log10()<-(10) +1464661394050:log1<- logical(10) +1464661414943:log1 +1464661441375:log0<- logical(0) +1464661460960:log0 +1464661505980:class(TRUE) +1464661507837:class(T) # Abbreviation for TRUE; avoid using it. +1464661511801:T <- 3 +1464661514163:class(T) +1464661873551:class(TRUE) +1464661875273:class(d) +1464661877295:d<-3 +1464661918339:class(TRUE) +1464661919681:TRUE<-3 +1464661953346:class(TRUE) +1464661954444:Class(T) +1464661956112:T<-3 +1464661984290:class(TRUE) +1464661985252:class(T) # Abbreviation for TRUE; avoid using it. +1464661989559:T <- 3 +1464661991551:class(T) +1464662315690:class(TRUE) +1464662316906:T<-3 +1464662451519:class(TRUE) +1464662452826:d 70) +1464742469168:hist(ecls$RIRT) +1464742470422:which(ecls$RIRT > 70) +1464742472715:which(ecls$MIRT > 70 & ecls$RIRT > 70) +1464742578657:T <- 0 +1464742595129:mean(my_nums, na.rm = TRUE) # Without abbreviation. +1464742647082:TRUE<20 +1464742653125:30 +1464742709336:1:10 > 5 +1464742760799:1:40 > 20 +1464742811397:MIRT +1464742892557:MIRT(<20) +1464742902087:MIRT(0<20) +1464742943423:hist(MIRT) +1464742956797:range(MIRT) +1464743162803:1:9 == 9:1 +1464743169109:1:10 == c(1, 3, 2, 4, 3, 5, 7, 6, 5, 10) +1464743207257:help(colon) +1464743415257:hist(ecls$MIRT) +1464743417072:which(ecls$MIRT > 70) +1464743436221:which(ecls$RIRT > 70) +1464743438018:which(ecls$MIRT > 70 & ecls$RIRT > 70) +1464743534835:which(MIRT<20) +1464743601420:which(MIRT<20) +1464743670201:which(MIRT<20=TRUE) +1464743685164:which(MIRT<20=TRUE) +1464743794516:!TRUE +1464743796519:!FALSE +1464743798316:!(5 == 3) +1464743800223:!(5 == 5) +1464743934477:MIRT<=20(TRUE) +1464743962564:20<=MIRT +1464744210489:hist(MIRT) +1464744260620:which(MIRT<15) +1464744533234:15<=MIRT +1464744581407:MIRT +1464744622757:which(MIRT<15) +1464746507712:help(grep) +1464748499370:txt <- c(The, licenses, for, most, software, are, +1464748499928:designed, to, take, away, your, freedom, +1464748500340:to, share, and, change, it., +1464748500587:"", By, contrast,, the, GNU, General, Public, License, +1464748500849:is, intended, to, guarantee, your, freedom, to, +1464748501127:share, and, change, free, software, --, +1464748501250:to, make, sure, the, software, is, +1464748501561:free, for, all, its, users) +1464748716363:nchar(c)) +1464748727430:nchar(txt)) +1464748925846:txt <- c(The, licenses, for, most, software, are, +1464748926099:designed, to, take, away, your, freedom, +1464748926392:to, share, and, change, it., +1464748926643:"", By, contrast,, the, GNU, General, Public, License, +1464748926775:is, intended, to, guarantee, your, freedom, to, +1464748927017:share, and, change, free, software, --, +1464748927273:to, make, sure, the, software, is, +1464748932457:free, for, all, its, users","","YOUR NAME" +"1464748957574","x = char_vec","YOUR NAME" +"1464749015480","text(= char_vec)","YOUR NAME" +"1464749032714","","YOUR NAME" +"1464749033156","txt <- c(The, licenses, for, most, software, are,","YOUR NAME" +"1464749033373","designed, to, take, away, your, freedom,","YOUR NAME" +"1464749033653","to, share, and, change, it.,","YOUR NAME" +"1464749033797",", By, contrast,, the, GNU, General, Public, License,","YOUR NAME" +"1464749033997","is, intended, to, guarantee, your, freedom, to,","YOUR NAME" +"1464749034236","share, and, change, free, software, --,","YOUR NAME" +"1464749034421","to, make, sure, the, software, is,","YOUR NAME" +"1464749034661","free, for, all, its, users +1464749034906:### (b) Use the nchar function to create a vector that represent the number +1464749035081:### of characters in each position of the vector. +1464749035314:text(= char_vec) +1464749035615:### (c) Use the range function to determine the min and max number of +1464749036024:### characters. +1464749087953:range())) +1464749109524:txt <- c(The, licenses, for, most, software, are, +1464749109951:designed, to, take, away, your, freedom, +1464749117071:txt <- c(The, licenses, for, most, software, are, +1464749118196:designed, to, take, away, your, freedom, +1464749118776:to, share, and, change, it., +1464749119013:"", By, contrast,, the, GNU, General, Public, License, +1464749119431:is, intended, to, guarantee, your, freedom, to, +1464749119663:share, and, change, free, software, --, +1464749120247:to, make, sure, the, software, is, +1464749121646:free, for, all, its, users","YOUR NAME" +"1464749154123","txt <- c(The, licenses, for, most, software, are,","YOUR NAME" +"1464749154350","designed, to, take, away, your, freedom,","YOUR NAME" +"1464749154769","to, share, and, change, it.,","YOUR NAME" +"1464749155115",", By, contrast,, the, GNU, General, Public, License,","YOUR NAME" +"1464749155178","is, intended, to, guarantee, your, freedom, to,","YOUR NAME" +"1464749155425","share, and, change, free, software, --,","YOUR NAME" +"1464749155674","to, make, sure, the, software, is,","YOUR NAME" +"1464749156179","free, for, all, its, users +1464749200509:range()) +1464750017313:grep(pattern = GEND, x = char_vec, ignore.case = FALSE) +1464750029883:grep(pattern = GEND, x = char_vec, ignore.case = FALSE) +1464750049681:gsub(pattern = IRT, replacement = cct, x = char_vec) # replaces all +1464750050312:# instances of IRT +1464750051207:### min(), max(), and range() +1464750051985:### These functions identify the minimum value, maximum value, and range +1464750052502:### (both min and max) for a vector. +1464750053019:set.seed(5026) +1464750053585:nv <- round(rnorm(10), 1) # Generate 10 random standard normal deviates, +1464750053996:# rounded to one decimal place. +1464750054625:nv +1464750056268:min(nv) # The minimum value is -1.2. +1464750174842:txt <- c(The, licenses, for, most, software, are, +1464750175609:designed, to, take, away, your, freedom, +1464750177289:to, share, and, change, it., +1464750178043:"", By, contrast,, the, GNU, General, Public, License, +1464750178644:is, intended, to, guarantee, your, freedom, to, +1464750179506:share, and, change, free, software, --, +1464750180195:to, make, sure, the, software, is, +1464750181503:free, for, all, its, user +1464750207249:txt +1464750300986:nchar(txt) +1464750347375:nchar(txt) +1464750425474:range(min=txt) +1464750740280:range(txt) +1464750790054:range(is.character(txt) +1464750820320:range(is.character(txt:letters) +1464750899126:x = char_vec +1464751059885:min(txt) +1464751085780:min(txt) +1464751109350:max(txt) +1464751142322:range(txt) +1464751187091:min(nv) # The minimum value is -1.2. +1464751191431:which(nv == -1.2) # The 2nd element in the vector is the minimum. +1464751273952:min(txt) +1464751363060:(max(character(txt))) +1464751381383:(max(character() +1464751409753:txt <- c(The, licenses, for, most, software, are, +1464751410127:designed, to, take, away, your, freedom, +1464751417773:txt <- c(The, licenses, for, most, software, are, +1464751418778:designed, to, take, away, your, freedom, +1464751419621:to, share, and, change, it., +1464751420375:"", By, contrast,, the, GNU, General, Public, License, +1464751421202:is, intended, to, guarantee, your, freedom, to, +1464751421972:share, and, change, free, software, --, +1464751422688:to, make, sure, the, software, is, +1464751423471:free, for, all, its, user +1464751444111:nchar(txt) +1464751468194:range(txt) +1464751589401:grep(pattern = txt, x = char_vec, ignore.case = FALSE) +1464751622542:grep(pattern = txt, to = char_vec, ignore.case = FALSE) +1464751644552:grep(pattern = to, x = char_vec, ignore.case = FALSE) +1464751658286:grep(pattern = GEND, x = char_vec, ignore.case = FALSE) +1464751659595:grep(pattern = FIR, x = char_vec, ignore.case = FALSE) +1464751664465:gsub(pattern = IRT, replacement = cct, x = char_vec) # replaces all +1464751754952:grep(pattern = GEND, x = char_vec, ignore.case = FALSE) +1464751766861:ecls$MIRT[ind] +1464751767506:ecls$RIRT[ind] +1464751914034:grep(pattern = GEND, x = char_vec, ignore.case = FALSE) +1464751921640:grep(pattern = FIR, x = char_vec, ignore.case = FALSE) +1464751946054:class(5) +1464751946604:is.numeric(5) +1464751946832:### The default type for a number is numeric. In order specify that a number +1464751947061:### be treated as an integer, append an L. +1464751947226:is.integer(5) +1464751947399:is.integer(5L) +1464751947628:n1 <- 5L +1464751947971:n1 +1464751948216:is.integer(n1) +1464751948373:is.numeric(n1) +1464751948611:### Note that R will automatically reclassify numbers when appropriate. +1464751948754:class(2L) +1464751949002:class(2L*3L) +1464751949291:class(2L/3L) +1464751949440:### Can generate a vector of zeros of class numeric or integer +1464751949699:num0 <- numeric(10) +1464751950426:int0 <- integer(10) +1464751950465:int0 +1464751950625:num0 +1464751950908:### Vectors can have a class as well. +1464751950962:class(int0) +1464751951404:### Changing only one element to a non-integer changes the class of the vector +1464751951465:### to numeric +1464751951633:int0[5] <- 2.5 +1464751952199:class(int0) +1464751952224:int0 +1464751952463:### Square brackets are used in R to subset vectors or matrices. +1464751952674:(vec <- c(2,4,3,39,NA,23.2,pi,0/0)) +1464751952900:### What is the 3rd element of vec? +1464751953462:vec[3] +1464751953551:### What is the 5th element of vec? +1464751953620:vec[5] +1464751953909:### What is the length of vec? +1464751954051:length(vec) +1464751954355:### What are the 1st, 2nd, and 8th elements of vec? +1464751954589:vec[c(1, 2, 8)] +1464751954810:### What are the last 3 elements of vec? +1464751955040:vec[6:8] +1464751955261:### What are all the elements of vec except the 3rd? +1464751955490:vec[-3] +1464751955747:### Replace the 8th element of vec with 1000. +1464751955878:vec[8] <- 1000 +1464751956152:vec +1464751956443:### Replace the first four elements of vec with 0s. +1464751956658:vec[1:4] <- numeric(4) +1464751956848:vec +1464751956999:################## +1464751957472:### BEGIN TASK ### +1464751957521:################## +1464751957809:### Look at the head of the data frame +1464751958096:head(ecls) +1464751958270:### What are the dimensions of the data frame? +1464751958533:dim(ecls) +1464751958847:### As we will learn, there are many ways to access a particular variable in +1464751959026:### a data frame. One way is to append $ followed by the variable name to +1464751959312:### the name of the data frame. For example, +1464751959616:ecls$GENDER +1464751959873:ecls$WKWHITE +1464751960167:### Your task is to use the class function to determine the class of all 7 +1464751960461:### variables in ecls data frame. +1464751960845:################ +1464751961101:### END TASK ### +1464751961407:################ +1464751961691:### Now that you've finished the task, you can cheat and use the str function +1464751961990:### to get the structure of the ecls data frame. +1464751962351:str(ecls) +1464751962614:### :::::::::::::::::::: ### +1464751962760:### :: Character data :: ### +1464751963152:### :::::::::::::::::::: ### +1464751963234:### Characters-type data are quoted character strings. +1464751963662:x <- xyz +1464751963824:x +1464751964214:class(x) +1464751964415:nchar(x) # Number of characters. +1464751964604:### Look at the head (i.e., first 6 rows) of the ecls data +1464751964887:head(ecls) +1464751965172:### What are the dimensions of the ecls data frame? +1464751965381:dim(ecls) +1464751965678:### What are the names of the variables? +1464751965920:names(ecls) +1464751966204:### Assign the vector of variable names to char_vec +1464751966440:char_vec <- names(ecls) # Create a vector based on the names of the iris data. +1464751966663:char_vec +1464751967198:length(char_vec) +1464751967478:### Can generate a character vector of empty quotes +1464751967624:char_vec[4] +1464751967788:chr0 <- character(10) +1464751968458:class(chr0) +1464751968567:### Remember our numeric vector num0 +1464751968747:num0 +1464751969174:### Change the 5th element to a character +1464751969352:num0[5] <- char +1464751969805:num0 +1464751969907:class(num0) +1464751970270:### ::::::::::::: ### +1464751970579:### :: Logical :: ### +1464751970817:### ::::::::::::: ### +1464751971082:### Logical values are either TRUE, FALSE, or NA. +1464751971361:class(TRUE) +1464751971734:class(T) # Abbreviation for TRUE; avoid using it. +1464751971902:T <- 3 +1464751972480:rm(T) # Remove T from workspace so it is once again undefined +1464751972534:class(T) +1464751972651:log0 <- logical(10) +1464751972929:log0 +1464751973485:### of the elements changes class. +1464751973519:### Again, notice that vector class is converted when at least one +1464751973843:log0[5] <- 5 +1464751974002:log0 +1464751974527:class(log0) +1464751974809:### Logicals are often used in function calls. For example, +1464751975078:sample(1:10, 5, replace = TRUE) +1464751975474:sample(1:10, 5, replace = FALSE) +1464751975774:### ::::::::::: ### +1464751975997:### :: Dates :: ### +1464751976362:### ::::::::::: ### +1464751976590:### Since dates carry special meaning throught their format, +1464751976881:### additional effort is required to handle them appropriately. +1464751976989:### The function as.Date() is used to translate character string dates into +1464751977399:### numeric date variables stored in R. The syntax is as.Date(x, input_format), +1464751977643:### where x is the character vector of dates and input_format tells R how to +1464751977851:### read in the dates. +1464751978155:### Date formats +1464751978386:### ------------------------------------ +1464751978675:### Symbol Meaning Example +1464751978921:### --------- ----------------- -------- +1464751979145:### %d Day as a number 01-31 +1464751979435:### %a Abbr. weekday Mon +1464751979791:### %A Unabbr. weekday Monday +1464751979991:### %m Month as number 01-12 +1464751980216:### %b Abbr. month Jan +1464751980531:### %B Unabbr. month January +1464751980762:### %Y 2-digit year 07 +1464751981090:### %y 4-digit year 2007 +1464751981296:### ------------------------------------ +1464751981612:string_dates <- c(2014-06-03, 2014-06-19) +1464751981741:string_dates +1464751982471:mydates <- as.Date(c(2014-06-03, 2014-06-19)) +1464751982589:mydates +1464751982864:### They look the same BUT... +1464751983228:class(string_dates) +1464751983399:class(mydates) +1464751983624:### R stores dates numerically as the number of days since January 1, 1970. +1464751983927:### The date is arbitrary, coding dates after 1/1/70 as positive and dates +1464751984175:### before as negative. The coding is helpful because it enables us to perform +1464751984340:### arithmetic operations on dates. +1464751984686:string_dates - 500 # Error +1464751984942:mydates - 500 # This gives the *date* 500 days before each date in our vector. +1464751985220:### My oldest son's birthday is 2006-05-18 +1464751985545:keegan_bday <- as.Date(2006-05-18) +1464751985815:today <- Sys.Date() # system's idea of current date without time +1464751986220:### Sys.time() # system's idea of current date with time +1464751986515:(days_old <- today - keegan_bday) ### How many days old? +1464751986671:### Note: the calculations account for leap years. +1464751986885:### 2015 was not a leap year so Feb had 28 days. +1464751987072:diff(as.Date(c(2015-02-28, 2015-03-01))) +1464751987553:### 2016 was a leap year so Feb had a 29th day. +1464751987690:diff(as.Date(c(2016-02-28, 2016-03-01))) +1464751988037:### How many years old? +1464751988135:days_old %/% 365 # throws an error +1464751988482:as.numeric(days_old) %/% 365 +1464751988936:### How many days since his birthday? Have to subtract off 3 leap years (2008, +1464751989070:### 2012, 2016) +1464751989373:as.numeric(days_old) %% 365 - 3 +1464751989641:################## +1464751989911:### BEGIN TASK ### +1464751990167:################## +1464751990417:### How many days have you been alive for? +1464751990661:### How many days since your last birthday (accounting for leap years)? +1464751990828:################## +1464751991124:### END TASK ##### +1464751991418:################## +1464751991742:############################################################################### +1464751992005:### LOGICAL OPERATIONS AND VECTORS ############################################ +1464751992301:############################################################################### +1464751992504:### ::::::::::::::::::::::: ### +1464751992877:### :: Logical Operators :: ### +1464751993060:### ::::::::::::::::::::::: ### +1464751993370:### Allowed logical values are TRUE (abbreviated 'T'), FALSE ('F'), and NA. +1464751993616:### Use the full word TRUE or FALSE instead of T or F because, though +1464751993902:### the abbreviations work most of the time, there are cases when they can +1464751994141:### fail. For example, let's say we want to take the mean of a list of numbers +1464751994435:### but we want R to remove any missing data before taking the mean. +1464751994681:?mean +1464751995034:### The default value is na.rm = FALSE but we want na.rm = TRUE. +1464751995229:my_nums <- c(1, 4, 3, 5, 3, 2, 6, 3, NA, 2, NA, 1, 9, 6, 7, 8, 8) +1464751995685:mean(my_nums) +1464751995995:mean(my_nums, na.rm = TRUE) # Without abbreviation. +1464751996206:mean(my_nums, na.rm = T) # With abbreviation, same result, no problem. +1464751996438:### Suppose T had been defined earlier as follows: +1464751996869:T <- 0 +1464751997058:mean(my_nums, na.rm = TRUE) # Without abbreviation. +1464751997204:mean(my_nums, na.rm = T) # With abbreviation gives unintented result, and, +1464751997509:# dangerously, note there was no warning. +1464751997836:### Logical vectors are vectors that have elements that are logical values. +1464751998022:### They are most often created when some sort of a comparison is made using +1464751998381:### a relational operator. +1464751998510:?!= +1464751998970:### '==' same as, '!=' different from, < less than, > greater than, +1464751999111:### '<=' less than or equal to, >= greater than or equal to. +1464751999937:### These are binary operators which are used to compare values. +1464752000090:5 < 10 +1464752000138:### They may be used on scalars: +1464752000287:5 < 0 +1464752000549:5 == 5 +1464752000841:5 <= 5 +1464752000991:5 != 5 +1464752001120:5 <= 3 +1464752001301:################## +1464752001734:### BEGIN TASK ### +1464752001985:################## +1464752002232:### First, grab the GENDER variable from ecls and rename it in the global +1464752002509:### environment. Note: 1 = male and 0 = female. +1464752002803:c6math <- ecls$C6R4MSCL +1464752003107:### Histogram +1464752003399:hist(c6math) +1464752003640:### Range +1464752004212:### Mean +1464752004259:range(c6math) +1464752004300:mean(c6math) +1464752004636:### Create a logical vector that is TRUE if the math score is above the mean +1464752004871:### and FALSE if the math score is below the mean. Call the vector abovAVG. +1464752005202:### Convert the logical vector to a numeric vector of 0s and 1s. Do you predict +1464752005517:### there will be more students above avg, below avg, or equal numbers? +1464752005771:### Make a table. How many students are there in total? How many above average? +1464752006090:### Relate this information to the shape of the histogram. +1464752006259:################## +1464752006662:### END TASK ##### +1464752006825:################## +1464752007174:### One of the useful features of the R language is called vectorization. +1464752007340:### This refers to when an operation for scalars is applied to a vector and R +1464752007670:### intelligently applies the operation to each element in the vector. +1464752007981:### The logical operators may be vectorized as follows, for example: +1464752008226:1:10 > 5 +1464752008437:1:10 == 5 +1464752008789:### With vectors of the same size it does elementwise comparison +1464752009081:1:9 == 9:1 +1464752009280:1:10 == c(1, 3, 2, 4, 3, 5, 7, 6, 5, 10) +1464752009584:### With two vectors of different length, R will use up the elements in the +1464752009851:### smaller vector and then recycle it up to the length of the larger vector. +1464752010063:### If length of the larger vector is a multiple of the length of the smaller +1464752010325:### vector there will be no warning. If the length is not a multiple a warning +1464752010609:### will be thrown. +1464752010861:1:10 == 1:2 +1464752011095:1:2 == 1:10 +1464752011495:1:10 == 1:5 +1464752011673:1:10 == 1:4 +1464752011915:### Vectorized addition: +1464752012251:vec1 <- c(4.4, 2.5, 6.1, 3.3, 1.6) +1464752012460:vec2 <- 10 + vec1 +1464752012874:vec2 +1464752013118:### The 'which' function is very useful for indexing. It expects a vector of +1464752013416:### logical values as input and it tells you the positions of the TRUEs. +1464752013777:?which +1464752014113:### It returns *indices* associated with a value of TRUE. +1464752014826:which(1:10 == 5) +1464752015002:vect <- c(3, 5, 2, 6, 3, NA, 3, 4, NA) +1464752015216:which(c(TRUE, FALSE, TRUE, TRUE, FALSE)) +1464752015404:is.na(vect) +1464752015931:which(is.na(vect)) +1464752015994:stri <- c(yes, no, yes, no, no, NA) +1464752016462:stri +1464752016782:which(stri == 'yes') +1464752016923:### With a character vector, you must use quotes. +1464752017192:letters +1464752017448:which(letters == a) # error +1464752017761:which(letters == 'a') +1464752018071:which(letters == 'q') +1464752018361:### The ampersand & means and. +1464752018685:5 > 3 & 4 < 100 # both TRUE, so TRUE +1464752018931:5 > 3 & 4 > 100 # at least one FALSE, so FALSE +1464752019220:### The pipe | means or. +1464752019454:5 == 3 & 4 == 100 # both FALSE, so FALSE +1464752019763:5 > 3 & 4 < 100 # at least one TRUE, so TRUE +1464752020037:### The exclamation mark ! means not. +1464752020331:!TRUE +1464752020621:!FALSE +1464752020909:!(5 == 3) +1464752021186:!(5 == 5) +1464752021428:### Logicals can be combined with which(). +1464752021746:hist(ecls$MIRT) +1464752021923:which(ecls$MIRT > 70) +1464752022181:hist(ecls$RIRT) +1464752022439:which(ecls$RIRT > 70) +1464752022862:which(ecls$MIRT > 70 & ecls$RIRT > 70) +1464752023137:### Store the indexes as a vector +1464752023485:### What are the actual MIRT and RIRT scores of the cases that satisfy +1464752023543:(ind <- which(ecls$MIRT > 70 & ecls$RIRT > 70)) +1464752023780:### the inequality? +1464752024280:ecls$RIRT[ind] +1464752024340:ecls$MIRT[ind] +1464752024479:################## +1464752024651:### BEGIN TASK ### +1464752025039:################## +1464752025108:### Which cases in the ecls data had a math outcome score (C6R4MSCL) higher +1464752025422:### than 160? +1464752025657:### What are the actual math outcome scores for those cases? +1464752025959:### Which cases in the ecls data had a math outcome score higher than 160 +1464752026231:### OR lower than 60? +1464752026443:################## +1464752026737:### END TASK ##### +1464752026960:################## +1464752027270:### grep is a useful function that is like which() but it searches for strings +1464752027556:### matching its first argument. +1464752027783:grep(pattern = GEND, x = char_vec, ignore.case = FALSE) +1464752028249:grep(pattern = FIR, x = char_vec, ignore.case = FALSE) +1464752031072:gsub(pattern = IRT, replacement = cct, x = char_vec) # replaces all +1464752032980:# instances of IRT +1464752033419:### min(), max(), and range() +1464752033692:### These functions identify the minimum value, maximum value, and range +1464752034167:### (both min and max) for a vector. +1464752034545:set.seed(5026) +1464752035124:nv <- round(rnorm(10), 1) # Generate 10 random standard normal deviates, +1464752035461:# rounded to one decimal place. +1464752035740:nv +1464752036042:min(nv) # The minimum value is -1.2. +1464752036329:which(nv == -1.2) # The 2nd element in the vector is the minimum. +1464752036649:############################################################################### +1464752036970:### HOMEWORK #2 ############################################################### +1464752071155:txt <- c(The, licenses, for, most, software, are, +1464752071910:designed, to, take, away, your, freedom, +1464752072349:to, share, and, change, it., +1464752072743:"", By, contrast,, the, GNU, General, Public, License, +1464752073278:is, intended, to, guarantee, your, freedom, to, +1464752073583:share, and, change, free, software, --, +1464752074111:to, make, sure, the, software, is, +1464752074726:free, for, all, its, user +1464752075703:### (b) Use the nchar function to create a vector that represent the number +1464752076260:### of characters in each position of the vector. +1464752076850:nchar(txt) +1464752091751:nchar(txt) +1464752093943:### (c) Use the range function to determine the min and max number of +1464752094213:### characters +1464752094478:range(txt) +1464752096795:### (d) Use the grep function to determine which indices contain the string +1464752097068:### to. +1464752097363:grep(pattern = to, x = char_vec, ignore.case = FALSE) +1464752283986:help(grep) +1464752777156:grep(pattern = to, x = char_vec, ignore.case = TRUE) +1464753077107:grep(pattern = to, txt = char_vec, ignore.case = TRUE) +1464753161038:grep(pattern = txt, x = char_vec, ignore.case = FALSE ) +1464753247670:grep(pattern = c, x = char_vec, ignore.case = FALSE ) +1464753427285:gsub(pattern = to, x = char_vec, perl = FALSE, fixed = FALSE, useBytes = FALSE ) +1464782867011:gsub(replacement = the = duh, x = char_vec, perl = FALSE, fixed = FALSE, useBytes = FALSE ) +1464782999096:gsub(replacement = the = duh, x = txt, perl = FALSE, fixed = FALSE, useBytes = FALSE ) +1464783000770:help(grep) +1464783008308:### (d) Use the grep function to determine which indices contain the string +1464783008992:### to. +1464783009975:gsub(replacement = the = duh, x = txt, perl = FALSE, fixed = FALSE, useBytes = FALSE ) +1464783064614:gsub(pattern, replacement = the = duh, x = txt, perl = FALSE, fixed = FALSE, useBytes = FALSE ) +1464783503380:grep(pattern = GEND, x = char_vec, ignore.case = FALSE) +1464783506264:grep(pattern = FIR, x = char_vec, ignore.case = FALSE) +1464783534736:gsub(pattern = IRT, replacement = cct, x = char_vec) # replaces all # instances of IRT +1464783780708:gsub(pattern== = txt, replacement = the = duh, x = txt, perl = FALSE, fixed = FALSE, useBytes = FALSE ) +1464783796083:gsub(pattern = txt, replacement = the = duh, x = txt, perl = FALSE, fixed = FALSE, useBytes = FALSE ) +1464783824783:gsub(pattern = the, replacement = duh, x = txt, perl = FALSE, fixed = FALSE, useBytes = FALSE ) +1464783937265:range(txt) +1464783982087:min(txt) +1464784098755:grep(pattern = to, x = char_vec, ignore.case = FALSE) +1464784114032:grep(pattern = to, x = txt, ignore.case = FALSE) +1464784432443:grep(pattern = ic, x = txt, ignore.case = FALSE) +1464788763723:nchar(txt) +1464788796353:range(txt) +1464788798061:max(txt) +1464796860175:set.seed(3498) +1464796860654:rnorm(10) +1464796868771:set.seed(3498) +1464796869204:rnorm(10) +1464796952873:sample(1:100, size =25, replace = FALSE) +1464797043939:mat1 <- matrix(data = NA, nrow = 3, ncol = 5, byrow = FALSE) +1464797055292:mat2 +1464797062813:mat1 <- matrix(data = NA, nrow = 3, ncol = 5, byrow = FALSE) +1464797063285:mat1 +1464797067533:is.logical(mat1) +1464797069943:mat2 <- matrix(data = 0, nrow = 3, ncol = 5, byrow = FALSE) +1464797072146:mat2 +1464797079214:is.numeric(mat2) +1464797211189:mat3 <- matrix(data = c(Horace Mann, Grace Dodge, Zenkel, Thompson, +1464797212220:Thorndike, Macy), +1464797360969:mat1 <- matrix(data = 1:15, nrow = 3, ncol = 5, byrow = FALSE) +1464797366005:mat1 +1464797371670:mat1[1, 5] # first index is row #, second index is col # +1464797372747:mat1[ , 2] # if index is omitted, assumes you want them all +1464797373808:mat1[2, ] +1464797395858:mat1 <- matrix(data = NA, nrow = 3, ncol = 5, byrow = FALSE) +1464797396320:mat1 +1464797396804:is.logical(mat1) +1464797397242:mat2 <- matrix(data = 0, nrow = 3, ncol = 5, byrow = FALSE) +1464797397620:mat2 +1464797397875:is.numeric(mat2) +1464797398021:matrix(data = -4, nrow = 3, ncol = 5, byrow = FALSE) +1464797398196:matrix(data = 1:15, nrow = 3, ncol = 5, byrow = FALSE) +1464797398393:matrix(data = 1:15, nrow = 3, ncol = 5, byrow = TRUE) # note the difference in +1464797398576:# how matrix was filled. +1464797398775:mat3 <- matrix(data = c(Horace Mann, Grace Dodge, Zenkel, Thompson, +1464797399323:Thorndike, Macy), +1464797399623:nrow = 3, ncol = 2, byrow = FALSE) +1464797400232:mat3 +1464797401683:is.character(mat3) +1464797402323:### Matrices can be subset with two indices. +1464797402954:mat1 <- matrix(data = 1:15, nrow = 3, ncol = 5, byrow = FALSE) +1464797403591:mat1 +1464797404138:mat1[1, 5] # first index is row #, second index is col # +1464797405704:mat1[ , 2] # if index is omitted, assumes you want them all +1464797406343:mat1[2, ] +1464797408770:mat1[,] +1464797502553:### 'dim' gives the dimensions of a matrix +1464797503070:dim(mat1) # rows then columns +1464797503823:nrow(mat1) +1464797504508:ncol(mat1) +1464797515338:mat1 +1464797516787:t(mat1) # t() takes the transpose of a matrix. +1464797517970:### 'head' prints the first 6 (by default) rows of a matrix. +1464797518278:### 'tail' prints the last 6 (by default) rows of a matrix. +1464797518514:### Another way to make a matrix is to bind vectors of the same size together +1464797518639:### with cbind or rbind. +1464797518944:a <- 1:5 +1464797531298:b <- c(3, 5, 4, 5, 3) +1464797534957:mat4 <- cbind(a,b) # c is for column binding +1464797535520:mat4 +1464797536542:mat5 <- rbind(a,b) # r is for row binding +1464797684935:mtr1<- matrix(data = NA, nrow = 3, ncol = 5, byrow = FALSE) +1464797696720:mtr1 +1464797708327:mtr1<- matrix(data = 0, nrow = 3, ncol = 5, byrow = FALSE) +1464797711470:mtr1 +1464797721322:mtr1<- matrix(data = 0, nrow = 3, ncol = 4, byrow = FALSE) +1464797722239:mtr1 +1464797902471:mtr2<-matrix(data = 100, nrow = 10, ncol = 10, byrow =FALSE) +1464797914397:mtr2 +1464797948027:mtr2<-matrix(data = 10,25, nrow = 10, ncol = 10, byrow =FALSE) +1464797971033:mtr2<-matrix(data = 1:25, nrow = 10, ncol = 10, byrow =FALSE) +1464797992354:mtr2 +1464798093788:a <- 1:5 +1464798094683:b <- c(3, 5, 4, 5, 3) +1464798104689:mat4 <- cbind(a,b) # c is for column binding +1464798106587:mat4 +1464798336033:mtr2 +1464798371395:mtr2<- cbind(a,b) +1464798387759:mtr2 +1464798674802:mtr2<-matrix(data = str(2), nrow = 2, ncol = 2, byrow =FALSE) +1464798814027:str2<- c(10, 10, 10, 10, 10, 25, 25, 25, 25, 25) +1464798863585:str2<- c(10, 10, 10, 10, 10, 25, 25, 25, 25, 25) +1464798873142:mtr2<-matrix(data = stir2 , nrow = 2, ncol = 2, byrow =FALSE) +1464798908614:mtr2<-matrix(data = str2 , nrow = 2, ncol = 2, byrow =FALSE) +1464798924423:mtr2 +1464799516661:load(C","YOUR NAME" +"/Users/Ben/Downloads/5026/5026.RData) +1464799534383:View(ecls) +1464799558788:View(mat1) +1464799560847:View(ecls) +1464799581000:View(ecls) +1464799611284:View(ecls) +1464799634323:View(ecls) # Spreadsheet view of ecls data frame +1464799640701:head(ecls) # First 6 rows. +1464799641055:is.data.frame(ecls) # Is iris a data frame? +1464799642170:str(ecls) # displays the structure +1464799647858:View(ecls) +1464799657421:View(ecls) +1464799711684:load(C","/Users/Ben/Downloads/5026/5026.RData) +1464799716223:View(ecls) +1464799718141:View(ecls) +1464799832388:ecls[1,] # gives the first row of the dataset +1464799833341:ecls[,1] # gives the first columnn of data +1464799865242:ecls[1,] # gives the first row of the dataset +1464799889182:ecls[,1] # gives the first columnn of data +1464799948975:ecls$GENDER # also gives the first column of data +1464799949492:ecls[,c(GENDER)] # another way +1464799951706:### 'attach'ing a data frame makes the variable names available in the global +1464799952201:### environment. +1464799960969:attach(ecls) +1464799963608:table(GENDER) +1464800026050:mean(RIRT) +1464800026523:detach(ecls) +1464800245323:### Attaching is convenient because it shortens the calls to variables in +1464800245648:### the attached data frame. +1464800245821:table(ecls$GENDER) +1464800285446:search((ecls)) +1464800337114:table(ecls$GENDER) +1464800338079:table(ecls$F5SPECS) # child received special education services +1464800338981:table(ecls$P1FIRKDG) # child's first time in kindergarten +1464800341029:### Two-way tables are possible as well +1464800341594:( tab1 <- table(gend = ecls$GENDER, specEd = ecls$F5SPECS) ) +1464800566741:margin.table(tab1, margin = 1) +1464800580608:margin.table(tab1, margin = 2) +1464800619571:### CrossTable gives more detailed output +1464800620087:install.packages(gmodels) +1464800631247:library(gmodels) +1464800641219:CrossTable(ecls$GENDER, ecls$F5SPECS) +1464800774051:phi <- (158*173 - 126*82)/sqrt(240*299*284*255) +1464800788570:phi +1464800800744:cor(ecls$GENDER, ecls$F5SPECS, method = pearson) +1464800805894:cor +1464800854940:table(gender = ecls$GENDER, specEd = ecls$F5SPECS, firK = ecls$P1FIRKDG) +1464801036156:ecls$gend_fact <- factor(ecls$GENDER, +1464801037173:levels = c(0, 1), +1464801037995:labels = c(female, male)) +1464801052589:head(ecls) +1464801053996:str(ecls) +1465215055043:setwd(C","YOUR NAME" +"/Users/Ben/Downloads/5026) +1465215315356:install.packages(read.table(state.abb)) +1465215754816:read.table((state.abb)) +1465215777264:state.abb +1465216405240:state.abb +1465216457390:state.abb +1465216465720:state.abb +1465216503217:which(NY) +1465216749273:help(which) +1465217220274:which(LETTERS== NY) +1465217528462:which(state.abb-< NY) +1465217551401:which(state.abb == NY) +1465218144340:min(state.abb) +1465218161305:min(state.area) +1465218490271:which(state.abb == min(state.area)) +1465218964400:which(c(TRUE, FALSE, TRUE, TRUE, FALSE)) +1465218973659:which(1:10 == 5) +1465218984839:is.na(vect) +1465218989646:which(is.na(vect)) +1465218998953:vec1 <- c(4.4, 2.5, 6.1, 3.3, 1.6) +1465219000519:vec2 <- 10 + vec1 +1465219001477:vec2 +1465219006422:vect <- c(3, 5, 2, 6, 3, NA, 3, 4, NA) +1465219008427:is.na(vect) +1465219011321:which(is.na(vect)) +1465219014194:stri <- c(yes, no, yes, no, no, NA) +1465219016168:stri +1465219018513:which(stri == 'yes') +1465219025186:which(letters == 'a') +1465219026949:which(letters == 'q') +1465219247769:state.abb +1465219507086:min(state.abb == 1214) +1465219597822:Which(state.abb <=1214) +1465219625833:Which(state.abb <=state.area 1214) +1465219648993:Which(state.abb <=state.area 1214) +1465219674679:Which(state.abb <= min(state.area)) +1465219770216:state.x77 +1465219812241:dim(state.x77) +1465219932940:is.matrix(state.xx77) +1465219940936:is.matrix(state.x77) +1465219963064:is.data.frame(state.x77) +1465219989284:# 4. Turn it into a data frame with data.frame() and call it df.x77. +1465220044306:data.frame(state.x77) +1465220049812:data.frame(state.x77) +1465220082131:data.frame(state.x77 == df.x77) +1465220463196:data.frame(state.x77) +1465220499213:state.x77-< df.x77 +1465220723596:state.x77<-df.x77 +1465220754241:data.frame(state.x77<-dfx77) +1465221130567:df.x77 <- data.frame(state.x77) +1465221182007:attach(df.x77) +1465221193558:df.x77 +1465221318706:plot(x = HS.Grad, y = Income) +1465221501232:detach(df.x77) +1465221674889:##It appears to be a positive linear relationship. As HiS.Grad increases so does Income. +1465221731829:##It is merely the appearance of a correlation. +1465221774608:set.seed(5026) +1465221923749:treatment_status<-(1:50 = 0,1) +1465221930315:treatment_status<-(1:50 == 0,1) +1465221937095:treatment_status<-(1:50) +1465222189065:sample(x= 20:60, size = 50, replace = TRUE) +1465222238310:age<-sample(x = 20:60, size = 50, replace = TRUE) +1465222313536:income<- sample(x = c(low, middle, high), size = 50, replace = TRUE) +1465222326279:income +1465222335626:age +1465222396852:outcome- apply(m, c(1,2), function(x) sample(c(0,1),1) +1465224795805:mat1 <- matrix(data = NA, nrow = 3, ncol = 5, byrow = FALSE) +1465224797134:mat1 +1465224802701:mat2 <- matrix(data = 0, nrow = 3, ncol = 5, byrow = FALSE) +1465224803752:mat2 +1465224821721:mat1 <- matrix(data = 1:15, nrow = 3, ncol = 5, byrow = FALSE) +1465224822914:mat1 +1465224823899:mat1[1, 5] # first index is row #, second index is col # +1465224824461:mat1[ , 2] # if index is omitted, assumes you want them all +1465224835037:a <- 1:5 +1465224836278:b <- c(3, 5, 4, 5, 3) +1465224837552:mat4 <- cbind(a,b) # c is for column binding +1465224838562:mat4 +1465224859435:a<-1:10 +1465224860257:b<-10:25 +1465224863995:mtr2 +1465224864595:mtr2<- cbind(a,b) +1465224872333:str2<- c(10, 10, 10, 10, 10, 25, 25, 25, 25, 25) +1465224876043:mtr2<-matrix(data = str2 , nrow = 2, ncol = 2, byrow =FALSE) +1465224877167:mtr2 +1465224878340:mtr2<-matrix(data = cbind()) +1465225144310:treatment_status<-replace = TRUE +1465227756244:manager <- c(67, 211, 263, 211, 67, 263, 162, 121, 243, 263, 211, 121, 211, +1465227757055:243, 211, 158, 30, 30, 243, 76, 243, 67, 162, 243, 158) +1465227757671:country <- c(US, UK, UK, UK, US, UK, US, US, UK, UK, UK, +1465227757884:US, UK, UK, UK, US, US, US, UK, US, UK, US, +1465227758335:US, UK, US) +1465227758754:gender <- c(F, M, M, M, F, M, F, F, M, M, M, F, M, +1465227759030:M, M, F, F, F, M, M, M, F, F, M, F) +1465227759326:age <- c(64, 46, 49, 31, -9999, 67, 22, 18, 64, 24, 37, 36, 18, 20, 49, 28, 40, +1465227759504:39, 54, 47, 35, 49, 81, 58, 50) +1465227759787: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) +1465227760034: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) +1465227760216: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) +1465227760265: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) +1465227760748: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) +1465227760814:leadership <- data.frame(manager, country, gender, age, q1, q2, q3, +1465227761071:q4, q5, stringsAsFactors=FALSE) +1465227811557:which(leadership$age == -9999) +1465227812770:leadership$age[which(leadership$age == -9999)] +1465227813607:leadership$age[which(leadership$age == -9999)] <- NA +1465227836552:leadership$age[5] <- -9999 +1465227837587:leadership +1465227895447:leadership$age == -9999 +1465227896562:leadership$age[leadership$age == -9999] <- NA +1465227897655:leadership +1465228028441:which(leadership$age == -9999) +1465228029292:leadership$age[which(leadership$age == -9999)] +1465228030275:leadership$age[which(leadership$age == -9999)] <- NA +1465228031291:leadership +1465228034203:### Put it back to -9999 +1465228035958:leadership$age[5] <- -9999 +1465228040360:leadership$age == -9999 +1465228041688:leadership$age[leadership$age == -9999] <- NA +1465228042255:leadership +1465228043180:### Put it back to -9999 +1465228044984:leadership$age[5] <- -9999 +1465228054601:leadership +1465228114777:leadership$age[5] <- -9999 +1465228115477:leadership +1465228127724:leadership <- edit(leadership) +1465228790971:manager <- c(67, 211, 263, 211, 67, 263, 162, 121, 243, 263, 211, 121, 211, +1465228791534:243, 211, 158, 30, 30, 243, 76, 243, 67, 162, 243, 158) +1465228791608:country <- c(US, UK, UK, UK, US, UK, US, US, UK, UK, UK, +1465228792096:US, UK, UK, UK, US, US, US, UK, US, UK, US, +1465228792463:US, UK, US) +1465228792858:gender <- c(F, M, M, M, F, M, F, F, M, M, M, F, M, +1465228793174:age <- c(64, 46, 49, 31, -9999, 67, 22, 18, 64, 24, 37, 36, 18, 20, 49, 28, 40, +1465228793483:39, 54, 47, 35, 49, 81, 58, 50) +1465228793608: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) +1465228793819: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) +1465228794242: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) +1465228794281: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) +1465228794701:leadership <- data.frame(manager, country, gender, age, q1, q2, q3, +1465228796048:############################################################################### +1465228796458:### TASK: replace -9999 with a missing NA value. +1465228796703:which(leadership$age == -9999) +1465228797188:leadership$age[which(leadership$age == -9999)] <- NA +1465228797429:leadership +1465228798075:leadership$age[5] <- -9999 +1465228798716:### Second way - subset using logical vector. +1465228799523:leadership$age[leadership$age == -9999] <- NA +1465228799738:leadership +1465228799914:leadership +1465228800070:### Third way - use the spreadsheet interface to change it by hand. +1465228800164:leadership$age[5] <- -9999 +1465228800200:### First way - use the which() function to get the index explicitly. +1465228800354:### Note: on a mac, you will need to install XQuartz first from +1465228800388:### Put it back to -9999 +1465228800842:leadership +1465228801063:### here https://www.xquartz.org/ +1465228801117:leadership$age[which(leadership$age == -9999)] +1465228801308:leadership <- edit(leadership) +1465228801509:### Put it back to -9999 +1465228801708:### 1. RECODE VALUES ########################################################## +1465228802053:leadership$age[5] <- -9999 +1465228802077:############################################################################### +1465228802484:M, M, F, F, F, M, M, M, F, F, M, F) +1465228802578:### Put it back to -9999 +1465228802825: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) +1465228802913:leadership +1465228803177:leadership$age == -9999 +1465228803451:q4, q5, stringsAsFactors=FALSE) +1465228804606:leadership +1465228805042:### Fourth way - subset row and column numerically. +1465228805595:names(leadership) == age +1465228816503:### 25 employees and their ratings by their managers based on five statements +1465228816981:manager <- c(67, 211, 263, 211, 67, 263, 162, 121, 243, 263, 211, 121, 211, +1465228817515:243, 211, 158, 30, 30, 243, 76, 243, 67, 162, 243, 158) +1465228817901:country <- c(US, UK, UK, UK, US, UK, US, US, UK, UK, UK, +1465228818381:US, UK, UK, UK, US, US, US, UK, US, UK, US, +1465228818766:US, UK, US) +1465228819360:gender <- c(F, M, M, M, F, M, F, F, M, M, M, F, M, +1465228819574:M, M, F, F, F, M, M, M, F, F, M, F) +1465228820000:age <- c(64, 46, 49, 31, -9999, 67, 22, 18, 64, 24, 37, 36, 18, 20, 49, 28, 40, +1465228820557:39, 54, 47, 35, 49, 81, 58, 50) +1465228820775: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) +1465228821274: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) +1465228821529: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) +1465228821705: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) +1465228822279: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) +1465228823886:leadership <- data.frame(manager, country, gender, age, q1, q2, q3, +1465228825051:q4, q5, stringsAsFactors=FALSE) +1465228825758:leadership +1465228826463:############################################################################### +1465228827366:### 1. RECODE VALUES ########################################################## +1465228827454:############################################################################### +1465228827914:### TASK: replace -9999 with a missing NA value. +1465228828180:### First way - use the which() function to get the index explicitly. +1465228828430:which(leadership$age == -9999) +1465228828691:leadership$age[which(leadership$age == -9999)] +1465228828921:leadership$age[which(leadership$age == -9999)] <- NA +1465228829243:leadership +1465228829479:### Put it back to -9999 +1465228829853:leadership$age[5] <- -9999 +1465228830139:leadership +1465228830407:### Second way - subset using logical vector. +1465228831021:leadership$age == -9999 +1465228831211:leadership$age[leadership$age == -9999] <- NA +1465228831897:leadership +1465228832335:### Put it back to -9999 +1465228832710:leadership$age[5] <- -9999 +1465228833311:leadership +1465228833765:### Third way - use the spreadsheet interface to change it by hand. +1465228834129:### Note: on a mac, you will need to install XQuartz first from +1465228834492:### here https://www.xquartz.org/ +1465228834903:leadership <- edit(leadership) +1465228840111:### Put it back to -9999 +1465228841894:leadership$age[5] <- -9999 +1465228842473:leadership +1465228842912:### Fourth way - subset row and column numerically. +1465228843349:names(leadership) == age +1465228843450:which(names(leadership) == age) +1465228843945:leadership[5,4] <- NA +1465228844308:leadership +1465228844636:g +1465228844844:### Put it back to -9999 +1465228845322:leadership$age[5] <- -9999 +1465228845809:leadership +1465228847053:### Fifth way - Recode the entire data frame all at once +1465228848866:leadership == -9999 # gives a logical matrix +1465228849415:leadership[leadership == -9999] <- NA # subset by the matrix +1465228849918:leadership +1465228850147:### It is also possible to recode (relevel) variables. Suppose we want to define +1465228851044:### a categorical age variable based on age. One approach is to create a new +1465228851692:### variable and then put it back into the data frame. +1465228852066:### Create an empty character variable called age_cat. +1465228852186:leadership$age_cat <- NA +1465228852794:leadership +1465229057769:leadership$age_cat[leadership$age > 65] <- Elder +1465229108165:leadership +1465229112599:leadership$age_cat[leadership$age >= 45 & leadership$age <= 65] <- Middle Aged +1465229114560:leadership +1465229124447:leadership$age_cat[leadership$age < 45] <- Younger +1465229274722:leadership +1465229275315:### Make sure you check the missing value +1465229275943:leadership$age_cat[is.na(leadership$age)] <- NA +1465229278316:leadership +1465229501034:### Make the vector an ordered factor. +1465229501155:leadership$age_cat <- factor(leadership$age_cat, +1465229501803:ordered = TRUE) +1465229501984:str(leadership) +1465229502291:levels = c(Younger, Middle Aged, Elder), +1465229502500:### The above can also be accomplished with the 'within' function. +1465229502651:leadership <- within(leadership, { +1465229503075:age_cat2 <- NA +1465229503765:age_cat2[age > 65] <- Elder +1465229504058:age_cat2[age >= 45 & age <= 65] <- Middle Aged +1465229504518:age_cat2[age < 45] <- Younger +1465229504854:age_cat2 <- factor(age_cat2, +1465229505283:levels = c(Younger, Middle Aged, Elder), +1465229505650:ordered = TRUE) +1465229506524:}) +1465229507248:leadership +1465229507891:str(leadership) +1465230329301:leadership$gend_fac<-[leadership$gender_fac=M,L] +1465230968957:helpo(NA) +1465230974334:help(NA) +1465231476902:sub2 <- leadership$age_cat != Elder +1465231479009:sub2 +1465231542254:sum(sub2, na.rm = TRUE) +1465231545240:df2 <- subset(x = leadership, subset = sub2) +1465231546932:df2 +1465231551276:### Are the approaches identical? +1465231551927:df1 == df2 +1465231600476:### Can also subset by column to eliminate variables. For example, create +1465231600627:### a subset that no longer includes the age_cat or age_cat2 variables. +1465231600868:dim(leadership) +1465231602776:names(leadership) +1465231630900:### Which columns are the age_cat columns? +1465231634783:grep(age_cat, x = names(leadership)) +1465231682700:### Want all columns *except* the last two. +1465231682983:sel1 <- names(leadership)[-c(10,11)] +1465231683301:df3 <- subset(x = leadership, select = sel1) +1465231683971:dim(df3) +1465231684873:df3 +1465231717176:help(grep) +1465232293983:help(dim) +1465232305708:dim(leadership) +1465232341561:sub1 <- leadership$gender<-FEMALE +1465232544396:leadershiph$gend_fac<-leadership$gender == F. +1465232556597:leadershiph$gend_fac<-leadership$gender == F +1465232563467:leadership$gend_fac<-leadership$gender == F +1465232591485:F +1465232608031:leadership$gend_fac +1465232771869:leadership$gend_fac[grep (f, names (leadership))] +1465232787502:leadership$gend_fac[grep (t, names (leadership)) +1465232788731:################## +1465232854692:sub2 <- leadership$age_cat != Elder +1465316753947:rep(0:1, 25) +1465316866293:min(state.area) +1465316875324:state.area +1465316915233:which(state.area == 1214) +1465316965303:state.abb[39] +1465316990457:max(state.area) +1465317041800:which(state.area == max(state.area)) +1465317065047:state.abb[2] +1465317087464:state.abb[which(state.area == max(state.area))] +1465317137886:state.abb[which(state.area == min(state.area))] +1465317206854:USArrests +1465317228366:?USArrests +1465317288406:?data.frame +1465317314198:apropos(what = frame) +1465317371232:str(USArrests) +1465317388205:USArrests +1465317400191:rownames(USArrests) +1465317415695:attributes(USArrests) +1465317562059:by(data = USArrests$Murder, INDICES = USArrests$UrbanPop>50, mean) +1465351179765:plot(USArrests) +1465351585012:plot(USArrests) +1465351585291:plot(USArrests$Murder, USA$ +1465351588011:plot(USArrests) +1465351588028:plot(USArrests$Murder, USA$ +1465351589890:plot(USArrests) +1465351590101:plot(USArrests$Murder, USA$ +1465351656472:plot(USArrests$Murder, USA$Assault) +1465351675887:plot(USArrests$Murder== USA$Assault) +1465351696167:plot(USArrests$Murder:USA$Assault) +1465351710190:plot(USArrests) +1465351716846:plot(USArrests$Murder:USA$Assault) +1465351734397:plot(USArrests$Murder:US$Assault) +1465351748921:plot(USArrests$Murder:USArrests$Assault) +1465351767654:plot(USArrests$Murder, USArrests$Assault) +1465354860129:USArrests$UrbanPop(%>80) +1465355005594:USArrests$UrbanPop(%%>80) +1465355014688:USArrests$UrbanPop(1%%>80) +1465355135596:df$percent<- prop.table(USArrests$UrbanPop) +1465355190055:df$percent<- prop.table(df$USArrests$UrbanPop) +1465355211972:percent<- prop.table(dfUSArrests$UrbanPop) +1465355222821:percent<- prop.table(USArrests$UrbanPop) +1465355235510:percent<- prop.table(USArrests$UrbanPop) +1465355260910:percent +1465355581375:percent(USArrests>80) +1465355592887:percent +1465355597909:percent +1465356876505:df1 == df2 +1465386100758:state.area +1465386413434:USArrests +1465387310673:?USArrests +1465387540042:?data.frame +1465387544456:apropos(what =frame) +1465388124884:columnnames(USArrests) +1465388157339:attributes(names(USArrests) +1465388170819:attributesnames(USArrests) +1465388212795:attributes(USArrests) +1465388232263:$class +1465388288466:str(USArrests) +1465388293516:$class +1465388757551:ordered = TRUE) +1465388799495:ordered = TRUE) +1465388850539:levels = c(low, middlelow, middle-high, high) +1465388862577:Assault_Cat +1465388874425:Assault_cat +1465388901945:Assault_cat +1465389353257:USArrests <- NA +1465389390292:USArrests$Assault <- NA +1465389543816:USArrests$Assault <-[USArrests$Assault<=110]<- Elder +1465389574876:USArrests$Assault <-[ USArrests$Assault<=110]<- Elder +1465389610193:Assault_cat <-[ USArrests$Assault<=110]<- Elder +1465389653632:Assault_cat <-[USArrests$Assault<=110]<- low +1465389861249:Assault_cat <-[USArrests$Assault<=110]<- low +1465389885733:Assault_cat <-[USArrests$Assault<=110]<- low] +1465390175125:Assault_cat <-(USArrests$Assault>250)<-high +1465390461593:Assault_cat[USArrests$Assault<=110]<- low +1465390505674:Assault_Cat <- NA +1465390508622:Assault_cat[USArrests$Assault<=110]<- low +1465390556198:levels = c(low, middlelow, middle-high, high) +1465390562849:Assault_cat<- factor(USArrests$Assault, +1465390563826:levels = c(low, middlelow, middle-high, high) +1465390571284:Assault_cat[USArrests$Assault<=110]<- low +1465391771458:dft1<- subset(USArrests), subset(sub1) +1465392742162:percent[USArrests$UrbanPop>80] +1465392758392:percent[USArrests$UrbanPop>80] +1465392887655:by(data = USArrests$Murder, INDICES = USArrests$UrbanPop>50, mean) +1465392890096:USArrests$UrbanPop > 50: FALSE +1465392892044:[1] 8.311111 +1465393130187:### TASK 2 +1465393281597:USArrests +1465393283721:?USArrests +1465393306811:USArrests +1465393307710:?USArrests +1465393312350:?data.frame +1465393313758:apropos(what =frame) +1465393319275:str(USArrests) +1465393322258:rownames(USArrests) +1465393329167:attributes(USArrests) +1465393337753:plot(USArrests) +1465393339805:plot(USArrests$Murder, USArrests$Assault) +1465393710633:USArrests$Assault_cat->NA +1465393796689:leadership$age_cat <- NA +1465393821799:q4, q5, stringsAsFactors=FALSE) +1465393828920:243, 211, 158, 30, 30, 243, 76, 243, 67, 162, 243, 158) +1465393832753:country <- c(US, UK, UK, UK, US, UK, US, US, UK, UK, UK, +1465393834198:US, UK, UK, UK, US, US, US, UK, US, UK, US, +1465393834908:US, UK, US) +1465393835592:gender <- c(F, M, M, M, F, M, F, F, M, M, M, F, M, +1465393837669:M, M, F, F, F, M, M, M, F, F, M, F) +1465393838393:age <- c(64, 46, 49, 31, -9999, 67, 22, 18, 64, 24, 37, 36, 18, 20, 49, 28, 40, +1465393838973:39, 54, 47, 35, 49, 81, 58, 50) +1465393839488: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) +1465393840174: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) +1465393841528: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) +1465393842165: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) +1465393844034: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) +1465393845165:leadership <- data.frame(manager, country, gender, age, q1, q2, q3, +1465393846844:q4, q5, stringsAsFactors=FALSE) +1465393849136:leadership +1465393996308:USArrests$Assault<-Assault_Cat +1465394003632:USArrests$Assault<-Assault_cat +1465394048558:USArrests$Assault +1465394069261:Assault_cat[USArrests$Assault<=110]<- low +1465394184828:USArrests$Assault<=110]<- low +1465394195850:Assault_cat[USArrests$Assault<=250]<- middle-high +1465394222855:[USArrests$Assault<=110]<- low +1465394244767:[USArrests$Assault<=110]<- low +1465394246750:[USArrests$Assault<=160]<- middle-low +1465394247543:[USArrests$Assault<=250]<- middle-high +1465394248290:[USArrests$Assault>250]<- high +1465394270944:levels = c(low, middlelow, middle-high, high) +1465394277020:[USArrests$Assault<=110]<- low +1465394369232:USArrests<-[USArrests$Assault<=110]<- low +1465394452839:USArrests$Assault<-[USArrests$Assault<=110]<- low +1465394472875:USArrests$Assault<-USArrests$Assault<=110<- low +1465394488200:USArrests$Assault<-(USArrests$Assault<=110)<- low +1465394615434:USArrests$Assault<-x +1465394629545:USArrests$Assault<-(x +1465394638482:USArrests$Assault<-(x) +1465394682422:USArrests$Assault<-NA +1465394685864:USArrests$Assault<-[USArrests$Assault<=110]<- low +1465394700652:[USArrests$Assault<=160]<- middle-low +1465394758718:leadership <- edit(leadership) +1465394816691:is.data.frame(Assault_cat) +1465394841699:USArrests[USArrests$Assault<=160]<- middle-low +1465394873861:USArrests$Assault<-[USArrests$Assault<=110]<- low +1465394876953:USArrests[USArrests$Assault<=160]<- middle-low +1465394892028:levels = c(low, middlelow, middle-high, high) +1465394896053:is.data.frame(Assault_cat) +1465395071103:levels = c(low, middlelow, middle-high, high), ordered = (TRUE) +1465395099048:ordered = (TRUE) +1465395106825:is.data.frame(Assault_cat) +1465395657066:USArrests<-within(USArrests, +1465395657691:Assault_cat2 <-NA +1465395658267:Assault_cat2 [USArrests$Assault<=110]<- low +1465395663877:Assault_cat2 [USArrests$Assault<=160]<- low +1465395664699:Assault_cat2 [USArrests$Assault<=250]<- middle-high +1465395665212:Assault_cat2 [USArrests$Assault>250]<- high +1465395666029:Assault_cat<- factor(Assault_cat2, +1465395667174:levels = c(low, middlelow, middle-high, high) +1465395670017:ordered = (TRUE) +1465395944221:USArrests<-within(USArrests, { +1465395944951:Assault_cat2 <-NA +1465395945351:Assault_cat2 [USArrests$Assault<=110]<- low +1465395945632:Assault_cat2 [USArrests$Assault<=160]<- low +1465395946043:Assault_cat2 [USArrests$Assault<=250]<- middle-high +1465395946313:Assault_cat2 [USArrests$Assault>250]<- high +1465395946951:Assault_cat<- factor(Assault_cat2, +1465395947454:levels = c(low, middlelow, middle-high, high) +1465395948160:ordered = (TRUE) }) +1465396004708:USAArrests(string) +1465396012285:USArrests(string) +1465396027045:USArrests$Assault(string) +1465396061836:string(USArrests$Assault) +1465396092578:dft1<- subset(USArrests), subset(sub1) +1465396107103:dft1<- subset(USArrests$UrbanPop), subset(sub1) +1465396236279:dim(USArrests) +1465396240509:dft1<- subset(USArrests$UrbanPop), subset(sub1) +1465396266518:dft1<- subset(USArrests$UrbanPop), subset =(sub1) +1465396301450:dft1<- subset(USArrests$UrbanPop) +1465396376837:sub1<- subset(USArrests$UrbanPop)<=50 +1465396525837:dim(USArrests) +1465396528124:sub1<- subset(USArrests$UrbanPop)<=50 +1465396529127:sub1 +1465396530567:sum(sub1, na.rm = TRUE) +1465396542293:df1 <- subset(USArrests, subset = sub1) +1465396543188:dim(df1) +1465396544133:table(df1$age_cat, useNA = always) +1465396717820:USArrests$Assault_cat<-[USArrests$Assault<=110]<- low +1465396778990:USArrests$Assault_cat<- NA +1465396782875:USArrests$Assault_cat<-[USArrests$Assault<=110]<- low +1465396820755:USArrests$Assault_cat[USArrests$Assault<=110]<- low +1465396823167:USArrests$Assault_cat[USArrests$Assault<=160]<- middle-low +1465396824280:USArrests$Assault_cat[USArrests$Assault<=250]<- middle-high +1465396825089:USArrests$Assault_cat[USArrests$Assault>250]<- high +1465396826031:Assault_cat<- factor(USArrests$Assault, +1465396828162:levels = c(low, middlelow, middle-high, high) +1465396828950:ordered = (TRUE) +1465396899149:ordered = (TRUE)) +1465396922196:Assault_cat<- factor(USArrests$Assault, +1465396923249:levels = c(low, middlelow, middle-high, high) +1465396924714:ordered = (TRUE)) +1465397007316:Assault_cat<- factor(USArrests$Assault_cat, +1465397008452:levels = c(low, middlelow, middle-high, high) +1465397009059:ordered = (TRUE)) +1465397035428:ordered = (TRUE) +1465397041735:is.data.frame(Assault_cat) +1465397077033:Assault_cat<- factor(USArrests$Assault_cat, +1465397077050:levels = c(low, middlelow, middle-high, high), +1465397077069:ordered = (TRUE) +1465397079358:Assault_cat<- factor(USArrests$Assault_cat, +1465397079372:levels = c(low, middlelow, middle-high, high), +1465397079390:ordered = (TRUE) +1465397091880:ordered = (TRUE)) +1465397134149:ordered = (TRUE) +1465397143381:USArrests$Assault_cat<- factor(USArrests$Assault_cat, +1465397143394:levels = c(low, middlelow, middle-high, high), +1465397143407:ordered = (TRUE) +1465397160714:ordered = (TRUE)) +1465397200063:USArrests$Assault_cat<- factor(USArrests$Assault_cat, +1465397200077:levels = c(low, middle-low, middle-high, high), +1465397200092:ordered = (TRUE)) +1465397219083:is.data.frame(Assault_cat) +1465397272694:is.data.frame(USArrests$Assault_cat) +1465397355098:dim(USArrests) +1465397356198:sub1<- subset(USArrests$UrbanPop)<=50 +1465397362362:sub1 +1465397363136:sum(sub1, na.rm = TRUE) +1465397364900:df1 <- subset(USArrests, subset = sub1) +1465397379314:df1 <- subset(USArrests$UrbanPop, subset = sub1) +1465397379996:dim(df1) +1465397595441:sub2 <- Assault_cat ! = Urbanpop +1465397613398:sub2 <- Assault_cat[Urbanpop} +1465400792025:df6 <- na.omit(leadership) +1465400793487:dim(df6) +1465400805743:manager <- c(67, 211, 263, 211, 67, 263, 162, 121, 243, 263, 211, 121, 211, +1465400806018:243, 211, 158, 30, 30, 243, 76, 243, 67, 162, 243, 158) +1465400806294:country <- c(US, UK, UK, UK, US, UK, US, US, UK, UK, UK, +1465400806531:US, UK, UK, UK, US, US, US, UK, US, UK, US, +1465400806656:US, UK, US) +1465400806947:gender <- c(F, M, M, M, F, M, F, F, M, M, M, F, M, +1465400807133:M, M, F, F, F, M, M, M, F, F, M, F) +1465400807334:age <- c(64, 46, 49, 31, -9999, 67, 22, 18, 64, 24, 37, 36, 18, 20, 49, 28, 40, +1465400807550:39, 54, 47, 35, 49, 81, 58, 50) +1465400807733: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) +1465400807985: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) +1465400808182: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) +1465400808435: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) +1465400808686: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) +1465400808864:leadership <- data.frame(manager, country, gender, age, q1, q2, q3, +1465400809115:q4, q5, stringsAsFactors=FALSE) +1465400809585:############################################################################### +1465400809732:### 1. RECODE VALUES ########################################################## +1465400809783:leadership +1465400830884:leadership$age == NA # Note in Rstudio you get a warning left of line number +1465400831824:### is.na is used for this purpose. +1465400832659:is.na(leadership$age) +1465400834437:### Also note that an NA in quotes is no longer an NA. +1465400834903:is.na(NA) +1465400835626:is.na(NA) +1465400847562:mean(leadership$age) ### Result is NA +1465400847972:mean(leadership$age, na.rm = TRUE) +1465400848237:sd(leadership$age) +1465400848315:sd(leadership$age, na.rm = TRUE) +1465400848510:table(leadership$age) +1465400848780:table(leadership$age, useNA = 'ifany') +1465400849620:### Listwise deletion, that is, deleting all rows with at least one missing +1465400849874:### value, can be done with na.omit. +1465400850407:df6 <- na.omit(leadership) +1465400850937:dim(df6) +1465400851451:df6 +1465400896541:str(leadership) +1465400897049:summary(leadership) +1465401012692:apply(X = leadership, MARGIN = 2, FUN = mean) +1465401021372:apply(X = leadership[, 4:9], 2, mean) +1465401280950:load(C","/Users/Ben/Downloads/ecls.Rdata) +1465401335248:ecls +1465401431329:apply(ecls$GENDER, FUN = mean(1)) +1465401452884:apply(ecls$GENDER, FUN = mean) +1465401595966:by(data = leadership$age, INDICES = leadership$age_cat, FUN = mean) +1465401597762:### Determine the mean age conditional on country. +1465401600142:by(data = leadership$age, INDICES = leadership$country, FUN = mean) +1465401683374:leadership$mean1 <- (leadership$q1 + leadership$q2 + leadership$q3 + +1465401693894:leadership$mean1 <- (leadership$q1 + leadership$q2 + leadership$q3 + +1465401703755:leadership$q4 + leadership$q5)/5 +1465401714325:leadership +1465401732696:leadership$q4 + leadership$q5)/5 +1465401737571:leadership +1465402066316:leadership$mean1 <- (leadership$q1 + leadership$q2 + leadership$q3 + +1465402067069:leadership$q4 + leadership$q5)/5 +1465402067649:leadership +1465402068287:### Or by using 'apply' +1465402068915:leadership$mean2 <- apply(leadership[, 5:9], 1, mean) +1465402069625:leadership +1465402071771:### Or by using the transform() function +1465402072736:leadership <- transform(leadership, mean3 = (q1 + q2 + q3 + q4 + q5)/5) +1465402075266:leadership +1465402075723:### Now let's clean up and get rid of all but one copy of age_cat and mean +1465402076684:leadership <- subset(x = leadership, select = ) +1465402077499:colnames(leadership)[ind6] <- qmeans +1465402080981:leadership +1465402216648:leadership <- leadership [,-c11,12)] +1465402278808:drop(c mean2, mean 3) +1465402300408:drop <-(c mean2, mean 3) +1465402606129:by(data = leadership$q1, INDICES = leadership$gender, FUN = mean, na(m=TRUE)) +1465402642589:by(data = leadership$q1, INDICES = leadership$gender, +1465402643593:FUN = mean, na(m=TRUE)) +1465402766434:for (i in 1:10) print(i) +1465402773995:### Define a NULL vector as a place holder for output +1465402886300:for (i i in 1:10)rnormal(10) +1465402896231:for (i in 1:10)rnormal(10) +1465403120858:(out1 <- NULL) +1465403128639:for (i in 1:10) out1[i] <- i +1465403131676:out1 +1465403149073:for (i in 1:10) out1[5] <- i +1465403163907:out5 +1465403172417:out1 +1465403220689:for (i in 1:10) out1[i] <- 2*i - 1 +1465403291334:if (i == 3 | i == 7) next +1465403292876:print(i) +1465403332930:for (i in 1:10) out1[1] <- i +1465403333807:out1 +1465403342685:for (i in 1:10) +1465403343490:{ +1465403344137:if (i == 3 | i == 7) next +1465403344831:print(i) +1465403347299:} +1465403377550:if (i == 3 | i == 7) next +1465403378164:print(i) +1465403380671:} +1465403387510:### The word break inside a loop tells R to stop the loop altogether +1465403388233:for (i in 1:10) +1465403390126:{ +1465403390678:if (i == 3 | i == 7) break +1465403395251:print(i) +1465403395850:} +1465403472624:(out2<-NUL) +1465403519590:(out2<-NULL) +1465403596024:for(i in 8: 80) +1465403641698:for(i in 8: 80) out2 <- 8 +1465403652847:out2 +1465403873944:for (i into ) { out i]<- 8*i} +1465403954550:seq(8,80,8) +1465404019467:for (i in ) { out[i]<- 8*i} +1465404202689:fun1 <- function(x, y) # specify the arguments x and y +1465404202965:{ +1465404219978:fun1(3, 4) +1465404224835:fun1(1000, 20) +1465404230101:fun1 <- function(x, y) # specify the arguments x and y +1465404230329:{ +1465404230547:x + y - 2 # Tell the function what to do with the arguments +1465404230756:} +1465404230982:fun1(3, 4) +1465404231099:fun1(1000, 20) +1465404232867:### Write a function called fun2 that takes an argument x and returns +1465404234098:### 3*x^2 - 2*x - 10. Use the function on x = 1 and x = 10. +1465404234910:fun2 <- function(x) +1465404235603:{ +1465404236291:3*x^2 - 2*x - 10 +1465404249542:fun1 <- function(x, y) # specify the arguments x and y +1465404250031:{ +1465404250459:x + y - 2 # Tell the function what to do with the arguments +1465404250983:} +1465404251474:fun1(3, 4) +1465404251973:fun1(1000, 20) +1465404621687:fun3 <- function(name) +1465404622314:{ +1465404622784:paste0(Hello, , name) +1465404623158:} +1465404623383:fun3(Bryan Keller) +1465404623697:### Can set default arguments for function +1465404623900:fun3 <- function(name = Bryan Keller) +1465404624026:{ +1465404624496:paste0(Hello, , name) +1465404624863:} +1465404625083:fun3() +1465404625791:fun3(George Washington) +1465404626279:### Order of arguments matters if they are entered unnamed. Order doesn't +1465404626699:### matter if the arguments are named. +1465404627192:fun4 <- function(firstname = Bryan, lastname = Keller) +1465404628202:{ +1465404629010:paste0(Hello, , firstname, , lastname) +1465404630253:} +1465404631245:fun4() +1465404634073:fun4(George Washington) +1465404636835:fun4(George, Washington) +1465404640206:fun4(Washington, George) +1465404646210:fun4(lastname = Washington, firstname = George) +1465404667312:### Can creatively combine control flow statements with functions to make more +1465404667402:### useful functions. +1465404668067:mysummary <- function(x, parametric = TRUE) +1465404672193:{ +1465404672674:if (parametric) { +1465404673128:mean_x <- mean(x) +1465405205269:plot(x = ecls$RIRT, y = ecls$MIRT, +1465405205829:xlab = Kindergarten Reading Score, +1465405206429:ylab = Kindergarten Math Score, +1465405206843:main = ECLS-K Subsample Math and Reading Scores, +1465405207013:pch = 8) # pch is for point character +1465405207620:### Use red cirlces with blue borders +1465405208165:plot(x = ecls$RIRT, y = ecls$MIRT, +1465405208776:xlab = Kindergarten Reading Score, +1465405209041:ylab = Kindergarten Math Score, +1465405209505:main = ECLS-K Subsample Math and Reading Scores, +1465405209699:pch = 21, col = blue, bg = red) # bg is for background +1465405210559:### Thicken the border of the circle +1465405210725:plot(x = ecls$RIRT, y = ecls$MIRT, +1465405211138:xlab = Kindergarten Reading Score, +1465405211483:ylab = Kindergarten Math Score, +1465405211989:main = ECLS-K Subsample Math and Reading Scores, +1465405212063:pch = 21, col = blue, bg = red, lwd = 2) +1465405292264:### Larger plotted points +1465405292360:plot(x = ecls$RIRT, y = ecls$MIRT, +1465405292561:xlab = Kindergarten Reading Score, +1465405292762:ylab = Kindergarten Math Score, +1465405292949:main = ECLS-K Subsample Math and Reading Scores, +1465405293207:pch = 21, col = blue, bg = red, lwd = 2, +1465405298057:cex = 2) # cex is for character expansion +1465405350174:### Larger plotted points +1465405350439:plot(x = ecls$RIRT, y = ecls$MIRT, +1465405350710:xlab = Kindergarten Reading Score, +1465405351155:ylab = Kindergarten Math Score, +1465405351642:main = ECLS-K Subsample Math and Reading Scores, +1465405352151:pch = 21, col = blue, bg = pink, lwd = 2, +1465405353849:cex = 2) # cex is for character expansion +1465405394429:pch = 21, col = blue, bg = gold, lwd = 2, +1465405399719:### Larger plotted points +1465405399907:plot(x = ecls$RIRT, y = ecls$MIRT, +1465405400135:xlab = Kindergarten Reading Score, +1465405400646:ylab = Kindergarten Math Score, +1465405401097:main = ECLS-K Subsample Math and Reading Scores, +1465405401679:pch = 21, col = blue, bg = gold, lwd = 2, +1465405404003:cex = 2) # cex is for character expansion +1465670217908:x<-50 +1465670228468:X +1465670246980:x<-50 +1465670248294:x +1465670276626:y<-10 +1465670286485:y +1465670493050:fun2<-(x/y) +1465670503091:fun2 +1465670713738:fun1 <- function(x, y) # specify the arguments x and y +1465670716568:{ +1465670718707:x + y - 2 # Tell the function what to do with the arguments +1465670721239:} +1465670722248:fun1(3, 4) +1465670724770:fun1(1000, 20) +1465670788379:fun2<-function(x,y) +1465670791196:fun2 +1465670803134:x<-50 +1465670803626:x +1465670804515:y<-10 +1465670805074:y +1465670806537:fun2<-function(x,y) +1465670807766:fun2 +1465671451775:x<-50 +1465671452556:x +1465671453275:y<-10 +1465671454279:y +1465671455153:fun2<-function(x,y)[x/y] +1465671472564:fun2<-function(x,y){x/y} +1465671473500:fun2 +1465673235734:fun1 <- function(x, y) # specify the arguments x and y +1465673237002:{ +1465673237911:x + y - 2 # Tell the function what to do with the arguments +1465673239462:} +1465673241130:fun1(3, 4) +1465673243465:fun1(1000, 20) +1465673427505:fun2(50,10) +1465673432638:fun2<-function(x,y){x/y} +1465673433638:fun2(50,10) +1465680787962:fun2 <- function(x) +1465680789286:{ +1465680790317:3*x^2 - 2*x - 10 +1465680791386:} +1465680794677:fun2(1) +1465680796930:fun2(10) +1465681218873:fun2 +1465681233529:fun2<-function(x,y){x/y} +1465681234308:fun2(50,10) +1465681234955:fun2 +1465682790647:fun2<-funtion +1465682845202:fun2<-stop(50,10) +1465686550921:fun2<-stop(X,Y==0) +1465686940312:x<-50 +1465686941279:y<-10 +1465686942801:fun2<-function(x,y){x/y} +1465686943937:fun2(x,y) +1465686945489:fun2 +1465687210822:fun2<-stop(y == 0) +1465687286612:y<-0 +1465687289109:fun2<-stop(y == 0) +1465693547953:for (i in 1:10) print(i) +1465693551278:for (i in 1:10)rnormal(10) +1465693564886:if (4 == 4) {print(correct)} +1465693565358:if (4 == 5) {print(correct)} +1465693565978:if (4 == 5) {print(correct)} else {print(incorrect)} +1465693566474:### ifelse() is a single statement which does both if and else +1465693568892:### THE SYNTAX--- if (cond, statement1, statement2) +1465693569154:### The first statement is executed if the condition is true. Otherwise, the second +1465693569447:### statement is executed. +1465693569745:ifelse(4 == 4, correct, incorrect) +1465693570215:ifelse(4 == 5, correct, incorrect) +1465693572418:############################################################################### +1465693572661:### 6. FOR LOOPS ############################################################## +1465693572866:############################################################################### +1465693573160:### THE SYNTAX--- for (var in seq) statement +1465693573436:### The for loop executes statement repetetively until a var's value is no longer +1465693573713:### contained in the seq. +1465693574232:for (i in 1:10) print(i) +1465693575935:for (i in 1:10)rnormal(10) +1465693595296:### Define a NULL vector as a place holder for output +1465693596251:(out1 <- NULL) +1465693596998:for (i in 1:10) out1[1] <- i +1465693598126:out1 +1465693599262:for (i in 1:10) out1[i] <- 2*i - 1 +1465693600637:out1 +1465693601833:out1 +1465693602976:### The word next inside a loop tells R to skip to the next index +1465693604056:for (i in 1:10) +1465693604863:{ +1465693605907:if (i == 3 | i == 7) next +1465693608159:print(i) +1465693608810:} +1465693609358:### The word break inside a loop tells R to stop the loop altogether +1465693610322:for (i in 1:10) +1465693610985:{ +1465693707030:for (i in 1:10) +1465693707906:{ +1465693708507:if (i == 3 | i == 7) break +1465693710087:print(i) +1465693710692:} +1465693718430:### The word stop insdide a loop (or a function) tells R to stop and +1465693720444:### print a given error message +1465693720955:for (i in 1:10) +1465693721630:{ +1465693722169:if (i == 3) stop(Dont include 3 or 7 indexes or you will see this error."") +1465693723021:print(i) +1465693837217:for (i in 1:10) print(i) +1465693838321:for (i in 1:10)rnormal(10) +1465693843958:### Define a NULL vector as a place holder for output +1465693844283:(out1 <- NULL) +1465693845125:for (i in 1:10) out1[1] <- i +1465693847596:out1 +1465693848042:for (i in 1:10) out1[i] <- 2*i - 1 +1465693848804:out1 +1465693849406:out1 +1465693850153:### The word ""next"" inside a loop tells R to skip to the next index +1465693851470:for (i in 1:10) +1465693852492:{ +1465693853343:if (i == 3 | i == 7) next +1465693854214:print(i) +1465693855620:} +1465693856047:### The word ""break"" inside a loop tells R to stop the loop altogether +1465693857116:for (i in 1:10) +1465693857941:{ +1465693858413:if (i == 3 | i == 7) break +1465693858985:print(i) +1465694548660:fun2(x,y) +1465694560127:fun2(x,y) +1465694574433:fun2 +1465694630867:y->10 +1465694661952:y<-10 +1465694679188:fun2 +1465694716946:fun2(x,y) +1465697490876:fun2(30,10) +1465756850272:fun2<-function(x == 50,y == 10) +1465756861592:fun2<-function(x = 50,y = 10) +1465756865686:{x/y} +1465756873717:fun2(x,y) +1465756916974:fun2(50,10) +1465757350188:fun2<-function(x = 50,y = 10) +1465757350890:{x/y}{return(x/y)} +1465757352549:fun2(x,y) +1465757353872:fun2(50,10) +1465757422823:fun2<-function(x = 50,y = 10) +1465757423349:{x/y} +1465757424897:{return(x/y)} +1465757443097:fun2<-function(x = 50,y = 10) +1465757444335:{x/y} +1465757446121:{return(x/y)} +1465757447822:fun2(50,10) +1465757469813:fun2<-function(x = 50,y = 10) +1465757470303:{x+y} +1465757470815:{return(x/y)} +1465757471757:fun2(50,10) +1465757493452:fun2<-function(x = 50,y = 10) +1465757494736:{x+y} +1465757495722:return(x/y) +1465757496446:fun2(50,10) +1465757594783:fun2<-function(x = 50,y = 10) +1465757595371:{x+y} +1465757595958:{return(x/y)} +1465757596785:fun2(50,10) +1465757974145:Fun2 +1465757991464:fun2<-function(x = 50, y=10) +1465757992556:{x/y +1465757994567:} +1465757996386:fun2 +1465758012776:fun2(x,y) +1465758027315:fun2(50,10) +1465758057895:y<-0 +1465758058563:fun2<-stop(y == 0) +1465758059616:fun2<-stop(y == 0) +1465758060430:Error: FALSE +1465758110541:for (i in 1:10) print(i) +1465758111829:for (i in 1:10)rnormal(10) +1465758120413:if (4 == 4) {print(""correct"")} +1465758120992:if (4 == 5) {print(""correct"")} +1465758121453:if (4 == 5) {print(""correct"")} else {print(""incorrect"")} +1465758121880:### ifelse() is a single statement which does both if and else +1465758122663:### THE SYNTAX--- if (cond, statement1, statement2) +1465758122887:### The first statement is executed if the condition is true. Otherwise, the second +1465758123140:### statement is executed. +1465758123303:ifelse(4 == 4, ""correct"", ""incorrect"") +1465758124081:ifelse(4 == 5, ""correct"", ""incorrect"") +1465758125158:############################################################################### +1465758125569:### 6. FOR LOOPS ############################################################## +1465758125819:############################################################################### +1465758126035:### THE SYNTAX--- for (var in seq) statement +1465758126220:### The for loop executes statement repetetively until a vars value is no longer","YOUR NAME" +"1465758126417","","YOUR NAME" +"1465758127059","for (i in 1","YOUR NAME" +"10) print(i)","","YOUR NAME" +"1465758127716","for (i in 1","YOUR NAME" +"10)rnormal(10)","","YOUR NAME" +"1465758131734","","YOUR NAME" +"1465758132346","(out1 <- NULL)","YOUR NAME" +"1465758132877","for (i in 1","YOUR NAME" +"10) out1[1] <- i","","YOUR NAME" +"1465758133417","out1","YOUR NAME" +"1465758134107","for (i in 1","YOUR NAME" +"10) out1[i] <- 2*i - 1","","YOUR NAME" +"1465758134654","out1","YOUR NAME" +"1465758135921","out1","YOUR NAME" +"1465758136341","","YOUR NAME" +"1465758137194","for (i in 1","YOUR NAME" +"10)","","YOUR NAME" +"1465758138378","{","YOUR NAME" +"1465758140157","if (i == 3 | i == 7) next","YOUR NAME" +"1465758141038","print(i)","YOUR NAME" +"1465758141653","}","YOUR NAME" +"1465758142854","","YOUR NAME" +"1465758143330","for (i in 1","YOUR NAME" +"10)","","YOUR NAME" +"1465758143840","{","YOUR NAME" +"1465758144359","if (i == 3 | i == 7) break","YOUR NAME" +"1465758145007","print(i)","YOUR NAME" +"1465758145727","}","YOUR NAME" +"1465758146243","","YOUR NAME" +"1465758146865","","YOUR NAME" +"1465758147522","for (i in 1","YOUR NAME" +"10)","","YOUR NAME" +"1465758148186","{","YOUR NAME" +"1465758148925","if (i == 3) stop(Don't include 3 or 7 indexes or you will see this error.)","YOUR NAME" +"1465758149795","print(i)","YOUR NAME" +"1465758150759","}","YOUR NAME" +"1465758500704","for (fun2)","YOUR NAME" +"1465758507016","{","YOUR NAME" +"1465758507567","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465758509663","}","YOUR NAME" +"1465758510942","print(fun2)","YOUR NAME" +"1465758543789","for (fun2(50,10))","YOUR NAME" +"1465758544386","{","YOUR NAME" +"1465758545028","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465758545593","}","YOUR NAME" +"1465758549193","print(fun2)","YOUR NAME" +"1465758565951","fun2<-function(x = 50,y = 10)","YOUR NAME" +"1465758566369","{x+y}","YOUR NAME" +"1465758566816","{return(x/y)}","YOUR NAME" +"1465758567249","fun2(50,10)","YOUR NAME" +"1465758568250","","YOUR NAME" +"1465758569037","fun2<-function(x = 50, y=10)","YOUR NAME" +"1465758569805","{x/y","YOUR NAME" +"1465758570450","}","YOUR NAME" +"1465758570785","fun2","YOUR NAME" +"1465758571161","fun2(50,10)","YOUR NAME" +"1465758571917","","YOUR NAME" +"1465758572562","","YOUR NAME" +"1465758572993","for (fun2(50,10))","YOUR NAME" +"1465758573738","{","YOUR NAME" +"1465758574628","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465758575277","}","YOUR NAME" +"1465758575732","print(fun2)","YOUR NAME" +"1465758609462","fun2<-function(x = 50,y = 10)","YOUR NAME" +"1465758610248","{x+y}","YOUR NAME" +"1465758611687","{return(x/y)}","YOUR NAME" +"1465758624977","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465758626022","{x/y","YOUR NAME" +"1465758627393","}","YOUR NAME" +"1465758628926","fun2","YOUR NAME" +"1465758629687","fun2(50,10)","YOUR NAME" +"1465758631923","","YOUR NAME" +"1465758632477","","YOUR NAME" +"1465758637669","for (fun2(50,10))","YOUR NAME" +"1465758652994","for fun2(50,10)","YOUR NAME" +"1465758679304","for fun2","YOUR NAME" +"1465758684727","{","YOUR NAME" +"1465758685289","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465758685928","}","YOUR NAME" +"1465758687770","print(fun2)","YOUR NAME" +"1465758719387","fun2(50,0)","YOUR NAME" +"1465758750626","fun2(x ==50,== 0)","YOUR NAME" +"1465758760550","fun2(x ==50,y == 0)","YOUR NAME" +"1465758801197","{","YOUR NAME" +"1465758801976","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465758802730","}","YOUR NAME" +"1465758804179","print(fun2)","YOUR NAME" +"1465758808481","fun2(x ==50,y == 0)","YOUR NAME" +"1465759010978","{","YOUR NAME" +"1465759011776","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465759035396","}","YOUR NAME" +"1465759037178","print(fun2)","YOUR NAME" +"1465759039792","fun2<-(x =50,y = 0)","YOUR NAME" +"1465759042108","{x/y","YOUR NAME" +"1465759047980","}","YOUR NAME" +"1465760007092","fun2<-function(x =50,y = 0)","YOUR NAME" +"1465760007911","{x/y","YOUR NAME" +"1465760008576","}","YOUR NAME" +"1465760010863","{","YOUR NAME" +"1465760018197","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465760018933","}","YOUR NAME" +"1465760048538","fun2(50,0)","YOUR NAME" +"1465760133828","fun2(x = 50, y = 10)","YOUR NAME" +"1465760227555","fun2(x,y)","YOUR NAME" +"1465760227826","fun2(30,10)","YOUR NAME" +"1465760290902","fun2<-function(x,y)","YOUR NAME" +"1465760291654","{x/y","YOUR NAME" +"1465760292325","}","YOUR NAME" +"1465760294142","fun2(30,10)","YOUR NAME" +"1465760597372","fun4<-function(y = 15, x = 60)","YOUR NAME" +"1465760598075","{y + x","YOUR NAME" +"1465760601770","}","YOUR NAME" +"1465760602611","fun4(30,2)","YOUR NAME" +"1465760790375","fun5<-function( x= 1","YOUR NAME" +"30, y = pi)","","YOUR NAME" +"1465760792919","{x +Y","YOUR NAME" +"1465760796887","}","YOUR NAME" +"1465760797849","fun5(6,2)","YOUR NAME" +"1465760945034","fun6 <- function( x = seven, y =10 )","YOUR NAME" +"1465761030538","fun6 <- function( x = seven, y = 10 )","YOUR NAME" +"1465761031559","{x+y","YOUR NAME" +"1465761032319","}","YOUR NAME" +"1465761033861","fun6(6,2)","YOUR NAME" +"1465761067145","fun6(6,2)","YOUR NAME" +"1465761072372","fun6 <- function( x = seven, y = 10 )","YOUR NAME" +"1465761073527","{x+y","YOUR NAME" +"1465761074943","}","YOUR NAME" +"1465761076357","fun6(6,2)","YOUR NAME" +"1465761279757","fun7<- function( x = 2, y = 0)","YOUR NAME" +"1465761280495","{x + Y","YOUR NAME" +"1465761281140","}","YOUR NAME" +"1465761282676","fun7(8,9)","YOUR NAME" +"1465761355490","fun3<-function(x,y)","YOUR NAME" +"1465761356074","{x/y","YOUR NAME" +"1465761356749","}","YOUR NAME" +"1465761358214","fun3(30,10)","YOUR NAME" +"1465769314450","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465769315485","{","YOUR NAME" +"1465769315936","x/y","YOUR NAME" +"1465769316738","}","YOUR NAME" +"1465769318209","fun2()","YOUR NAME" +"1465780853838","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465780854474","{","YOUR NAME" +"1465780855621","x/y","YOUR NAME" +"1465780859757","}","YOUR NAME" +"1465780860793","fun2( )","YOUR NAME" +"1465781087442","{","YOUR NAME" +"1465781088099","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465781088908","}","YOUR NAME" +"1465781094770","fun2(50,0)","YOUR NAME" +"1465781152625","for fun2","YOUR NAME" +"1465781156373","{","YOUR NAME" +"1465781158999","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465781159803","}","YOUR NAME" +"1465781184250","for (fun2)","YOUR NAME" +"1465781186305","{","YOUR NAME" +"1465781186821","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465781187223","}","YOUR NAME" +"1465781203693","for fun2","YOUR NAME" +"1465781204090","{","YOUR NAME" +"1465781204522","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465781205169","}","YOUR NAME" +"1465781507974","fun2()","YOUR NAME" +"1465781697914","fun2","YOUR NAME" +"1465781699156","{","YOUR NAME" +"1465781699752","x/y","YOUR NAME" +"1465781700321","}","YOUR NAME" +"1465781701007","fun3(30,10)","YOUR NAME" +"1465781725826","fun2(30,10)","YOUR NAME" +"1465781854060","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465781854807","{","YOUR NAME" +"1465781855392","x/y","YOUR NAME" +"1465781856158","}","YOUR NAME" +"1465781857753","fun2( )","YOUR NAME" +"1465781860958","","YOUR NAME" +"1465781868810","","YOUR NAME" +"1465781869396","for fun2","YOUR NAME" +"1465781870030","{","YOUR NAME" +"1465781874258","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465781874783","}","YOUR NAME" +"1465781885977","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465781886451","{","YOUR NAME" +"1465781886933","x/y","YOUR NAME" +"1465781887563","}","YOUR NAME" +"1465781889177","fun2( )","YOUR NAME" +"1465781890595","","YOUR NAME" +"1465781891277","","YOUR NAME" +"1465781899999","fun2(x,y)","YOUR NAME" +"1465781900539","fun2()","YOUR NAME" +"1465781921133","fun2()","YOUR NAME" +"1465781927683","fun2(30,10)","YOUR NAME" +"1465782780782","fun2(y =15 ,x = 60)","YOUR NAME" +"1465782907094","fun2(1.30, pi)","YOUR NAME" +"1465783447664","fun2( x = seven, y = 10 )","YOUR NAME" +"1465783742202","fun2(6,2)","YOUR NAME" +"1465784377788","for fun2","YOUR NAME" +"1465784391135","for (fun2","YOUR NAME" +"1465784392083","{","YOUR NAME" +"1465784401566","for (fun2)","YOUR NAME" +"1465784402012","{","YOUR NAME" +"1465784442165","for fun2","YOUR NAME" +"1465784443226","{","YOUR NAME" +"1465784444151","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465784445110","}","YOUR NAME" +"1465784534432","for {fun2","YOUR NAME" +"1465784534950","{","YOUR NAME" +"1465784535570","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465784536090","}","YOUR NAME" +"1465784823288","for {fun2}","YOUR NAME" +"1465784824452","{","YOUR NAME" +"1465784825077","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465784825637","}","YOUR NAME" +"1465784844340","for (fun2)","YOUR NAME" +"1465784857475","for fun2","YOUR NAME" +"1465784858469","{","YOUR NAME" +"1465784864009","for fun2","YOUR NAME" +"1465784865249","{","YOUR NAME" +"1465784865989","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465784866499","}","YOUR NAME" +"1465784876368","for fun2","YOUR NAME" +"1465784876597","{","YOUR NAME" +"1465784876839","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465784877216","}","YOUR NAME" +"1465784877715","fun2(10,0)","YOUR NAME" +"1465784901961","for fun2","YOUR NAME" +"1465784922970","for (x/y)","YOUR NAME" +"1465784930573","for (x/y)","YOUR NAME" +"1465784992785","for (fun2 in x/y)","YOUR NAME" +"1465784994171","{","YOUR NAME" +"1465784994865","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465784995493","}","YOUR NAME" +"1465785011459","for (fun2 in x/y)","YOUR NAME" +"1465785012594","{","YOUR NAME" +"1465785013228","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785014107","}","YOUR NAME" +"1465785026192","for (fun2 in y)","YOUR NAME" +"1465785027232","{","YOUR NAME" +"1465785027689","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785028395","}","YOUR NAME" +"1465785076529","for (fun2(x/y) in y)","YOUR NAME" +"1465785077198","{","YOUR NAME" +"1465785077833","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785078064","}","YOUR NAME" +"1465785078562","fun2(,0)","YOUR NAME" +"1465785092109","for (fun2 in y)","YOUR NAME" +"1465785092671","{","YOUR NAME" +"1465785093386","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785094009","}","YOUR NAME" +"1465785099224","fun2(,0)","YOUR NAME" +"1465785126497","for (fun2 in y)","YOUR NAME" +"1465785127200","{","YOUR NAME" +"1465785127879","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785128745","print(y)","YOUR NAME" +"1465785129489","}","YOUR NAME" +"1465785164593","for (fun2 in y)","YOUR NAME" +"1465785165116","{","YOUR NAME" +"1465785165613","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785166179","print(y)","YOUR NAME" +"1465785166749","}","YOUR NAME" +"1465785199057","for (fun2 in y)","YOUR NAME" +"1465785199617","{","YOUR NAME" +"1465785200069","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785200713","print(fun2)","YOUR NAME" +"1465785201468","}","YOUR NAME" +"1465785270979","for (i in 1","YOUR NAME" +"10) print(i)","","YOUR NAME" +"1465785272088","for (i in 1","YOUR NAME" +"10)rnormal(10)","","YOUR NAME" +"1465785273143","","YOUR NAME" +"1465785273746","(out1 <- NULL)","YOUR NAME" +"1465785274738","for (i in 1","YOUR NAME" +"10) out1[1] <- i","","YOUR NAME" +"1465785275562","out1","YOUR NAME" +"1465785276377","for (i in 1","YOUR NAME" +"10) out1[i] <- 2*i - 1","","YOUR NAME" +"1465785277031","out1","YOUR NAME" +"1465785277494","out1","YOUR NAME" +"1465785278507","","YOUR NAME" +"1465785278933","for (i in 1","YOUR NAME" +"10)","","YOUR NAME" +"1465785290257","{","YOUR NAME" +"1465785290916","if (i == 3 | i == 7) next","YOUR NAME" +"1465785291985","print(i)","YOUR NAME" +"1465785292722","}","YOUR NAME" +"1465785294133","","YOUR NAME" +"1465785294462","for (i in 1","YOUR NAME" +"10)","","YOUR NAME" +"1465785295409","{","YOUR NAME" +"1465785295786","if (i == 3 | i == 7) break","YOUR NAME" +"1465785296726","print(i)","YOUR NAME" +"1465785298341","}","YOUR NAME" +"1465785299047","","YOUR NAME" +"1465785299389","","YOUR NAME" +"1465785299980","for (i in 1","YOUR NAME" +"10)","","YOUR NAME" +"1465785300654","{","YOUR NAME" +"1465785301190","if (i == 3) stop(Don't include 3 or 7 indexes or you will see this error.)","YOUR NAME" +"1465785302368","print(i)","YOUR NAME" +"1465785302769","}","YOUR NAME" +"1465785303191","","YOUR NAME" +"1465785421791","for (y in fun2)","YOUR NAME" +"1465785422332","{","YOUR NAME" +"1465785422791","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785423392","print(fun2)","YOUR NAME" +"1465785424067","}","YOUR NAME" +"1465785460517","for y in fun2","YOUR NAME" +"1465785460939","{","YOUR NAME" +"1465785461344","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785461823","print(fun2)","YOUR NAME" +"1465785462247","}","YOUR NAME" +"1465785493791","for y in fun2","YOUR NAME" +"1465785517176","for (y in fun2)","YOUR NAME" +"1465785518426","{","YOUR NAME" +"1465785519296","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785520512","print(y)","YOUR NAME" +"1465785522667","}","YOUR NAME" +"1465785528220","fun2(,0)","YOUR NAME" +"1465785582524","for (y in fun2)","YOUR NAME" +"1465785583613","{","YOUR NAME" +"1465785584520","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785585536","print(y)","YOUR NAME" +"1465785587666","}","YOUR NAME" +"1465785602662","for (y)in fun2","YOUR NAME" +"1465785603801","{","YOUR NAME" +"1465785604274","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785604856","print(y)","YOUR NAME" +"1465785605315","}","YOUR NAME" +"1465785626361","for (y)in (fun2)","YOUR NAME" +"1465785627124","{","YOUR NAME" +"1465785627825","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785628066","print(y)","YOUR NAME" +"1465785628669","}","YOUR NAME" +"1465785641685","for (y in (fun2))","YOUR NAME" +"1465785642574","{","YOUR NAME" +"1465785643203","if (y == 0) stop (y is 0 silly)","YOUR NAME" +"1465785643794","print(y)","YOUR NAME" +"1465785644796","}","YOUR NAME" +"1465785696522","for (y in fun2)","YOUR NAME" +"1465785697297","{","YOUR NAME" +"1465785698004","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465785698873","print(y)","YOUR NAME" +"1465785699630","}","YOUR NAME" +"1465785710498","for (y in fun2)","YOUR NAME" +"1465785710943","{","YOUR NAME" +"1465785711287","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465785711865","print(y)","YOUR NAME" +"1465785712288","}","YOUR NAME" +"1465785731171","for y in fun2","YOUR NAME" +"1465785731724","{","YOUR NAME" +"1465785732944","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465785733474","print(y)","YOUR NAME" +"1465785734020","}","YOUR NAME" +"1465785734461","fun2(,0)","YOUR NAME" +"1465785794936","for (y,fun2)","YOUR NAME" +"1465785804218","for (y ,fun2)","YOUR NAME" +"1465785804960","{","YOUR NAME" +"1465785805647","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465785805845","print(y)","YOUR NAME" +"1465785806474","}","YOUR NAME" +"1465785856144","for (fun2 in y)","YOUR NAME" +"1465785856610","{","YOUR NAME" +"1465785857081","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465785857714","print(fun2)","YOUR NAME" +"1465785858602","}","YOUR NAME" +"1465785863457","fun2(,0)","YOUR NAME" +"1465785884284","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465785886164","{","YOUR NAME" +"1465785887922","x/y","YOUR NAME" +"1465785888647","}","YOUR NAME" +"1465785890467","fun2( )","YOUR NAME" +"1465785898666","for (fun2 in y)","YOUR NAME" +"1465785899406","{","YOUR NAME" +"1465785900070","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465785903715","print(fun2)","YOUR NAME" +"1465785906199","}","YOUR NAME" +"1465785911542","fun2(,0)","YOUR NAME" +"1465785922314","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465785922509","{","YOUR NAME" +"1465785922930","x/y","YOUR NAME" +"1465785923233","}","YOUR NAME" +"1465785923714","fun2( )","YOUR NAME" +"1465785940717","for (fun2 in y)","YOUR NAME" +"1465785941647","{","YOUR NAME" +"1465785942237","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465785949469","print(y)","YOUR NAME" +"1465785950295","}","YOUR NAME" +"1465785963875","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465785967925","for (fun2 in y)","YOUR NAME" +"1465785968640","{","YOUR NAME" +"1465785974810","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465785977815","{","YOUR NAME" +"1465785978589","x/y","YOUR NAME" +"1465785979123","}","YOUR NAME" +"1465785980543","fun2( )","YOUR NAME" +"1465786012389","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465786013148","{","YOUR NAME" +"1465786013790","x/y","YOUR NAME" +"1465786014414","}","YOUR NAME" +"1465786022476","for (fun2 in y)","YOUR NAME" +"1465786025367","{","YOUR NAME" +"1465786026633","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465786033474","print(y)","YOUR NAME" +"1465786036873","}","YOUR NAME" +"1465786063557","for (fun2 in y)","YOUR NAME" +"1465786064530","{","YOUR NAME" +"1465786065481","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465786070047","print(fun2)","YOUR NAME" +"1465786071954","}","YOUR NAME" +"1465786075608","fun2(,0)","YOUR NAME" +"1465786094562","for (y in fun2)","YOUR NAME" +"1465786095374","{","YOUR NAME" +"1465786095918","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465786097755","print(fun2)","YOUR NAME" +"1465786100536","}","YOUR NAME" +"1465786109665","fun2(,0)","YOUR NAME" +"1465786125461","for (y in fun2)","YOUR NAME" +"1465786126187","{","YOUR NAME" +"1465786126718","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465786127310","print(y)","YOUR NAME" +"1465786129053","}","YOUR NAME" +"1465786133433","fun2(,0)","YOUR NAME" +"1465786187675","fun2<-function(x = 50, y = 10)","YOUR NAME" +"1465786188430","{","YOUR NAME" +"1465786189189","x/y","YOUR NAME" +"1465786189984","}","YOUR NAME" +"1465786190699","fun2( )","YOUR NAME" +"1465786193352","","YOUR NAME" +"1465786195574","","YOUR NAME" +"1465786196886","for (i in 1","YOUR NAME" +"10)","","YOUR NAME" +"1465786208802","for (y in fun2)","YOUR NAME" +"1465786210311","{","YOUR NAME" +"1465786215108","if (y == 0) stop(y is 0 silly)","YOUR NAME" +"1465786221390","print(y)","YOUR NAME" +"1465786223042","}","YOUR NAME" +"1465786230172","fun2(,0)","YOUR NAME" +"1465786245177","fun2( x = 2, y = 0)","YOUR NAME" +"1465786331307","for (y in fun2)","YOUR NAME" +"1465786331752","{","YOUR NAME" +"1465786332151","if (y = 0) stop(y is 0 silly)","YOUR NAME" +"1465788668757","mydata = read.xls","YOUR NAME" +"1465788689450","mydata = read.xls(11111)","YOUR NAME" +"1465788712248","mydata = read11111.xls","YOUR NAME" +"1465788727914","mydata = read(11111.xls)","YOUR NAME" +"1465788952439","install.packages()","YOUR NAME" +"1465788980545","library()","YOUR NAME" +"1465788998479","library()","YOUR NAME" +"1465789073447","any(grepl(,","YOUR NAME" +"1465789074715","installed.packages()))","YOUR NAME" +"1465789156845","(readxl)","YOUR NAME" +"1465789158113","(readxl)","YOUR NAME" +"1465789245791","getwd(11111.xlsx)","YOUR NAME" +"1465789667911","`11111` <- read.csv(~/11111.xlsx, sep=)","YOUR NAME" +"1465789667930","View(`11111`)","YOUR NAME" +"1465789716433","View(`11111`)","YOUR NAME" +"1465789730471","print(y)","YOUR NAME" +"1465789733255","}","YOUR NAME" +"1465822110133","View(`11111`)","YOUR NAME" +"1465822207321","poop <- read.delim(~/poop.txt, header=FALSE)","YOUR NAME" +"1465822207382","View(poop)","YOUR NAME" +"1465822613432","MTA.number.of.years.worked.vs..number.of.dependents <- read.delim(~/MTA number of years worked vs. number of dependents.txt)","YOUR NAME" +"1465822613443","View(MTA.number.of.years.worked.vs..number.of.dependents)","YOUR NAME" +"1465822813288","`MTA.","YOUR NAME" +"1465822813311","View(`MTA.","YOUR NAME" +"1465822954049","Plots(`MTA.","YOUR NAME" +"1465822986194","plot(`MTA.","YOUR NAME" +"1465825294353","Dispatcher.Shift.type <- read.table(~/Dispatcher Shift type.txt, header=TRUE, quote=\"") +1465825294494:View(Dispatcher.Shift.type) +1465825902162:Dispatcher.Shift.type.3 <- read.table(~/Dispatcher Shift type 3.txt, header=TRUE, quote=\)","YOUR NAME" +"1465825902171","View(Dispatcher.Shift.type.3)","YOUR NAME" +"1465826200671","hist(Dispatcher.Shift.type.3)","YOUR NAME" +"1465826273961","hist(`MTA.","YOUR NAME" +"1465826974772","hist(Dispatcher.Shift.type.3)","YOUR NAME" +"1465827040646","Dispatcher.Shift.type.4 <- read.table(~/Dispatcher Shift type 4.txt, quote=\"") +1465827040666:View(Dispatcher.Shift.type.4) +1465827074460:hist(Dispatcher.Shift.type.4) +1465827299988:plot(`MTA.#of.years.#.of.dependents`) +1465828060857:function(x =50, y= 10)stop(y=0) +1465828087251:function(x =50, y= 10)stop(y=0) +1465828087979:fun2(,0) +1465828106438:fun2<-function(x = 50, y = 10) +1465828107221:{ +1465828107856:x/y +1465828108917:} +1465828111146:fun2( ) +1465828115397:fun2(x =50, y= 10)stop(y=0) +1465828135884:fun2stop(y=0) +1465828137427:fun2(,0) +1465828542672:for (y in fun2) +1465828543172:{ +1465828543757:if (y == 0) stop(y is 0 silly) +1465828546321:print(y) +1465828548153:} +1465828551278:fun2(,0) +1465828585637:for (y in fun2) +1465828586359:{ +1465828586859:if (y == 0) stop(y is 0 silly) +1465828587422:} +1465828604163:for (y in fun2) +1465828604714:{ +1465828605248:if (y == 0) stop(y is 0 silly) +1465828608850:print(y) +1465828609477:} +1465828732405:fun2 +1465828732868:if(y==0) stop(silly ben) +1465828735599:fun2(,0) +1465828785830:fun2<-function( x=50, y =10) +1465828786674:if(y==0) stop(silly ben) +1465828788007:fun2(,0) +1465828807299:fun2( x = 2, y = 0) +1465831717764:(rirt_means <- by(data = ecls$RIRT, INDICES = ecls$F5SPECS, FUN = mean)) +1465831896664:`ecls.(1)` <- read.table(C","YOUR NAME" +"/Users/Ben/Downloads/ecls (1).Rdata, quote=\)","","YOUR NAME" +"1465831896738","View(`ecls.(1)`)","YOUR NAME" +"1465832014426","View(`ecls.(1)`)","YOUR NAME" +"1465832014952","View(`ecls.(1)`)","YOUR NAME" +"1465832072659","install.packages(C:/Users/Ben/Downloads/ecls.Rdata, repos = NULL)","YOUR NAME" +"1465832159160","as.data.frame(ecls)","YOUR NAME" +"1465832162010","head(ecls)","YOUR NAME" +"1465832173620","data.frame(ecls)","YOUR NAME" +"1465832174968","head(ecls)","YOUR NAME" +"1465832182664","View(`ecls.(1)`)","YOUR NAME" +"1465832632289","getwd(ecls)","YOUR NAME" +"1465832823571","as.data.frame(ecls.Rdata)","YOUR NAME" +"1465832865227","getwd(ecls.Rdata)","YOUR NAME" +"1465832955162","load(file = file.choose(`ecls.(1)`))","YOUR NAME" +"1465833280823","View(ecls) ","YOUR NAME" +"1465833280859","head(ecls) ","YOUR NAME" +"1465833280889","is.data.frame(ecls) ","YOUR NAME" +"1465833280913","str(ecls) ","YOUR NAME" +"1465833280943","","YOUR NAME" +"1465833280979","","YOUR NAME" +"1465833281011","","YOUR NAME" +"1465833281047","ecls[1,] ","YOUR NAME" +"1465833281075","ecls[,1] ","YOUR NAME" +"1465833281107","","YOUR NAME" +"1465833281143","","YOUR NAME" +"1465833281174","ecls$GENDER ","YOUR NAME" +"1465833281193","ecls[,c(GENDER)] ","YOUR NAME" +"1465833281228","","YOUR NAME" +"1465833281259","","YOUR NAME" +"1465833281294","table(GENDER)","YOUR NAME" +"1465833281328","mean(RIRT)","YOUR NAME" +"1465833281362","attach(ecls)","YOUR NAME" +"1465833281381","table(GENDER)","YOUR NAME" +"1465833281416","mean(RIRT)","YOUR NAME" +"1465833281448","detach(ecls)","YOUR NAME" +"1465833281482","","YOUR NAME" +"1465833281517","","YOUR NAME" +"1465833281535","table(ecls$GENDER)","YOUR NAME" +"1465833281570","","YOUR NAME" +"1465833281607","","YOUR NAME" +"1465833281643","","YOUR NAME" +"1465833281660","GENDER <- c(male, female)","YOUR NAME" +"1465833281693","","YOUR NAME" +"1465833281728","","YOUR NAME" +"1465833281759","attach(ecls)","YOUR NAME" +"1465833281796","GENDER","YOUR NAME" +"1465833281850","detach(ecls)","YOUR NAME" +"1465833281891","","YOUR NAME" +"1465833281921","","YOUR NAME" +"1465833281944","","YOUR NAME" +"1465833281975","","YOUR NAME" +"1465833282015","","YOUR NAME" +"1465833282044","","YOUR NAME" +"1465833282067","","YOUR NAME" +"1465833282099","","YOUR NAME" +"1465833282144","","YOUR NAME" +"1465833282175","","YOUR NAME" +"1465833282197","","YOUR NAME" +"1465833282228","","YOUR NAME" +"1465833282264","","YOUR NAME" +"1465833282294","","YOUR NAME" +"1465833282319","","YOUR NAME" +"1465833282362","","YOUR NAME" +"1465833282384","","YOUR NAME" +"1465833282418","table(ecls$GENDER)","YOUR NAME" +"1465833282452","table(ecls$F5SPECS) ","YOUR NAME" +"1465833282483","table(ecls$P1FIRKDG) ","YOUR NAME" +"1465833282505","","YOUR NAME" +"1465833282545","( tab1 <- table(gend = ecls$GENDER, specEd = ecls$F5SPECS) )","YOUR NAME" +"1465833282567","","YOUR NAME" +"1465833282599","margin.table(tab1, margin = 1)","YOUR NAME" +"1465833282647","margin.table(tab1, margin = 2)","YOUR NAME" +"1465833282683","","YOUR NAME" +"1465833282715","install.packages(gmodels)","YOUR NAME" +"1465833355535","head(ecls)","YOUR NAME" +"1465833356204","str(ecls)","YOUR NAME" +"1465833401639","as.data.frame(ecls)","YOUR NAME" +"1465833818083","library(car)","YOUR NAME" +"1465833846304","library(cluster, lib.loc=C:/Program Files/R/R-3.3.0/library)","YOUR NAME" +"1465834058641","installl packages(car)","YOUR NAME" +"1465834080756","install.packages(car)","YOUR NAME" +"1465834130466","library(car, lib.loc=~/R/win-library/3.3)","YOUR NAME" +"1465834140798","","YOUR NAME" +"1465834717094","as.data.frame(Salaries)","YOUR NAME" +"1465835002855","(tab1 <- table(Salaries$rank))","YOUR NAME" +"1465835004008","","YOUR NAME" +"1465835005853","barplot(height = tab1)","YOUR NAME" +"1465835033035","","YOUR NAME" +"1465835034052","barplot(height = tab1,","YOUR NAME" +"1465835034735","xlab = Rank,","YOUR NAME" +"1465835039772","ylab = Frequency,","YOUR NAME" +"1465835040590","main = Simple bar plot)","YOUR NAME" +"1465835075136","(tab2 <- table(Salaries$rank, Salaries$discipline))","YOUR NAME" +"1465835075873","barplot(tab2, beside = FALSE, ","YOUR NAME" +"1465835076574","xlab = Discipline,","YOUR NAME" +"1465835077006","ylab = Frequency,","YOUR NAME" +"1465835079393","legend = rownames(tab2)) ","YOUR NAME" +"1465835124847","","YOUR NAME" +"1465835125316","","YOUR NAME" +"1465835126679","colors()[grep(gray, x = colors())]","YOUR NAME" +"1465835127353","barplot(tab2, beside = FALSE,","YOUR NAME" +"1465835128335","xlab = Discipline,","YOUR NAME" +"1465835128920","ylab = Frequency,","YOUR NAME" +"1465835226520","barplot(tab2, beside = FALSE,","YOUR NAME" +"1465835227278","xlab = Discipline,","YOUR NAME" +"1465835228736","ylab = Frequency,","YOUR NAME" +"1465835240761","legend(x = .45, y = 150, legend = rownames(tab2),","YOUR NAME" +"1465835241501","fill = c(gray25, gray50, gray75),","YOUR NAME" +"1465835305495","bg = white)","YOUR NAME" +"1465835308064","","YOUR NAME" +"1465835313922","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465835314559","xlab = Discipline,","YOUR NAME" +"1465835337617","(tab1 <- table(Salaries$rank))","YOUR NAME" +"1465835340545","","YOUR NAME" +"1465835341027","barplot(height = tab1)","YOUR NAME" +"1465835341508","","YOUR NAME" +"1465835341877","barplot(height = tab1,","YOUR NAME" +"1465835342509","xlab = Rank,","YOUR NAME" +"1465835343063","ylab = Frequency,","YOUR NAME" +"1465835346426","main = Simple bar plot)","YOUR NAME" +"1465835348200","","YOUR NAME" +"1465835350760","barplot(height = tab1,","YOUR NAME" +"1465835351308","xlab = Frequency,","YOUR NAME" +"1465835352134","ylab = Rank,","YOUR NAME" +"1465835352804","main = Horizontal bar plot,","YOUR NAME" +"1465835353457","horiz = TRUE)","YOUR NAME" +"1465835354135","","YOUR NAME" +"1465835354736","","YOUR NAME" +"1465835355458","(tab2 <- table(Salaries$rank, Salaries$discipline))","YOUR NAME" +"1465835356189","barplot(tab2, beside = FALSE, ","YOUR NAME" +"1465835359290","xlab = Discipline,","YOUR NAME" +"1465835360055","ylab = Frequency,","YOUR NAME" +"1465835360722","legend = rownames(tab2)) ","YOUR NAME" +"1465835362780","","YOUR NAME" +"1465835363285","","YOUR NAME" +"1465835365561","colors()[grep(gray, x = colors())]","YOUR NAME" +"1465835366797","barplot(tab2, beside = FALSE,","YOUR NAME" +"1465835367551","xlab = Discipline,","YOUR NAME" +"1465835368233","ylab = Frequency,","YOUR NAME" +"1465835368915","col = c(gray25, gray50, gray75))","YOUR NAME" +"1465835369652","legend(x = .45, y = 150, legend = rownames(tab2),","YOUR NAME" +"1465835371487","fill = c(gray25, gray50, gray75),","YOUR NAME" +"1465835374274","bg = white)","YOUR NAME" +"1465835374990","","YOUR NAME" +"1465835376554","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465835377228","xlab = Discipline,","YOUR NAME" +"1465835377927","ylab = Frequency,","YOUR NAME" +"1465835378528","col = c(gray30, gray75, gray90),","YOUR NAME" +"1465835379147","main = Rank by Discipline)","YOUR NAME" +"1465835379870","legend(x = 1.2, y = 100, legend = rownames(tab2),","YOUR NAME" +"1465835382313","fill = c(gray30, gray75, gray90)) ","YOUR NAME" +"1465835428763","load(ecls.data)","YOUR NAME" +"1465835518193","load load(ecls)","YOUR NAME" +"1465835542179","as.data.frame(ecls.data)","YOUR NAME" +"1465835699348","getwd()","YOUR NAME" +"1465835710597","setwd","YOUR NAME" +"1465835831187","setwd(file=C:/Users/Ben/Documents/Downloads/5026)","YOUR NAME" +"1465835899585","setwd(file = C","YOUR NAME" +" /Users/Ben/Documents/5026)","","YOUR NAME" +"1465835966680","setwd(file = C","YOUR NAME" +" /USers/Ben/Documents/56026","","YOUR NAME" +"1465836578846","install.packages(C:/Users/Ben/Downloads/ecls (1).Rdata, repos = NULL)","YOUR NAME" +"1465836663722","getwd()","YOUR NAME" +"1465836706148","setwd(dir dir = <)","YOUR NAME" +"1465836720519","install.packages(ecls)","YOUR NAME" +"1465836807265","histdat <- c(0.2,0.2,0.6,0.6,1.1,","YOUR NAME" +"1465836807734","1.2,1.5,1.6,1.8,2.3,","YOUR NAME" +"1465836808035","3.5,3.8,4.4,4.7,5.3,","YOUR NAME" +"1465836808259","6.4,6.7,7.5,7.6,12.6)","YOUR NAME" +"1465836808432","h1 <- hist(histdat)","YOUR NAME" +"1465836811993","","YOUR NAME" +"1465836812172","","YOUR NAME" +"1465836812358","h1","YOUR NAME" +"1465836812556","","YOUR NAME" +"1465836812909","","YOUR NAME" +"1465836813246","","YOUR NAME" +"1465836813711","","YOUR NAME" +"1465836814372","hist(histdat, freq = FALSE)","YOUR NAME" +"1465836815294","","YOUR NAME" +"1465836815726","attach(Salaries)","YOUR NAME" +"1465836816242","","YOUR NAME" +"1465836816458","","YOUR NAME" +"1465836816974","h2 <- hist(yrs.since.phd, xlab = Years Since PhD,","YOUR NAME" +"1465836817458","main = Histogram of Years Since PhD)","YOUR NAME" +"1465836819731","","YOUR NAME" +"1465836820125","h2","YOUR NAME" +"1465836820257","","YOUR NAME" +"1465836820758","","YOUR NAME" +"1465836821374","plot(h1$mids, h1$counts, type = h)","YOUR NAME" +"1465836821945","plot(h1$mids, h1$counts, type = S)","YOUR NAME" +"1465836823692","","YOUR NAME" +"1465836823950","range(yrs.since.phd)","YOUR NAME" +"1465836824135","brks <- seq(0, 60, 10)","YOUR NAME" +"1465836824308","hist(yrs.since.phd, breaks = brks, xlab = Years Since PhD)","YOUR NAME" +"1465836824661","brks <- seq(0, 60, 2)","YOUR NAME" +"1465836824922","hist(yrs.since.phd, breaks = brks, xlab = Years Since PhD)","YOUR NAME" +"1465836827878","","YOUR NAME" +"1465836828107","","YOUR NAME" +"1465836828386","hist(yrs.since.phd, breaks = 10)","YOUR NAME" +"1465836873165","plot(h2$mids, h1$counts, type = h)","YOUR NAME" +"1465836873654","plot(h2$mids, h1$counts, type = S)","YOUR NAME" +"1465836901218","","YOUR NAME" +"1465836901656","range(yrs.since.phd)","YOUR NAME" +"1465836902606","brks <- seq(0, 60, 10)","YOUR NAME" +"1465836903303","hist(yrs.since.phd, breaks = brks, xlab = Years Since PhD)","YOUR NAME" +"1465836904035","brks <- seq(0, 60, 2)","YOUR NAME" +"1465836906320","hist(yrs.since.phd, breaks = brks, xlab = Years Since PhD)","YOUR NAME" +"1465836907375","","YOUR NAME" +"1465836908088","","YOUR NAME" +"1465837057862","hist(Salaries)","YOUR NAME" +"1465837152586","hist(Salaries$salary)","YOUR NAME" +"1465837207059","hist(yrs.service)","YOUR NAME" +"1465837268055","hist(salary, breaks = 30)","YOUR NAME" +"1465837287711","hist(salary, breaks = 100)","YOUR NAME" +"1465837532255","d1","YOUR NAME" +"1465837533103","summary(d1)","YOUR NAME" +"1465837534014","attributes(d1)","YOUR NAME" +"1465837540275","d1 <- density(salary)","YOUR NAME" +"1465837540722","plot(d1,","YOUR NAME" +"1465837541160","xlab = Salary in Dollars,","YOUR NAME" +"1465837541623","main = Kernel Density Plot of Academic Salaries)","YOUR NAME" +"1465837542086","","YOUR NAME" +"1465837542502","d1","YOUR NAME" +"1465837544267","summary(d1)","YOUR NAME" +"1465838186809","load(C:/Users/Ben/Downloads/ecls (3).Rdata)","YOUR NAME" +"1465838196821","","YOUR NAME" +"1465838357664","library(car)","YOUR NAME" +"1465838358149","","YOUR NAME" +"1465838358350","","YOUR NAME" +"1465838358534","","YOUR NAME" +"1465838358680","","YOUR NAME" +"1465838358865","","YOUR NAME" +"1465838359065","","YOUR NAME" +"1465838359197","","YOUR NAME" +"1465838359381","","YOUR NAME" +"1465838359566","","YOUR NAME" +"1465838359767","","YOUR NAME" +"1465838360035","","YOUR NAME" +"1465838360198","","YOUR NAME" +"1465838360453","","YOUR NAME" +"1465838360614","","YOUR NAME" +"1465838360851","","YOUR NAME" +"1465838361158","(tab1 <- table(Salaries$rank))","YOUR NAME" +"1465838361352","","YOUR NAME" +"1465838361536","barplot(height = tab1)","YOUR NAME" +"1465838361789","","YOUR NAME" +"1465838361980","barplot(height = tab1,","YOUR NAME" +"1465838362083","xlab = Rank,","YOUR NAME" +"1465838362434","ylab = Frequency,","YOUR NAME" +"1465838362664","main = Simple bar plot)","YOUR NAME" +"1465838362850","","YOUR NAME" +"1465838363071","barplot(height = tab1,","YOUR NAME" +"1465838363223","xlab = Frequency,","YOUR NAME" +"1465838363407","ylab = Rank,","YOUR NAME" +"1465838363704","main = Horizontal bar plot,","YOUR NAME" +"1465838363832","horiz = TRUE)","YOUR NAME" +"1465838364176","","YOUR NAME" +"1465838364286","","YOUR NAME" +"1465838364561","(tab2 <- table(Salaries$rank, Salaries$discipline))","YOUR NAME" +"1465838364739","barplot(tab2, beside = FALSE, ","YOUR NAME" +"1465838365097","xlab = Discipline,","YOUR NAME" +"1465838365249","ylab = Frequency,","YOUR NAME" +"1465838365534","legend = rownames(tab2)) ","YOUR NAME" +"1465838365665","","YOUR NAME" +"1465838365989","","YOUR NAME" +"1465838366157","colors()[grep(gray, x = colors())]","YOUR NAME" +"1465838366455","barplot(tab2, beside = FALSE,","YOUR NAME" +"1465838366628","xlab = Discipline,","YOUR NAME" +"1465838367144","ylab = Frequency,","YOUR NAME" +"1465838367252","col = c(gray25, gray50, gray75))","YOUR NAME" +"1465838367360","legend(x = .45, y = 150, legend = rownames(tab2),","YOUR NAME" +"1465838367570","fill = c(gray25, gray50, gray75),","YOUR NAME" +"1465838367836","bg = white)","YOUR NAME" +"1465838368127","","YOUR NAME" +"1465838370276","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465838370830","xlab = Discipline,","YOUR NAME" +"1465838371443","fill = c(gray30, gray75, gray90)) ","YOUR NAME" +"1465838371792","main = Rank by Discipline)","YOUR NAME" +"1465838371808","legend(x = 1.2, y = 100, legend = rownames(tab2),","YOUR NAME" +"1465838371814","ylab = Frequency,","YOUR NAME" +"1465838371913","col = c(gray30, gray75, gray90),","YOUR NAME" +"1465838374548","","YOUR NAME" +"1465838374834","","YOUR NAME" +"1465838375095","","YOUR NAME" +"1465838375422","","YOUR NAME" +"1465838375584","","YOUR NAME" +"1465838375689","","YOUR NAME" +"1465838376018","","YOUR NAME" +"1465838376184","","YOUR NAME" +"1465838376481","","YOUR NAME" +"1465838376597","","YOUR NAME" +"1465838377038","","YOUR NAME" +"1465838377165","","YOUR NAME" +"1465838377482","","YOUR NAME" +"1465838377603","","YOUR NAME" +"1465838378085","","YOUR NAME" +"1465838378334","","YOUR NAME" +"1465838378628","histdat <- c(0.2,0.2,0.6,0.6,1.1,","YOUR NAME" +"1465838378776","1.2,1.5,1.6,1.8,2.3,","YOUR NAME" +"1465838379059","3.5,3.8,4.4,4.7,5.3,","YOUR NAME" +"1465838379221","6.4,6.7,7.5,7.6,12.6)","YOUR NAME" +"1465838379514","h1 <- hist(histdat)","YOUR NAME" +"1465838379940","","YOUR NAME" +"1465838380130","","YOUR NAME" +"1465838380342","h1","YOUR NAME" +"1465838380665","","YOUR NAME" +"1465838380965","","YOUR NAME" +"1465838381234","","YOUR NAME" +"1465838381429","","YOUR NAME" +"1465838381708","hist(histdat, freq = FALSE)","YOUR NAME" +"1465838382123","","YOUR NAME" +"1465838382352","attach(Salaries)","YOUR NAME" +"1465838382672","","YOUR NAME" +"1465838382913","","YOUR NAME" +"1465838383391","main = Histogram of Years Since PhD)","YOUR NAME" +"1465838383438","h2 <- hist(yrs.since.phd, xlab = Years Since PhD,","YOUR NAME" +"1465838383586","","YOUR NAME" +"1465838383878","h2","YOUR NAME" +"1465838384082","","YOUR NAME" +"1465838384383","","YOUR NAME" +"1465838384630","plot(h1$mids, h1$counts, type = h)","YOUR NAME" +"1465838384946","plot(h1$mids, h1$counts, type = S)","YOUR NAME" +"1465838385230","","YOUR NAME" +"1465838385452","range(yrs.since.phd)","YOUR NAME" +"1465838387032","brks <- seq(0, 60, 10)","YOUR NAME" +"1465838387246","hist(yrs.since.phd, breaks = brks, xlab = Years Since PhD)","YOUR NAME" +"1465838387631","brks <- seq(0, 60, 2)","YOUR NAME" +"1465838387727","hist(yrs.since.phd, breaks = brks, xlab = Years Since PhD)","YOUR NAME" +"1465838388182","","YOUR NAME" +"1465838388394","","YOUR NAME" +"1465838388574","hist(yrs.since.phd, breaks = 10)","YOUR NAME" +"1465838388778","hist(yrs.since.phd, breaks = 20)","YOUR NAME" +"1465838389244","hist(yrs.since.phd, breaks = 30)","YOUR NAME" +"1465838389551","hist(yrs.since.phd, breaks = 40)","YOUR NAME" +"1465838389697","hist(yrs.since.phd, breaks = 50)","YOUR NAME" +"1465838390227","","YOUR NAME" +"1465838390457","","YOUR NAME" +"1465838390591","hist(yrs.since.phd, breaks = 80)","YOUR NAME" +"1465838390899","","YOUR NAME" +"1465838391160","","YOUR NAME" +"1465838391492","","YOUR NAME" +"1465838391711","","YOUR NAME" +"1465838392045","","YOUR NAME" +"1465838392273","","YOUR NAME" +"1465838392546","","YOUR NAME" +"1465838392885","detach(Salaries)","YOUR NAME" +"1465838393152","","YOUR NAME" +"1465838393452","","YOUR NAME" +"1465838393722","","YOUR NAME" +"1465838394044","","YOUR NAME" +"1465838394288","attach(Salaries)","YOUR NAME" +"1465838394574","","YOUR NAME" +"1465838394852","hist(salary, breaks = 25,","YOUR NAME" +"1465838395162","xlab = Salary in Dollars,","YOUR NAME" +"1465838395483","main = Academic Salaries,","YOUR NAME" +"1465838395735","freq = TRUE)","YOUR NAME" +"1465838396038","","YOUR NAME" +"1465838396250","hist(salary, breaks = 25,","YOUR NAME" +"1465838396654","xlab = Salary in Dollars,","YOUR NAME" +"1465838396770","main = Academic Salaries,","YOUR NAME" +"1465838397161","freq = FALSE)","YOUR NAME" +"1465838397345","","YOUR NAME" +"1465838397702","","YOUR NAME" +"1465838398125","d1 <- density(salary)","YOUR NAME" +"1465838398290","plot(d1,","YOUR NAME" +"1465838398515","xlab = Salary in Dollars,","YOUR NAME" +"1465838398825","main = Kernel Density Plot of Academic Salaries)","YOUR NAME" +"1465838399186","","YOUR NAME" +"1465838399453","d1","YOUR NAME" +"1465838399995","summary(d1)","YOUR NAME" +"1465838400194","attributes(d1)","YOUR NAME" +"1465838400309","","YOUR NAME" +"1465838400662","","YOUR NAME" +"1465838401104","","YOUR NAME" +"1465838401372","hist(salary, breaks = 25,","YOUR NAME" +"1465838401635","xlab = Salary in Dollars,","YOUR NAME" +"1465838402113","main = Academic Salaries,","YOUR NAME" +"1465838402413","freq = FALSE) ","YOUR NAME" +"1465838402742","","YOUR NAME" +"1465838403093","lines(d1, col = blue, lwd = 3)","YOUR NAME" +"1465838403485","","YOUR NAME" +"1465838403857","","YOUR NAME" +"1465838404165","h3 <- hist(salary, breaks = 25,","YOUR NAME" +"1465838404441","xlab = Salary in Dollars,","YOUR NAME" +"1465838404757","main = Academic Salaries,","YOUR NAME" +"1465838405827","freq = TRUE) ","YOUR NAME" +"1465838406148","h1 ","YOUR NAME" +"1465838406413","","YOUR NAME" +"1465838406918","","YOUR NAME" +"1465838407085","","YOUR NAME" +"1465838407248","","YOUR NAME" +"1465838407595","points(x = d1$x, y = d1$y*1985000, col = blue,","YOUR NAME" +"1465838407988","lwd = 3, type = l)","YOUR NAME" +"1465838408295","","YOUR NAME" +"1465838408642","range(salary)","YOUR NAME" +"1465838409102","xfit <- seq(30000, 250000, length = 100)","YOUR NAME" +"1465838409552","yfit <- dnorm(xfit, mean = mean(salary), sd = sd(salary))*1985000","YOUR NAME" +"1465838410056","","YOUR NAME" +"1465838410521","lines(xfit, yfit, col = red, lwd = 3)","YOUR NAME" +"1465838411057","","YOUR NAME" +"1465838411804","detach(Salaries)","YOUR NAME" +"1465838412374","","YOUR NAME" +"1465838412906","","YOUR NAME" +"1465838413259","","YOUR NAME" +"1465838415272","","YOUR NAME" +"1465838417226","","YOUR NAME" +"1465838417514","","YOUR NAME" +"1465838417894","","YOUR NAME" +"1465838446863","hist(ecls$C6R4MSCL)","YOUR NAME" +"1465915975650","load(C:/Users/Ben/Downloads/ecls.Rdata)","YOUR NAME" +"1465916596784","sub1 <- leadership$age <= 65 ","YOUR NAME" +"1465916608685","manager <- c(67, 211, 263, 211, 67, 263, 162, 121, 243, 263, 211, 121, 211,","YOUR NAME" +"1465916609213","243, 211, 158, 30, 30, 243, 76, 243, 67, 162, 243, 158)","YOUR NAME" +"1465916609662","country <- c(US, UK, UK, UK, US, UK, US, US, UK, UK, UK,","YOUR NAME" +"1465916610224","US, UK, UK, UK, US, US, US, UK, US, UK, US,","YOUR NAME" +"1465916610262","US, UK, US)","YOUR NAME" +"1465916610778","gender <- c(F, M, M, M, F, M, F, F, M, M, M, F, M,","YOUR NAME" +"1465916611473","M, M, F, F, F, M, M, M, F, F, M, F)","YOUR NAME" +"1465916611639","age <- c(64, 46, 49, 31, -9999, 67, 22, 18, 64, 24, 37, 36, 18, 20, 49, 28, 40,","YOUR NAME" +"1465916612040","39, 54, 47, 35, 49, 81, 58, 50)","YOUR NAME" +"1465916612344","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)","YOUR NAME" +"1465916612563","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)","YOUR NAME" +"1465916612683","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)","YOUR NAME" +"1465916613057","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)","YOUR NAME" +"1465916613248","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)","YOUR NAME" +"1465916613385","leadership <- data.frame(manager, country, gender, age, q1, q2, q3,","YOUR NAME" +"1465916614027","q4, q5, stringsAsFactors=FALSE)","YOUR NAME" +"1465916614764","leadership","YOUR NAME" +"1465916615241","","YOUR NAME" +"1465916617126","","YOUR NAME" +"1465916617361","","YOUR NAME" +"1465916617945","","YOUR NAME" +"1465916618064","","YOUR NAME" +"1465916618181","which(leadership$age == -9999)","YOUR NAME" +"1465916618376","leadership$age[which(leadership$age == -9999)]","YOUR NAME" +"1465916618747","leadership$age[which(leadership$age == -9999)] <- NA","YOUR NAME" +"1465916618975","leadership","YOUR NAME" +"1465916619317","","YOUR NAME" +"1465916619564","leadership$age[5] <- -9999","YOUR NAME" +"1465916627850","leadership","YOUR NAME" +"1465916628046","","YOUR NAME" +"1465916628642","leadership$age == -9999","YOUR NAME" +"1465916629964","leadership$age[leadership$age == -9999] <- NA","YOUR NAME" +"1465916632343","leadership","YOUR NAME" +"1465916632783","","YOUR NAME" +"1465916632957","leadership$age[5] <- -9999","YOUR NAME" +"1465916633286","leadership","YOUR NAME" +"1465916633957","","YOUR NAME" +"1465916634653","","YOUR NAME" +"1465916635008","","YOUR NAME" +"1465916635873","leadership <- edit(leadership)","YOUR NAME" +"1465916641465","","YOUR NAME" +"1465916641813","leadership$age[5] <- -9999","YOUR NAME" +"1465916641981","leadership","YOUR NAME" +"1465916642213","","YOUR NAME" +"1465916642625","names(leadership) == age","YOUR NAME" +"1465916642814","which(names(leadership) == age)","YOUR NAME" +"1465916643213","leadership[5,4] <- NA","YOUR NAME" +"1465916643857","leadership","YOUR NAME" +"1465916644657","","YOUR NAME" +"1465916645148","leadership$age[5] <- -9999","YOUR NAME" +"1465916645720","leadership","YOUR NAME" +"1465916646494","","YOUR NAME" +"1465916647029","leadership == -9999 ","YOUR NAME" +"1465916647818","leadership[leadership == -9999] <- NA ","YOUR NAME" +"1465916648473","leadership","YOUR NAME" +"1465916662141","","YOUR NAME" +"1465916662248","","YOUR NAME" +"1465916662710","","YOUR NAME" +"1465916662883","","YOUR NAME" +"1465916663525","leadership$age_cat <- NA","YOUR NAME" +"1465916665089","leadership","YOUR NAME" +"1465916665873","leadership$age_cat[leadership$age > 65] <- Elder","YOUR NAME" +"1465916667576","leadership","YOUR NAME" +"1465916668525","leadership$age_cat[leadership$age >= 45 & leadership$age <= 65] <- Middle Aged","YOUR NAME" +"1465916669715","leadership","YOUR NAME" +"1465916670748","leadership$age_cat[leadership$age < 45] <- Younger","YOUR NAME" +"1465916671655","leadership","YOUR NAME" +"1465916672683","","YOUR NAME" +"1465916673425","leadership$age_cat[is.na(leadership$age)] <- NA","YOUR NAME" +"1465916674241","leadership","YOUR NAME" +"1465916675144","","YOUR NAME" +"1465916675827","leadership$age_cat <- factor(leadership$age_cat,","YOUR NAME" +"1465916676652","levels = c(Younger, Middle Aged, Elder),","YOUR NAME" +"1465916677370","ordered = TRUE)","YOUR NAME" +"1465916678182","str(leadership)","YOUR NAME" +"1465916679719","","YOUR NAME" +"1465916680305","leadership <- within(leadership, {","YOUR NAME" +"1465916681201","age_cat2 <- NA","YOUR NAME" +"1465916681876","age_cat2[age > 65] <- Elder","YOUR NAME" +"1465916682788","age_cat2[age >= 45 & age <= 65] <- Middle Aged","YOUR NAME" +"1465916684188","age_cat2[age < 45] <- Younger","YOUR NAME" +"1465916684901","age_cat2 <- factor(age_cat2,","YOUR NAME" +"1465916686304","levels = c(Younger, Middle Aged, Elder),","YOUR NAME" +"1465916686706","ordered = TRUE)","YOUR NAME" +"1465916705758","})","YOUR NAME" +"1465916707462","leadership","YOUR NAME" +"1465916709419","str(leadership)","YOUR NAME" +"1465916717431","str(leadership)","YOUR NAME" +"1465916981863","dim(leadership)","YOUR NAME" +"1465916982687","sub1 <- leadership$age <= 65 ","YOUR NAME" +"1465916985863","sub1","YOUR NAME" +"1465917030774","sum(sub1, na.rm = TRUE) ","YOUR NAME" +"1465917031546","","YOUR NAME" +"1465917037405","df1 <- subset(leadership, subset = sub1)","YOUR NAME" +"1465917041996","dim(df1)","YOUR NAME" +"1465917062171","table(df1$age_cat, useNA = always)","YOUR NAME" +"1465917072371","","YOUR NAME" +"1465917073306","sub2 <- leadership$age_cat != Elder","YOUR NAME" +"1465917074463","sub2","YOUR NAME" +"1465917079333","sum(sub2, na.rm = TRUE)","YOUR NAME" +"1465917080122","df2 <- subset(x = leadership, subset = sub2)","YOUR NAME" +"1465917083948","df2","YOUR NAME" +"1465917308282","for (i in 1","YOUR NAME" +"10) print(i)","","YOUR NAME" +"1465917310318","","YOUR NAME" +"1465917313232","(out1 <- NULL)","YOUR NAME" +"1465917313922","for (i in 1","YOUR NAME" +"10) out1[i] <- i","","YOUR NAME" +"1465917314629","out1","YOUR NAME" +"1465917326721","for (i in 1","YOUR NAME" +"10) out1[i] <- 2*i - 1","","YOUR NAME" +"1465917328179","out1","YOUR NAME" +"1465917336454","","YOUR NAME" +"1465917336962","for (i in 1","YOUR NAME" +"10)","","YOUR NAME" +"1465917338529","{","YOUR NAME" +"1465917339696","if (i == 3 | i == 7) next","YOUR NAME" +"1465917340340","print(i)","YOUR NAME" +"1465917341676","}","YOUR NAME" +"1465917350947","","YOUR NAME" +"1465917351376","for (i in 1","YOUR NAME" +"10)","","YOUR NAME" +"1465917352037","{","YOUR NAME" +"1465917352328","if (i == 3 | i == 7) break","YOUR NAME" +"1465917352717","print(i)","YOUR NAME" +"1465917353193","}","YOUR NAME" +"1465917393335","","YOUR NAME" +"1465918981256","USArrests","YOUR NAME" +"1465918994649","USArrests","YOUR NAME" +"1465919254367","leadership$age_cat[leadership$age > 65] <- Elder","YOUR NAME" +"1465919360651","USArrests$Assault_cat[USArrests$Assault<=110]<- low","YOUR NAME" +"1465919372197","USArrests$Assault_cat<- NA","YOUR NAME" +"1465919389403","Assault_cat","YOUR NAME" +"1465919431974","USArrests<-within(USArrests, {","YOUR NAME" +"1465919432226","Assault_cat2 <-NA","YOUR NAME" +"1465919432369","Assault_cat2 [USArrests$Assault<=110]<- low","YOUR NAME" +"1465919432579","Assault_cat2 [USArrests$Assault<=160]<- low","YOUR NAME" +"1465919432738","Assault_cat2 [USArrests$Assault<=250]<- middle-high","YOUR NAME" +"1465919432921","Assault_cat2 [USArrests$Assault>250]<- high","YOUR NAME" +"1465919433441","Assault_cat<- factor(Assault_cat2,","YOUR NAME" +"1465919434921","levels = c(low, middlelow, middle-high, high)","YOUR NAME" +"1465919435291","ordered = (TRUE) })","YOUR NAME" +"1465919437731","string(USArrests$Assault)","YOUR NAME" +"1465921329932","USArrests<-within(USArrests, {","YOUR NAME" +"1465921330353","Assault_cat2 <-NA","YOUR NAME" +"1465921330749","Assault_cat2 [USArrests$Assault<=110]<- low","YOUR NAME" +"1465921331057","Assault_cat2 [USArrests$Assault<=160]<- low","YOUR NAME" +"1465921331484","Assault_cat2 [USArrests$Assault<=250]<- middle-high","YOUR NAME" +"1465921331867","Assault_cat2 [USArrests$Assault>250]<- high","YOUR NAME" +"1465921332266","Assault_cat<- factor(Assault_cat2,","YOUR NAME" +"1465921332706","levels = c(low, middlelow, middle-high, high)","YOUR NAME" +"1465921333265","ordered = (TRUE) })","YOUR NAME" +"1465921378939","USArrests<-within(USArrests, {","YOUR NAME" +"1465921379341","Assault_cat2 <-NA","YOUR NAME" +"1465921379719","Assault_cat2 [USArrests$Assault<=110]<- low","YOUR NAME" +"1465921380093","Assault_cat2 [USArrests$Assault<=160]<- low","YOUR NAME" +"1465921380393","Assault_cat2 [USArrests$Assault<=250]<- middle-high","YOUR NAME" +"1465921380793","Assault_cat2 [USArrests$Assault>250]<- high","YOUR NAME" +"1465921381174","Assault_cat<- factor(Assault_cat2,","YOUR NAME" +"1465921381762","levels = c(low, middlelow, middle-high, high),","YOUR NAME" +"1465921382526","ordered = (TRUE) })","YOUR NAME" +"1465921480914","USArrests<-within(USArrests, {","YOUR NAME" +"1465921481347","Assault_cat2 <-NA","YOUR NAME" +"1465921481760","Assault_cat2[USArrests$Assault<=110]<- low","YOUR NAME" +"1465921482181","Assault_cat2[USArrests$Assault<=160]<- middle-low","YOUR NAME" +"1465921482666","Assault_cat2[USArrests$Assault<=250]<- middle-high","YOUR NAME" +"1465921483092","Assault_cat2[USArrests$Assault>250]<- high","YOUR NAME" +"1465921484378","Assault_cat2<- factor(Assault_cat2,","YOUR NAME" +"1465921484860","levels = c(low, middle-low, middle-high, high),","YOUR NAME" +"1465921485419","ordered = (TRUE) })","YOUR NAME" +"1465921496523","USArrests<-within(USArrests, {","YOUR NAME" +"1465921496757","Assault_cat2 <-NA","YOUR NAME" +"1465921497053","Assault_cat2[USArrests$Assault<=110]<- low","YOUR NAME" +"1465921497143","Assault_cat2[USArrests$Assault<=160]<- middle-low","YOUR NAME" +"1465921497400","Assault_cat2[USArrests$Assault<=250]<- middle-high","YOUR NAME" +"1465921497606","Assault_cat2[USArrests$Assault>250]<- high","YOUR NAME" +"1465921497820","Assault_cat2<- factor(Assault_cat2,","YOUR NAME" +"1465921498180","levels = c(low, middle-low, middle-high, high),","YOUR NAME" +"1465921498716","ordered = TRUE })","YOUR NAME" +"1465921547283","USArrests<-within(USArrests, {","YOUR NAME" +"1465921547488","Assault_cat2 <-NA","YOUR NAME" +"1465921547642","Assault_cat2[USArrests$Assault<=110]<- low","YOUR NAME" +"1465921547865","Assault_cat2[USArrests$Assault<=160]<- middle-low","YOUR NAME" +"1465921548061","Assault_cat2[USArrests$Assault<=250]<- middle-high","YOUR NAME" +"1465921548288","Assault_cat2[USArrests$Assault>250]<- high","YOUR NAME" +"1465921548493","Assault_cat2<- factor(Assault_cat2,","YOUR NAME" +"1465921548742","levels = c(low, middle-low, middle-high, high),","YOUR NAME" +"1465921549627","ordered = TRUE) })","YOUR NAME" +"1465921588826","USArrests","YOUR NAME" +"1465921622342","dim(USArrests)","YOUR NAME" +"1465921623092","sub1<- subset(USArrests$UrbanPop)<=50","YOUR NAME" +"1465921623607","sub1","YOUR NAME" +"1465921624803","sum(sub1, na.rm = TRUE)","YOUR NAME" +"1465921625321","df1 <- subset(USArrests$UrbanPop, subset = sub1)","YOUR NAME" +"1465921625876","dim(df1)","YOUR NAME" +"1465921626376","table(df1$Arrests$UrbanPop, useNA = always)","YOUR NAME" +"1465921627044","","YOUR NAME" +"1465921906267","ind<-order(USArrests$UrbanPop)","YOUR NAME" +"1465922090960","state.abb","YOUR NAME" +"1465922101042","state.abb[ind]","YOUR NAME" +"1465922230855","ind<-order(USArrests$UrbanPop, decreasing = TRUE)","YOUR NAME" +"1465922233288","df1<-USArrests[ind, ]","YOUR NAME" +"1465922262343","ind<-order(USArrests$UrbanPop, decreasing = FALSE)","YOUR NAME" +"1465922327973","USArrests[1","YOUR NAME" +"10,]","","YOUR NAME" +"1465922339423","USArrests[,1","YOUR NAME" +"3]","","YOUR NAME" +"1465922350647","USArrests[10,]","YOUR NAME" +"1465922366304","USArrests[c(45,48,24),]","YOUR NAME" +"1465922482382","Dispatcher.Shift.type.4 <- read.table(~/Dispatcher Shift type 4.txt, quote=\"") +1465922482397:View(Dispatcher.Shift.type.4) +1465922577341:hist(Dispatcher.Shift.type.4) +1465922593943:class(Dispatcher.Shift.type.4) +1465922614265:head(Dispatcher.Shift.type.4) +1465922628398:hist(Dispatcher.Shift.type.4$V1) +1465958042304:Stress.Data <- read.delim(C","YOUR NAME" +"/Users/Ben/Downloads/Stress Data.txt) +1465958042372:View(Stress.Data) +1465958151428:`Bar.Graph.(1)` <- read.delim(C","/Users/Ben/Downloads/Bar Graph (1).txt) +1465958151458:View(`Bar.Graph.(1)`) +1465958587734:Stress.Data +1465958589310:Stress.Data$Emergencies +1465958590328:(tab1 <- table(Stress.Data$Emergencies)) +1465958593747:barplot(height = tab1) +1465958597372:barplot(height = tab1, +1465958598830:xlab = Self Reported Stress Level, +1465958600125:ylab = Number of Dispatchers, +1465958601303:main = Self Reported Stress for Emergencies) +1465958605454:(tab2 <- table(Stress.Data$Emergencies, Stress.Data$Joppressure) +1465958606565:barplot(tab2, beside = FALSE, # stacked +1465958627956:(tab2 <- table(Salaries$rank, Salaries$discipline)) +1465958628483:barplot(tab2, beside = FALSE, # stacked +1465958628529:xlab = Discipline, +1465958628898:ylab = Frequency, +1465958629534:legend = rownames(tab2)) # Add a legend +1465958694755:(tab2 <- table(Stress.Data$Emergencies, Stress.Data$Jobpressure) +1465958695684:barplot(tab2, beside = FALSE, # stacked +1465958696122:xlab = Discipline, +1465958696980:ylab = Frequency, +1465958697775:legend = rownames(tab2)) # Add a legend +1465958733595:tab2 <- (table(Stress.Data$Emergencies, Stress.Data$Jobpressure) +1465958733994:barplot(tab2, beside = FALSE, # stacked +1465958734451:xlab = Discipline, +1465958755547:Stress.Data +1465958756415:Stress.Data$Emergencies +1465958757834:(tab1 <- table(Stress.Data$Emergencies)) +1465958758843:barplot(height = tab1) +1465958759671:barplot(height = tab1, +1465958760460:xlab = Self Reported Stress Level, +1465958761484:ylab = Number of Dispatchers, +1465958762197:main = Self Reported Stress for Emergencies) +1465959166933:(tab2<- table(Stress.Data$Emergencies)) +1465959167885:barplot(tab2, beside beside = FALSE) #stacked +1465959184994:(tab2<- table(Stress.Data$Emergencies)) +1465959187903:barplot(tab2, beside = FALSE) #stacked +1465959190356:xlab = Cats +1465959194045:ylab = Dogs +1465959196706:legend = rownames(tab2)) # Add a legend +1465959235035:(tab2<- table(Stress.Data$Emergencies)) +1465959236048:barplot(tab2, beside = FALSE) #stacked +1465959237326:xlab = Cats, +1465959256971:(tab2<- table(Stress.Data$Emergencies)) +1465959258642:barplot(tab2, beside = FALSE #stacked +1465959260950:xlab = Cats, +1465959280128:(tab2<- table(Stress.Data$Emergencies)) +1465959281194:barplot(tab2, beside = FALSE, #stacked +1465959283238:xlab = Cats, +1465959285104:ylab = Dogs, +1465959287130:legend = rownames(tab2)) # Add a legend +1465959417016:(tab2<- table(Stress.Data$Emergencies, Stress.Data$Lack_of_control)) +1465959419476:barplot(tab2, beside = FALSE, #stacked +1465959420843:xlab = Number of Responses, +1465959422713:ylab = Stress Level, +1465959425463:legend = rownames(tab2)) # Add a legend +1465959531198:(tab2<- table(Stress.Data$Emergencies, Stress.Data$Lack_of_control)) +1465959532092:barplot(tab2, beside = FALSE, #stacked +1465959532747:xlab = Stress Level, +1465959533421:ylab = Number of Responses, +1465959534384:legend = rownames(tab2)) # Add a legend +1465959585777:(tab2<- table(Stress.Data$Emergencies, Stress.Data$Lack_of_control, Stress.Data$Coord_other_depts,Stress.Data$Sleep_loss)) +1465959586679:barplot(tab2, beside = FALSE, #stacked +1465959587185:xlab = Stress Level, +1465959587707:ylab = Number of Responses, +1465959588306:legend = rownames(tab2)) # Add a legend +1465959727163:(tab2<- table(Stress.Data$Emergencies, Stress.Data$Lack_of_control, Stress.Data$Coord_other_depts,Stress.Data$Sleep_loss,Stress.Data$Job_pressure,Stress.Data$Scanty_Rules,Stress.Data$Mgmt_policies,Stress.Data$Job_Security)) +1465959729078:barplot(tab2, beside = FALSE, #stacked +1465959730544:xlab = Stress Level, +1465959732197:ylab = Number of Responses, +1465959734842:legend = rownames(tab2)) # Add a legend +1465959825850:Stress.Data$Emergencies +1465959826441:(tab1 <- table(Stress.Data$Emergencies)) +1465959827208:barplot(height = tab1) +1465959827922:barplot(height = tab1, +1465959828652:xlab = Self Reported Stress Level, +1465959830411:ylab = Number of Dispatchers, +1465959830954:main = Self Reported Stress for Emergencies) +1465960149792:colors()[grep(gray, x = colors())] +1465960172658:colors()[grep(blue, x = colors())] +1465960226331:colors(1)[grep(blue, x = colors(44))] +1465960241529:colors(44)[grep(blue, x = colors(1))] +1465960334206:(tab2<- table(Stress.Data$Emergencies)) +1465960336260:barplot(tab2, beside = FALSE, #stacked +1465960337736:xlab = Stress Level, +1465960340144:ylab = Number of Responses, +1465960341156:legend = rownames(tab2)) # Add a legend +1465960544569:barplot(tab2, beside = FALSE, +1465960545829:xlab = Stress Level, +1465960550351:ylab = Number of Responses, +1465960551988:col = c(blue49, red32, yellow4,green20)) +1465960573968:barplot(tab2, beside = FALSE, +1465960574674:xlab = Stress Level, +1465960575099:ylab = Number of Responses, +1465960575606:col = c(blue 1, red32, yellow4,green20)) +1465960576076:legend(x = .45, y = 150, legend = rownames(tab2), +1465960598608:barplot(tab2, beside = FALSE, +1465960599354:xlab = Stress Level, +1465960600162:ylab = Number of Responses, +1465960600860:col = c(blue 1, red 6, yellow 5,green 2)) +1465960627764:legend(x = .45, y = 150, legend = rownames(tab2), +1465960628297:fill = c(gray25, gray50, gray75), +1465960630444:bg = white) +1465960712352:barplot(tab2, beside = FALSE, +1465960713911:xlab = Stress Level, +1465960714639:ylab = Number of Responses, +1465960715158:col = c(blue 1, red 6, yellow 5,green 2)) +1465960743982:barplot(tab2, beside = FALSE, +1465960744611:xlab = Stress Level, +1465960745852:ylab = Number of Responses, +1465960746407:col = c(blue 1, red 1, yellow 5,green 2)) +1465960766308:barplot(tab2, beside = FALSE, +1465960767118:xlab = Stress Level, +1465960767799:ylab = Number of Responses, +1465960768287:col = c(blue 1, red 1, yellow 1,green 1)) +1465960775101:legend(x = .45, y = 150, legend = rownames(tab2), +1465960777276:fill = c(blue 1, red 1, yellow 1, green 1),","YOUR NAME" +"1465960777952","bg = white)","YOUR NAME" +"1465961043325","col = c(blue 1, green 1, yellow 1,green 1))","YOUR NAME" +"1465961046840","barplot(tab2, beside = FALSE,","YOUR NAME" +"1465961048097","xlab = Stress Level,","YOUR NAME" +"1465961048595","ylab = Number of Responses,","YOUR NAME" +"1465961049264","col = c(blue 1, green 1, yellow 1,green 1))","YOUR NAME" +"1465961050306","legend(x = .45, y = 150, legend = rownames(tab2),","YOUR NAME" +"1465961061882","barplot(tab2, beside = FALSE,","YOUR NAME" +"1465961062351","xlab = Stress Level,","YOUR NAME" +"1465961063131","ylab = Number of Responses,","YOUR NAME" +"1465961063865","col = c(blue 1, green 1, yellow 1,red 1))","YOUR NAME" +"1465961094127","barplot(tab2, beside = FALSE,","YOUR NAME" +"1465961153957","barplot(tab2, beside = FALSE,","YOUR NAME" +"1465961154615","xlab = Stress Level,","YOUR NAME" +"1465961155309","ylab = Number of Responses,","YOUR NAME" +"1465961155967","col = c(blue 1, green 1, yellow 1, red 1)) +1465961174349:barplot(tab2, beside = FALSE, +1465961175146:xlab = Stress Level, +1465961175572:ylab = Number of Responses, +1465961176046:col = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465961193935","barplot(tab2, beside = FALSE,","YOUR NAME" +"1465961194491","xlab = Stress Level,","YOUR NAME" +"1465961195083","ylab = Number of Responses,","YOUR NAME" +"1465961195908","col = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465961215021","(tab2<- table(Stress.Data$Emergencies))","YOUR NAME" +"1465961216429","barplot(tab2, beside = FALSE, ","YOUR NAME" +"1465961217563","xlab = Stress Level,","YOUR NAME" +"1465961218608","ylab = Number of Responses,","YOUR NAME" +"1465961222390","legend = rownames(tab2)) ","YOUR NAME" +"1465961230824","barplot(tab2, beside = FALSE,","YOUR NAME" +"1465961231499","xlab = Stress Level,","YOUR NAME" +"1465961232355","ylab = Number of Responses,","YOUR NAME" +"1465961233096","col = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465961235647","legend(x = .45, y = 150, legend = rownames(tab2),","YOUR NAME" +"1465961236853","fill = c(blue 1, red 1, yellow 1, green 1""), +1465961238616:bg = white) +1465961267439:legend(x = .45, y = 150, legend = rownames(tab2), +1465961271604:fill = c(blue 1, red 1, yellow 1, green 1),","YOUR NAME" +"1465961275226","bg = white)","YOUR NAME" +"1465961407592","xlab = Number of Responses,","YOUR NAME" +"1465961422351","","YOUR NAME" +"1465961422972","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465961429458","xlab = Number of Responses,","YOUR NAME" +"1465961432781","ylab = Stress Level,","YOUR NAME" +"1465961436475","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465961461999","main = Stress Level)","YOUR NAME" +"1465961468961","legend(x = 1.2, y = 100, legend = rownames(tab2),","YOUR NAME" +"1465961473628","fill = c(blue 1, green 1, yellow 1, red 1)) ","YOUR NAME" +"1465961830374","xlab = Number of Responses,","YOUR NAME" +"1465961831200","ylab = Stress Level,","YOUR NAME" +"1465961837180","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465961838279","xlab = Number of Responses,","YOUR NAME" +"1465961838901","ylab = Stress Level,","YOUR NAME" +"1465961841099","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465961843984","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465961844758","legend(x = 1.2, y = 100, legend = rownames(tab2),","YOUR NAME" +"1465961852283","fill = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465961885808","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465961886843","legend(x = 20, y = 200, legend = rownames(tab2),","YOUR NAME" +"1465961888743","fill = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465961894595","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465961895314","xlab = Number of Responses,","YOUR NAME" +"1465961895857","ylab = Stress Level,","YOUR NAME" +"1465961896232","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465961896864","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465961897340","legend(x = 20, y = 200, legend = rownames(tab2),","YOUR NAME" +"1465961915346","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465961915779","xlab = Number of Responses,","YOUR NAME" +"1465961916294","ylab = Stress Level,","YOUR NAME" +"1465961916700","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465961918870","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465961919447","legend(x = 10, y = 150, legend = rownames(tab2),","YOUR NAME" +"1465961920869","fill = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465961959619","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465961960695","xlab = Number of Responses,","YOUR NAME" +"1465961961312","ylab = Stress Level,","YOUR NAME" +"1465961961923","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465961964127","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465961964984","legend(x = 10, y = 150, legend = rownames(tab2),","YOUR NAME" +"1465961966012","fill = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465961981827","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465961982546","xlab = Number of Responses,","YOUR NAME" +"1465961983090","ylab = Stress Level,","YOUR NAME" +"1465961983740","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465961984244","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465961984712","legend(x = 4, y = 150, legend = rownames(tab2),","YOUR NAME" +"1465961985625","fill = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465962009794","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465962010618","xlab = Number of Responses,","YOUR NAME" +"1465962011518","ylab = Stress Level,","YOUR NAME" +"1465962012025","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465962012577","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465962013118","legend(x = 4, y = 160, legend = rownames(tab2),","YOUR NAME" +"1465962014202","fill = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465962778936","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465962779694","xlab = Stress Level (1 = none, 2 = a little, 3 = stressed, 4 very stressed ,","YOUR NAME" +"1465962781275","ylab = Number of Dispatcher Responses,","YOUR NAME" +"1465962782911","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465962787190","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465962787886","legend(x = 4, y = 160, legend = rownames(tab2),","YOUR NAME" +"1465962788610","fill = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465962817826","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465962818260","xlab = Stress Level (1 = none, 2 = a little, 3 = stressed, 4 very stressed ),","YOUR NAME" +"1465962818606","ylab = Number of Dispatcher Responses,","YOUR NAME" +"1465962819267","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465962822606","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465962842157","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465962842765","xlab = Stress Level (1 = none, 2 = a little, 3 = stressed, 4 very stressed) ,","YOUR NAME" +"1465962843264","ylab = Number of Dispatcher Responses,","YOUR NAME" +"1465962844057","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465962849774","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465962850281","legend(x = 4, y = 160, legend = rownames(tab2),","YOUR NAME" +"1465962850870","fill = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465962866920","barplot(tab2, beside = TRUE,","YOUR NAME" +"1465962868047","xlab = Stress Level (1 = none, 2 = a little, 3 = stressed, 4=very stressed) ,","YOUR NAME" +"1465962869008","ylab = Number of Dispatcher Responses,","YOUR NAME" +"1465962870151","col = c(blue 1, green 1, yellow 1, red 1),","YOUR NAME" +"1465962870944","main = Dispatcher Self Reported Stress Levels)","YOUR NAME" +"1465962871466","legend(x = 4, y = 160, legend = rownames(tab2),","YOUR NAME" +"1465962872232","fill = c(blue 1, green 1, yellow 1, red 1))","YOUR NAME" +"1465963428053","`Dispatcher.Shift.type.(10)` <- read.table(~/Dispatcher Shift type (10).txt, header=TRUE, quote=\"") +1465963428084:View(`Dispatcher.Shift.type.(10)`) +1465963528647:Dispatcher.Shift.type.11 <- read.table(~/Dispatcher Shift type 11.txt, header=TRUE, quote=\)","YOUR NAME" +"1465963528677","View(Dispatcher.Shift.type.11)","YOUR NAME" +"1465963558553","Dispatcher.Shift.type.4 <- read.table(~/Dispatcher Shift type 4.txt, quote=\"") +1465963558581:View(Dispatcher.Shift.type.4) +1465963973136:hist(Dispatcher.Shift.type.4$V1) +1465964276579:Dispatcher.Shift.type.4, xlab = Shift Type","YOUR NAME" +" 1 = day shift, 2 = night shift, 3 =Both , +1465964277309:main = MTA Dispatcher Shift Type) +1465964308390:Dispatcher.Shift.type.4, xlab =( Shift Type"," 1 = day shift, 2 = night shift, 3 =Both , +1465964310026:main = MTA Dispatcher Shift Type) +1465964526447:h1 <- hist(Dispatcher.Shift.type.4) +1465964532990:### What does the histogram tell us? +1465964533587:### What information is stored in the output? +1465964535489:h1 +1465964542249:h1 <- hist(Dispatcher.Shift.type.4) +1465964542812:### What does the histogram tell us? +1465964543697:### What information is stored in the output? +1465964544800:h1 +1465964546085:### A histogram can be generally of one of two types: frequency +1465964546436:### or density. A frequency histogram lists the actual count +1465964546883:### on the vertical axis. A density histogram rescales the vertical +1465964547191:### axis so that the total area is equal to 1. +1465964547637:hist(histdat, freq = FALSE) +1465964548174:### Verify that the total area under the histogram is 1. +1465964549645:attach(Salaries) +1465964784547:h2 <- hist(Dispatcher.Shift.type.4, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both , +1465964799734:main = Histogram of Dispatcher shift Type) +1465964829960:h2 <- hist(Dispatcher.Shift.type.4$v1, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both , +1465964830118:main = Histogram of Dispatcher shift Type) +1465964885889:h2 <- hist(v1, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both , +1465964886589:main = Histogram of Dispatcher shift Type) +1465964924954:h2 <- hist(Dispatcher.Shift.type.4$V1, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both , +1465964926569:main = Histogram of Dispatcher shift Type) +1465996359285:range(Dispatcher.Shift.type.4$V1) +1465996360954:brks <- seq(0, 1, 2,3) +1465996387725:range(Dispatcher.Shift.type.4$V1) +1465996388929:brks <- seq (1, 2,3) +1465996499931:range(Dispatcher.Shift.type.4$V1) +1465996500662:brks <- seq (1, 2,3) +1465996502623:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465996518320:brks <- seq(1, 2, 3) +1465996618498:range(Dispatcher.Shift.type.4$V1) +1465996619245:brks <- seq (1, 2,3) +1465996620210:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465996621112:brks <- seq(1, 2, 3) +1465996622651:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465996625569:### Or you can suggest a number of break points and R will pick +1465996734696:range(Dispatcher.Shift.type.4$V1) +1465996735851:brks <- seq (1, 1.5, 2, 2.5 ,3) +1465996768959:range(Dispatcher.Shift.type.4$V1) +1465996769622:brks <- seq (1, 2, 3) +1465996773801:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465996774240:brks <- seq(1, 2, 3) +1465996776143:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465996808525:range(Dispatcher.Shift.type.4$V1) +1465996809445:brks <- seq (1, 3) +1465996810918:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465996839087:range(Dispatcher.Shift.type.4$V1) +1465996839566:brks <- seq (0, 20, 40) +1465996843968:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465996861924:brks <- seq(0, 20, 20) +1465996863891:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465996895931:range(Dispatcher.Shift.type.4$V1) +1465996896446:brks <- seq (0, 2, 4) +1465996911635:range(Dispatcher.Shift.type.4$V1) +1465996913177:brks <- seq (0, 2, 4) +1465996914115:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465996943654:range(Dispatcher.Shift.type.4$V1) +1465996944846:brks <- seq(0, 2, 4) +1465996949179:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465996963662:range(Dispatcher.Shift.type.4$V1) +1465996964622:brks <- seq(1, 2, 4) +1465996966217:hist(Dispatcher.Shift.type.4$V1, breaks = brks, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ) +1465997042833:hist(Dispatcher.Shift.type.4$V1) +1465997206322:> Dispatcher.Shift.type.4 <- read.table(~/Dispatcher Shift type 4.txt, quote=\)","YOUR NAME" +"1465997207498","> View(Dispatcher.Shift.type.4)","YOUR NAME" +"1465997208184","> hist(Dispatcher.Shift.type.4$V1)","YOUR NAME" +"1465997209002","> Dispatcher.Shift.type.4, xlab = Shift Type: 1 = day shift, 2 = night shift, 3 =Both ,","YOUR NAME" +"1465997239974","hist(Dispatcher.Shift.type.4$V1)","YOUR NAME" +"1465997240600","Dispatcher.Shift.type.4 <- read.table(~/Dispatcher Shift type 4.txt, quote=\"") View(Dispatcher.Shift.type.4)hist(Dispatcher.Shift.type.4$V1) +1465997241929:Dispatcher.Shift.type.4, xlab = Shift Type","YOUR NAME" +" 1 = day shift, 2 = night shift, 3 =Both , +1465997266590:h2 <- hist(Dispatcher.Shift.type.4$V1, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both , +1465997267563:main = Histogram of Dispatcher shift Type) +1465997319660:hist() +1465997351899:hist(Dispatcher.Shift.type.4, breaks = 3) +1465997363879:hist(Dispatcher.Shift.type.4$V1, breaks = 3) +1465997390564:hist(Dispatcher.Shift.type.4$V1, breaks = 2) +1465997398629:hist(Dispatcher.Shift.type.4$V1, breaks = 4) +1465997414444:hist(Dispatcher.Shift.type.4$V1, breaks = 10) +1465997442258:hist(Dispatcher.Shift.type.4$V1, breaks = 3) +1465997451708:hist(Dispatcher.Shift.type.4$V1, breaks = 5) +1465997458846:hist(Dispatcher.Shift.type.4$V1, breaks = 6) +1465997465971:hist(Dispatcher.Shift.type.4$V1, breaks = 7) +1465997474993:hist(Dispatcher.Shift.type.4$V1, breaks = 20) +1465997507378:hist(Dispatcher.Shift.type.4$V1) +1465997507882:Dispatcher.Shift.type.4 <- read.table(~/Dispatcher Shift type 4.txt, quote=\) View(Dispatcher.Shift.type.4)hist(Dispatcher.Shift.type.4$V1)","","YOUR NAME" +"1465997508264","Dispatcher.Shift.type.4, xlab = Shift Type: 1 = day shift, 2 = night shift, 3 =Both ,","YOUR NAME" +"1465997520625","h2 <- hist(Dispatcher.Shift.type.4$V1, xlab = Shift Type 1 = Day Shift, 2 = Night Shift, 3 = Both ,","YOUR NAME" +"1465997521217","main = Histogram of Dispatcher shift Type)","YOUR NAME" +"1465999037506","Sex.and.Years.Worked.As.Dispatcher <- read.delim(~/Sex and Years Worked As Dispatcher.txt)","YOUR NAME" +"1465999037563","View(Sex.and.Years.Worked.As.Dispatcher)","YOUR NAME" +"1465999502719","boxplot(Sex.and.Years.Worked.As.Dispatcher$Sex, main = Boxplot Dispatcher:Years Worked and Sex)","YOUR NAME" +"1465999503993","table(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher)","YOUR NAME" +"1465999506569","boxplot(Sex.and.Years.Worked.As.Dispatcher$Sex ~ Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher) ","YOUR NAME" +"1465999508264","boxplot(Sex.and.Years.Worked.As.Dispatcher$Sex ~ Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher, xlab = Male or Female,","YOUR NAME" +"1465999512307","ylab = years worked)","YOUR NAME" +"1465999608516","boxplot(Sex.and.Years.Worked.As.Dispatcher$Sex, main = Boxplot Dispatcher:Years Worked and Sex)","YOUR NAME" +"1465999611731","table(Sex.and.Years.Worked.As.Dispatcher$Sex)","YOUR NAME" +"1465999614668","boxplot(Sex.and.Years.Worked.As.Dispatcher$Sex ~ Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher) ","YOUR NAME" +"1465999617065","boxplot(Sex.and.Years.Worked.As.Dispatcher$Sex ~ Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher, xlab = Years Worked,","YOUR NAME" +"1465999629252","ylab = Sex: Male = 1 Female =2)","YOUR NAME" +"1465999954152","`MTA.","YOUR NAME" +"1465999954175","View(`MTA.","YOUR NAME" +"1466000095575","plot(`MTA.","YOUR NAME" +"1466000517312","plot(`MTA.","YOUR NAME" +"1466000518891","main = Relationship Between Number of Years Worked and Dependents)","YOUR NAME" +"1466000541063","plot(`MTA.","YOUR NAME" +"1466000542190","main = (Relationship Between Number of Years Worked and Dependents)","YOUR NAME" +"1466000589741","View(`MTA.","YOUR NAME" +"1466000603396","plot(`MTA.","YOUR NAME" +"1466000700301","plot(`MTA.","YOUR NAME" +"1466000731474","plot(`MTA.","YOUR NAME" +"1466000732017","main = (Relationship Between Number of Years Worked and Dependents))","YOUR NAME" +"1466000983525","plot(`MTA.","YOUR NAME" +"1466000984056","main = (Relationship Between Number of Years Worked and Dependents)","YOUR NAME" +"1466001195213","View(`MTA.","YOUR NAME" +"1466001249025","View(`MTA.","YOUR NAME" +"1466001392117","View(`MTA.","YOUR NAME" +"1466001414958","`MTA.","YOUR NAME" +"1466001456860","`MTA.","YOUR NAME" +"1466001646336","`MTA.","YOUR NAME" +"1466001646356","View(`MTA.","YOUR NAME" +"1466001726147","MTA.Number.of.years.and.Number.of.dependents <- read.delim(~/MTA Number of years and Number of dependents.txt)","YOUR NAME" +"1466001726169","View(MTA.Number.of.years.and.Number.of.dependents)","YOUR NAME" +"1466002007921","plot(x= MTA.Number.of.years.and.Number.of.dependents$Number.of.Years.Worked, y= MTA.Number.of.years.and.Number.of.dependents$Number.of.dependents,","YOUR NAME" +"1466002008603","xlab = Number of Years Worked,","YOUR NAME" +"1466002009685","ylab = Number of Dependents,","YOUR NAME" +"1466002010702","main = Relationship Between Years Worked as a Dispatcher and Number of Dependents)","YOUR NAME" +"1466003926205","library(car)","YOUR NAME" +"1466003939778","","YOUR NAME" +"1466003940341","(tab1 <- table(Salaries$rank))","YOUR NAME" +"1466004084928","load(C:/Users/Ben/Downloads/ecls (3).Rdata)","YOUR NAME" +"1466004182953","hist(ecls$C6R4MSCL)","YOUR NAME" +"1466004631795","hist(ecls$C6R4MSCL, breaks = 10,","YOUR NAME" +"1466004632356","xlab = Hello,","YOUR NAME" +"1466004632919","main = Goodbye,","YOUR NAME" +"1466004633485","freq = FALSE)","YOUR NAME" +"1466004677500","d1 <- density)(ecls$C6R4MSCL)","YOUR NAME" +"1466004678087","plot(d1,","YOUR NAME" +"1466004678764","xlab = Hello,","YOUR NAME" +"1466004679453","main = Kernel Density Plot for Goodbye)","YOUR NAME" +"1466004849394","d1 <- density(ecls$C6R4MSCL)","YOUR NAME" +"1466004850235","plot(d1,","YOUR NAME" +"1466004851012","xlab = Hello,","YOUR NAME" +"1466004852534","main = Kernel Density Plot for Goodbye)","YOUR NAME" +"1466005069269","hist(ecls$C6R4MSCL, breaks = 25,","YOUR NAME" +"1466005069844","xlab = Hello,","YOUR NAME" +"1466005070416","main = Goobye World,","YOUR NAME" +"1466005071175","freq = FALSE) ","YOUR NAME" +"1466005081206","hist(ecls$C6R4MSCL, breaks = 25,","YOUR NAME" +"1466005081720","xlab = Hello,","YOUR NAME" +"1466005082153","main = Goodbye World,","YOUR NAME" +"1466005082973","freq = FALSE) ","YOUR NAME" +"1466005188201","lines(d1, col = red, lwd = 3)","YOUR NAME" +"1466005275658","d1","YOUR NAME" +"1466005276477","summary(d1)","YOUR NAME" +"1466005862218","install.packages(ggplot2)","YOUR NAME" +"1466005892368","library(ggplot2)","YOUR NAME" +"1466005907554","library(car, lib.loc=~/R/win-library/3.3)","YOUR NAME" +"1466005914564","","YOUR NAME" +"1466006082917","boxplot(mtcars$wt, main = Boxplot of Weight)","YOUR NAME" +"1466006083553","table(mtcars$cyl)","YOUR NAME" +"1466006084277","boxplot(mtcars$wt ~ mtcars$cyl) ","YOUR NAME" +"1466006085636","boxplot(mtcars$wt ~ mtcars$cyl, xlab = Numer of Cylinders,","YOUR NAME" +"1466006087654","ylab = Weight (1000 lbs))","YOUR NAME" +"1466006223144","attach(mtcars)","YOUR NAME" +"1466006223265","par(mfrow = c(2,2))","YOUR NAME" +"1466006223795","plot(wt, disp, main = Scatterplot of wt vs. disp)","YOUR NAME" +"1466006224293","plot(wt, mpg, main = Scatterplot of wt vs. MPG)","YOUR NAME" +"1466006224491","hist(wt, main = Histogram of wt)","YOUR NAME" +"1466006225534","boxplot(wt, main = Boxplot of wt)","YOUR NAME" +"1466006226367","par(mfrow = c(1,1))","YOUR NAME" +"1466006326070","par(mtcars)","YOUR NAME" +"1466006388760","dev.off()","YOUR NAME" +"1466006660047","attach(Salaries)","YOUR NAME" +"1466006660871","spineplot(rank ~ sex, main = Cross-Classification of Professor Rank by Sex)","YOUR NAME" +"1466006765184","load(cars)","YOUR NAME" +"1466006771183","load(car)","YOUR NAME" +"1466007033626","attach(Salaries)","YOUR NAME" +"1466007034601","spineplot(rank ~ sex, main = Cross-Classification of Professor Rank by Sex)","YOUR NAME" +"1466007036838","","YOUR NAME" +"1466007037240","","YOUR NAME" +"1466007037699","axis(side = 3)","YOUR NAME" +"1466007040218","table(rank, sex)","YOUR NAME" +"1466007046251","","YOUR NAME" +"1466007046583","","YOUR NAME" +"1466007047052","","YOUR NAME" +"1466007047525","","YOUR NAME" +"1466007054935","","YOUR NAME" +"1466007055506","","YOUR NAME" +"1466007056702","","YOUR NAME" +"1466007072657","tab1 <- table(sex, rank)","YOUR NAME" +"1466007073396","(ch1 <- chisq.test(tab1))","YOUR NAME" +"1466007085287","","YOUR NAME" +"1466007086114","","YOUR NAME" +"1466007086594","","YOUR NAME" +"1466007087036","","YOUR NAME" +"1466007087539","","YOUR NAME" +"1466007088056","","YOUR NAME" +"1466007090973","tab1","YOUR NAME" +"1466007091706","margin.table(tab1) ","YOUR NAME" +"1466007092413","margin.table(tab1, 1) ","YOUR NAME" +"1466007093288","margin.table(tab1, 2) ","YOUR NAME" +"1466007117996","","YOUR NAME" +"1466007118429","","YOUR NAME" +"1466007119110","ch1$observed","YOUR NAME" +"1466007120949","ch1$expected","YOUR NAME" +"1466007561243","sum((ch1$observed - ch1$expected)^2 / ch1$expected)","YOUR NAME" +"1466007705396","pichisq(8.5259), df =2, lower.tail = FALSE, upper.tail = TRUE)","YOUR NAME" +"1466007788515","pichisq(8.5, df =2, lower.tail = FALSE, upper.tail = FALSE)","YOUR NAME" +"1466007872587","pchisq(8.5259, df = 2, lower.tail = FALSE)","YOUR NAME" +"1466007967559","pchisq(8.5259, df = 2, lower.tail = FALSE, upper.tail = FALSE)","YOUR NAME" +"1466008012929","pchisq(8.5259, df = 2, lower.tail = FALSE, upper.tail = TRUE)","YOUR NAME" +"1466008040306","data(diamonds)","YOUR NAME" +"1466008044046","","YOUR NAME" +"1466008044774","?diamonds","YOUR NAME" +"1466008277436","data(diamonds)","YOUR NAME" +"1466008279158","","YOUR NAME" +"1466008279398","?diamonds","YOUR NAME" +"1466008282356","str(diamonds)","YOUR NAME" +"1466008786809","plot(x = diamonds$carat, y = diamonds$price)","YOUR NAME" +"1466008815856","","YOUR NAME" +"1466008833010","qplot(x = carat, y = price, data = diamonds)","YOUR NAME" +"1466008850397","","YOUR NAME" +"1466008850430","","YOUR NAME" +"1466008850460","qplot(x = carat, y = price, data = diamonds,","YOUR NAME" +"1466008850494","main = Diamond Data Plot)","YOUR NAME" +"1466008857093","","YOUR NAME" +"1466008857111","qplot(x = carat, y = price, data = diamonds,","YOUR NAME" +"1466008857126","margins = TRUE)","YOUR NAME" +"1466008865176","","YOUR NAME" +"1466008865193","qplot(x = log(carat), y = log(price), data = diamonds)","YOUR NAME" +"1466008872845","","YOUR NAME" +"1466008872857","","YOUR NAME" +"1466008872869","qplot(carat, x*y*z, data = diamonds)","YOUR NAME" +"1466008880728","","YOUR NAME" +"1466008880741","(ind1 <- with(diamonds, which(x*y*z > 3500)))","YOUR NAME" +"1466008908932","plot(x = diamonds$carat, y = diamonds$price)","YOUR NAME" +"1466008972599","","YOUR NAME" +"1466008973873","qplot(x = carat, y = price, data = diamonds)","YOUR NAME" +"1466008989429","","YOUR NAME" +"1466008989459","","YOUR NAME" +"1466008995202","qplot(x = carat, y = price, data = diamonds,","YOUR NAME" +"1466008997241","main = Diamond Data Plot)","YOUR NAME" +"1466009045268","","YOUR NAME" +"1466009045665","qplot(x = log(carat), y = log(price), data = diamonds)","YOUR NAME" +"1466009069676","","YOUR NAME" +"1466009070206","","YOUR NAME" +"1466009070891","qplot(carat, x*y*z, data = diamonds)","YOUR NAME" +"1466009158685","","YOUR NAME" +"1466009159241","(ind1 <- with(diamonds, which(x*y*z > 3500)))","YOUR NAME" +"1466009164329","diamonds[ind1,]","YOUR NAME" +"1466009195568","","YOUR NAME" +"1466009196331","(ind2 <- with(diamonds, which(carat == 2)))","YOUR NAME" +"1466009240753","diamonds[ind2,]","YOUR NAME" +"1466009340919","set.seed(1410)","YOUR NAME" +"1466009342156","dsmall <- diamonds[sample(nrow(diamonds), 100), ]","YOUR NAME" +"1466009363754","","YOUR NAME" +"1466009364214","","YOUR NAME" +"1466009364686","","YOUR NAME" +"1466009365477","","YOUR NAME" +"1466009367150","qplot(carat, price, data = dsmall, color = color)","YOUR NAME" +"1466009406305","qplot(carat, price, data = dsmall, shape = cut)","YOUR NAME" +"1466009407356","qplot(carat, price, data = dsmall, color = color, shape = cut)","YOUR NAME" +"1466009409396","qplot(carat, price, data = dsmall, size = color)","YOUR NAME" +"1466009460692","","YOUR NAME" +"1466009462033","qplot(carat, price, data = diamonds, alpha = I(1/10))","YOUR NAME" +"1466009470221","qplot(carat, price, data = diamonds, alpha = I(1/100))","YOUR NAME" +"1466009697035","qplot(carat, price, data = diamonds, alpha = I(1/1000))","YOUR NAME" +"1466009725323","qplot(carat, price, data = diamonds, alpha = I(1/500))","YOUR NAME" +"1466009764411","qplot(carat, price, data = dsmall, geom = c(point, smooth))","YOUR NAME" +"1466009765607","qplot(carat, price, data = diamonds, geom = c(point, smooth))","YOUR NAME" +"1466009979300","formula = y ~ s(x), size = 1.5)","YOUR NAME" +"1466009985369","library(mgcv)","YOUR NAME" +"1466009998561","qplot(carat, price, data = dsmall) + stat_smooth(method = loess,","YOUR NAME" +"1466009999397","span = .2)","YOUR NAME" +"1466010004514","qplot(carat, price, data = dsmall) + stat_smooth(method = loess,","YOUR NAME" +"1466010005152","span = 1)","YOUR NAME" +"1466010061309","detach(package:mgcv, unload=TRUE)","YOUR NAME" +"1466010062959","library(mgcv, lib.loc=C:/Program Files/R/R-3.3.0/library)","YOUR NAME" +"1466010139386","load(mgcv)","YOUR NAME" +"1466010168343","mgcv","YOUR NAME" +"1466010227757","qplot(carat, price, data = dsmall) + stat_smooth(method = gam,","YOUR NAME" +"1466010228253","formula = y ~ s(x), size = 1.5)","YOUR NAME" +"1466010229930","qplot(carat, price, data = diamonds) + stat_smooth(method = gam,","YOUR NAME" +"1466010230304","formula = y ~ s(x), size = 1)","YOUR NAME" +"1466010690140","qplot(color, price/carat, data = diamonds, geom = point,","YOUR NAME" +"1466010690866","alpha = I(1/10))","YOUR NAME" +"1466010737302","","YOUR NAME" +"1466010740882","qplot(color, price/carat, data = diamonds, geom = jitter,","YOUR NAME" +"1466010742364","alpha = I(1/10))","YOUR NAME" +"1466010750466","qplot(color, price/carat, data = diamonds, geom = jitter,","YOUR NAME" +"1466010771124","alpha = I(1/100))","YOUR NAME" +"1466010779213","","YOUR NAME" +"1466010834750","qplot(color, price/carat, data = diamonds, geom = boxplot,","YOUR NAME" +"1466010835521","alpha = I(1/10))","YOUR NAME" +"1466010863660","","YOUR NAME" +"1466010863870","","YOUR NAME" +"1466010864031","","YOUR NAME" +"1466010864274","","YOUR NAME" +"1466010864903","qplot(carat, data = diamonds, geom = density)","YOUR NAME" +"1466010880001","","YOUR NAME" +"1466010880305","qplot(carat, data = diamonds, geom = histogram)","YOUR NAME" +"1466010882295","","YOUR NAME" +"1466010883227","","YOUR NAME" +"1466010883870","qplot(carat, data = diamonds, geom = histogram, binwidth = 1)","YOUR NAME" +"1466010886979","qplot(carat, data = diamonds, geom = histogram, binwidth = .1)","YOUR NAME" +"1466010889773","qplot(carat, data = diamonds, geom = histogram, binwidth = .01)","YOUR NAME" +"1466010950863","","YOUR NAME" +"1466010951549","qplot(carat, data = diamonds, geom = density, color = color)","YOUR NAME" +"1466010954179","","YOUR NAME" +"1466011014524","qplot(carat, data = diamonds, geom = histogram, fill = color)","YOUR NAME" +"1466011017055","","YOUR NAME" +"1466011017697","","YOUR NAME" +"1466181513884","Stress.and.Shift.ok <- read.delim(~/Stress and Shift ok.txt)","YOUR NAME" +"1466181513990","View(Stress.and.Shift.ok)","YOUR NAME" +"1466181756887","plot(Stress.and.Shift.ok$Emergencies, Stress.and.Shift.ok$Lack_of_control)","YOUR NAME" +"1466181798224","importIntoEnv(ggplot(Stress.and.Shift.ok))","YOUR NAME" +"1466182351769","qplot(Stress.and.Shift.ok$Emergencies)","YOUR NAME" +"1466182955107","qplot( x = Stress.and.Shift.ok$Lack_of_control, y = Stress.and.Shift.ok$Lack_of_control)","YOUR NAME" +"1466183013274","qplot( x = Stress.and.Shift.ok$Emergencies, y = Stress.and.Shift.ok$Lack_of_control)","YOUR NAME" +"1466183280334","alpha = I(1/10))","YOUR NAME" +"1466183444979","qplot( x = Stress.and.Shift.ok$Emergencies, y = Stress.and.Shift.ok$Lack_of_control, geom = jitter,","YOUR NAME" +"1466183445624","alpha = I(1/10))","YOUR NAME" +"1466183465252","alpha = I(1/5))","YOUR NAME" +"1466183479855","alpha = I(1/20))","YOUR NAME" +"1466183488024","alpha = I(1/100))","YOUR NAME" +"1466183517349","qplot( x = Stress.and.Shift.ok$Emergencies, y = Stress.and.Shift.ok$Lack_of_control, geom = jitter,","YOUR NAME" +"1466183517828","alpha = I(1/100))","YOUR NAME" +"1466183534884","qplot( x = Stress.and.Shift.ok$Emergencies, y = Stress.and.Shift.ok$Lack_of_control, geom = jitter,","YOUR NAME" +"1466183535428","alpha = I(1/5))","YOUR NAME" +"1466183550642","qplot( x = Stress.and.Shift.ok$Emergencies, y = Stress.and.Shift.ok$Lack_of_control, geom = jitter,","YOUR NAME" +"1466183551198","alpha = I(1/2))","YOUR NAME" +"1466184110935","axis()","YOUR NAME" +"1466184111509","","YOUR NAME" +"1466184112475","data(diamonds)","YOUR NAME" +"1466184113173","","YOUR NAME" +"1466184113959","?diamonds","YOUR NAME" +"1466184115543","str(diamonds)","YOUR NAME" +"1466184115874","dim(diamonds)","YOUR NAME" +"1466184115890","head(diamonds)","YOUR NAME" +"1466184116231","","YOUR NAME" +"1466184117831","","YOUR NAME" +"1466184118336","","YOUR NAME" +"1466184118700","","YOUR NAME" +"1466184118988","","YOUR NAME" +"1466184119298","plot(x = diamonds$carat, y = diamonds$price)","YOUR NAME" +"1466184122834","","YOUR NAME" +"1466184128493","qplot(x = carat, y = price, data = diamonds)","YOUR NAME" +"1466184136499","","YOUR NAME" +"1466184136511","","YOUR NAME" +"1466184136528","qplot(x = carat, y = price, data = diamonds,","YOUR NAME" +"1466184136546","main = Diamond Data Plot)","YOUR NAME" +"1466184143717","","YOUR NAME" +"1466184143735","qplot(x = carat, y = price, data = diamonds,","YOUR NAME" +"1466184143751","margins = TRUE)","YOUR NAME" +"1466184151613","","YOUR NAME" +"1466184151633","qplot(x = log(carat), y = log(price), data = diamonds)","YOUR NAME" +"1466184159760","","YOUR NAME" +"1466184159777","","YOUR NAME" +"1466184159795","qplot(carat, x*y*z, data = diamonds)","YOUR NAME" +"1466184166675","","YOUR NAME" +"1466184166684","(ind1 <- with(diamonds, which(x*y*z > 3500)))","YOUR NAME" +"1466184166694","diamonds[ind1,]","YOUR NAME" +"1466184166706","","YOUR NAME" +"1466184166713","(ind2 <- with(diamonds, which(carat == 2)))","YOUR NAME" +"1466184166729","diamonds[ind2,]","YOUR NAME" +"1466184171464","","YOUR NAME" +"1466184171470","","YOUR NAME" +"1466184171477","","YOUR NAME" +"1466184171503","","YOUR NAME" +"1466184171510","","YOUR NAME" +"1466184171516","set.seed(1410)","YOUR NAME" +"1466184171523","dsmall <- diamonds[sample(nrow(diamonds), 100), ]","YOUR NAME" +"1466184171530","","YOUR NAME" +"1466184171538","","YOUR NAME" +"1466184171544","","YOUR NAME" +"1466184171550","","YOUR NAME" +"1466184171564","qplot(carat, price, data = dsmall, color = color)","YOUR NAME" +"1466185332272","View(Stress.and.Shift.ok)","YOUR NAME" +"1466185418053","Stress.and.Shift.ok <- read.delim(~/Stress and Shift ok.txt)","YOUR NAME" +"1466185418074","View(Stress.and.Shift.ok)","YOUR NAME" +"1466185506778","qplot(x = Stress.and.Shift.ok$Emergencies, y= Stress.and.Shift.ok$Sleep_loss)","YOUR NAME" +"1466185560067","qplot(x = Stress.and.Shift.ok$Emergencies, y= Stress.and.Shift.ok$Sleep_loss, geom = jitter )","YOUR NAME" +"1466185600174","qplot(x = Stress.and.Shift.ok$Emergencies, y= Stress.and.Shift.ok$Sleep_loss, geom = jitter","YOUR NAME" +"1466185600734","alpha(1/10))","YOUR NAME" +"1466185612747","qplot(x = Stress.and.Shift.ok$Emergencies, y= Stress.and.Shift.ok$Sleep_loss, geom = jitter,","YOUR NAME" +"1466185617740","alpha(1/10))","YOUR NAME" +"1466185629849","qplot(x = Stress.and.Shift.ok$Emergencies, y= Stress.and.Shift.ok$Sleep_loss, geom = jitter,","YOUR NAME" +"1466185630211","alpha(1/10))","YOUR NAME" +"1466185654894","qplot(x = Stress.and.Shift.ok$Emergencies, y= Stress.and.Shift.ok$Sleep_loss, geom = jitter,","YOUR NAME" +"1466185655403","alphaI(1/10))","YOUR NAME" +"1466185692305","qplot(x = Stress.and.Shift.ok$Emergencies, y= Stress.and.Shift.ok$Sleep_loss, geom = jitter,","YOUR NAME" +"1466185692838","alpha = I(1/10))","YOUR NAME" +"1466185993198","qplot(x = Stress.and.Shift.ok, data = dsmall, colors(red))","YOUR NAME" +"1466186014787","qplot(x = Stress.and.Shift.ok, colors(red))","YOUR NAME" +"1466186163788","qplot(x = Stress.and.Shift.ok$Emergencies, y = Stress.and.Shift.ok$Sleep_loss , geom = jitter, alpha = I(1/10))","YOUR NAME" +"1466186187936","qplot(x = Stress.and.Shift.ok$Emergencies, y = Stress.and.Shift.ok$Sleep_loss , geom = jitter,","YOUR NAME" +"1466186188580","alpha = I(1/2))","YOUR NAME" +"1466186237653","qplot(Stress.and.Shift.ok(colors(red)))","YOUR NAME" +"1466186315022","qplot(colors(Stress.and.Shift.ok$Emergencies))","YOUR NAME" +"1466186343147","qplot(x = Stress.and.Shift.ok$Emergencies, y = Stress.and.Shift.ok$Sleep_loss , geom = jitter,","YOUR NAME" +"1466186343575","alpha = I(1/2))","YOUR NAME" +"1466191182900","","YOUR NAME" +"1466191549486","qplot(Stress.and.Shift.ok(colors(red)))","YOUR NAME" +"1466191758164","function(2*3)","YOUR NAME" +"1466191764798","","YOUR NAME" +"1466191765704","","YOUR NAME" +"1466191796420","","YOUR NAME" +"1466192292543","","YOUR NAME" +"1466192294015","","YOUR NAME" +"1466192823672","","YOUR NAME" +"1466193753242","","YOUR NAME" +"1466194042383","hello","YOUR NAME" +"1466194084722","","YOUR NAME" +"1466194102786","","YOUR NAME" +"1466194362872","","YOUR NAME" +"1466195600047","zzz","YOUR NAME" +"1466283985560","dd","YOUR NAME" +"1466284022096","dd","YOUR NAME" +"1466284032478","cats","YOUR NAME" +"1466436019627","","YOUR NAME" +"1466436020383","curve(dnorm, from = -3, to = 3, ylab = Height,","YOUR NAME" +"1466436020979","main = Standard Normal Probability Density,","YOUR NAME" +"1466436022456","lwd = 3, col = 3)","YOUR NAME" +"1466436119302","library(ggplot2)","YOUR NAME" +"1466436120477","","YOUR NAME" +"1466436136343","data(diamonds)","YOUR NAME" +"1466436149020","","YOUR NAME" +"1466436149976","ggplot(diamonds, aes(clarity)) +","YOUR NAME" +"1466436150791","geom_bar()","YOUR NAME" +"1466436282795","?economics","YOUR NAME" +"1466436286073","str(economics)","YOUR NAME" +"1466436287979","data(economics)","YOUR NAME" +"1466436290573","","YOUR NAME" +"1466436293543","qplot(date, unemploy / pop, data = economics, geom = line,","YOUR NAME" +"1466436334631","ylab = Unemployment Rate)","YOUR NAME" +"1466436646008","","YOUR NAME" +"1466436646758","qplot(date, uempmed, data = economics, geom = line,","YOUR NAME" +"1466436647539","ylab = Median Number of Weeks Unemployed)","YOUR NAME" +"1466436652540","","YOUR NAME" +"1466436653198","","YOUR NAME" +"1466436653411","","YOUR NAME" +"1466436653677","","YOUR NAME" +"1466436653939","","YOUR NAME" +"1466436654212","","YOUR NAME" +"1466436654513","","YOUR NAME" +"1466436654691","","YOUR NAME" +"1466436655090","","YOUR NAME" +"1466436655220","","YOUR NAME" +"1466436655392","","YOUR NAME" +"1466436655924","qplot(carat, data = diamonds, facets = color ~ .,","YOUR NAME" +"1466436659275","geom = histogram, binwidth = .1, xlim = c(0,3))","YOUR NAME" +"1466436663674","","YOUR NAME" +"1466436663690","qplot(carat, data = diamonds, facets = . ~ color,","YOUR NAME" +"1466436665604","geom = histogram, binwidth = .1, xlim = c(0,3))","YOUR NAME" +"1466436667907","","YOUR NAME" +"1466437037041","library(splines)","YOUR NAME" +"1466437065138","library(nlme)","YOUR NAME" +"1466437156039","q1 + state_smooth(method = lm)","YOUR NAME" +"1466437164728","q1 + stat_smooth(method = lm,","YOUR NAME" +"1466437165413","formula = y ~ ns(x, 5))","YOUR NAME" +"1466437172726","q1 <- qplot(carat, price, facets = color ~ ., data = diamonds)","YOUR NAME" +"1466437175428","library(splines)","YOUR NAME" +"1466437176047","library(nlme)","YOUR NAME" +"1466437178015","","YOUR NAME" +"1466437178733","q1 + stat_smooth(method = lm,","YOUR NAME" +"1466437181418","formula = y ~ ns(x, 5))","YOUR NAME" +"1466437924604","q1+ state_smooth(method = lm","YOUR NAME" +"1466437950320","q1+ state_smooth(method = lm","YOUR NAME" +"1466437950982","formula = y ~ ns(x, 5), col = red)","YOUR NAME" +"1466438196480","(p <- ggplot(diamonds, aes(carat, price)))","YOUR NAME" +"1466438224668","p + layer(geom = point, stat = identity, position = identity)","YOUR NAME" +"1466438238913","p + layer(geom = point, stat = identity, position = identity)","YOUR NAME" +"1466438272263","p2 <- ggplot(diamonds, aes(x = carat))","YOUR NAME" +"1466438279948","p2 <- p2 + layer(","YOUR NAME" +"1466438281980","geom = bar,","YOUR NAME" +"1466438283031","stat = bin,","YOUR NAME" +"1466438284445","params = list(binwidth = .2, fill = steelblue),","YOUR NAME" +"1466438285887","position = identity","YOUR NAME" +"1466438286699",")","YOUR NAME" +"1466438287195","p2","YOUR NAME" +"1466438405978","?Oxboys","YOUR NAME" +"1466438406970","str(Oxboys)","YOUR NAME" +"1466438433339","str(Oxboys)","YOUR NAME" +"1466438435257","Oxboys[1","YOUR NAME" +"20,]","","YOUR NAME" +"1466438651072","p3 <- ggplot(Oxboys, aes(age, height)) + geom_line()","YOUR NAME" +"1466438664295","p3","YOUR NAME" +"1466438881552","","YOUR NAME" +"1466438882277","","YOUR NAME" +"1466438882945","p4 <- ggplot(Oxboys, aes(age, height, group = Subject)) +","YOUR NAME" +"1466438883746","geom_line()","YOUR NAME" +"1466438884934","p4","YOUR NAME" +"1466438898376","","YOUR NAME" +"1466438899118","","YOUR NAME" +"1466438899564","","YOUR NAME" +"1466438900766","p4 + geom_smooth(aes(group = Subject), method = lm, se = F)","YOUR NAME" +"1466438976053","p4 + geom_smooth(aes(group = Subject), method = lm)","YOUR NAME" +"1466438992543","p4 + geom_smooth(aes(group = Subject), method = lm, se = F,","YOUR NAME" +"1466438993960","size =.5)","YOUR NAME" +"1466439001844","","YOUR NAME" +"1466439002311","","YOUR NAME" +"1466439276387","p4 <- ggplot(Oxboys, aes(age, height, group = Subject)) +","YOUR NAME" +"1466439277100","geom_line()","YOUR NAME" +"1466439277607","p4","YOUR NAME" +"1466439278807","","YOUR NAME" +"1466439281480","","YOUR NAME" +"1466439281664","","YOUR NAME" +"1466439281840","","YOUR NAME" +"1466439281870","p4 + geom_smooth(aes(group = Subject), method = lm)","YOUR NAME" +"1466439284889","","YOUR NAME" +"1466439284915","p4 + geom_smooth(aes(group = Subject), method = lm, se = F,","YOUR NAME" +"1466439285668","size =.5)","YOUR NAME" +"1466439287162","","YOUR NAME" +"1466439288070","","YOUR NAME" +"1466439288107","p4 + geom_smooth(aes(group = 1), method = lm, se = F)","YOUR NAME" +"1466439288992","","YOUR NAME" +"1466439290627","p4 + geom_smooth(aes(group = 1), method = lm, se = F, size = 2)","YOUR NAME" +"1466439292245","","YOUR NAME" +"1466439292269","","YOUR NAME" +"1466439292975","","YOUR NAME" +"1466439293598","","YOUR NAME" +"1466439294128","ggplot(diamonds, aes(clarity)) +","YOUR NAME" +"1466439295620","geom_bar()","YOUR NAME" +"1466439300158","","YOUR NAME" +"1466439301270","ggplot(diamonds, aes(clarity, color = cut)) +","YOUR NAME" +"1466439302391","geom_bar(position = stack)","YOUR NAME" +"1466439304733","","YOUR NAME" +"1466439306174","ggplot(diamonds, aes(clarity, color = cut)) +","YOUR NAME" +"1466439307257","geom_bar(position = dodge)","YOUR NAME" +"1466439310309","","YOUR NAME" +"1466439320218","","YOUR NAME" +"1466439321095","ggplot(diamonds, aes(clarity, color = cut)) +","YOUR NAME" +"1466439322667","geom_bar(position = fill)","YOUR NAME" +"1466439323829","","YOUR NAME" +"1466439334525","d <- ggplot(diamonds, aes(carat)) + xlim(0,3)","YOUR NAME" +"1466439336447","d + stat_bin(aes(ymax = ..count..), binwidth = .1, geom = area)","YOUR NAME" +"1466439337406","d + stat_bin(aes(size = ..density..), binwidth = .1,","YOUR NAME" +"1466439338165","geom = point, position = identity)","YOUR NAME" +"1466441434223","rnorme(10, mean = 20, sd =2 )","YOUR NAME" +"1466441481019","rnorm(10, mean = 20, sd =2 )","YOUR NAME" +"1466441507028","qnoarm(.95, lower.tail =TRUE)","YOUR NAME" +"1466441527415","qnorm(.95, lower.tail =TRUE)","YOUR NAME" +"1466441587060","load(body_temp)","YOUR NAME" +"1466441643995","body_temp","YOUR NAME" +"1466441745145","body_temp <- read.table(file = http://www.amstat.org/publications/jse/datasets/normtemp.dat.txt,","YOUR NAME" +"1466441745792","header = FALSE, sep = )","YOUR NAME" +"1466441746513","body_temp","YOUR NAME" +"1466441763977","","YOUR NAME" +"1466441764575","","YOUR NAME" +"1466441765237","","YOUR NAME" +"1466441766040","","YOUR NAME" +"1466441766672","","YOUR NAME" +"1466441766933","","YOUR NAME" +"1466441767137","","YOUR NAME" +"1466441767444","","YOUR NAME" +"1466441767751","hist(body_temp[,1], freq = FALSE)","YOUR NAME" +"1466441767946","lines(density(body_temp[,1]), lwd = 3, col = blue)","YOUR NAME" +"1466441768739","range(body_temp[,1])","YOUR NAME" +"1466441768756","xfit <- seq(95, 103, length = 100)","YOUR NAME" +"1466441768771","yfit <- dnorm(xfit, mean = mean(body_temp[,1]), sd = sd(body_temp[,1]))","YOUR NAME" +"1466441769424","lines(xfit, yfit, col = red, lwd = 3)","YOUR NAME" +"1466441770099","legend(x = topright, legend = c(Kernel Density, Normal Curve),","YOUR NAME" +"1466441770133","fill = c(blue, red))","YOUR NAME" +"1466441774357","","YOUR NAME" +"1466441774823","qqnorm(body_temp[,1])","YOUR NAME" +"1466441815385","hist(body_temp[,1], freq = FALSE)","YOUR NAME" +"1466441828822","lines(density(body_temp[,1]), lwd = 3, col = blue)","YOUR NAME" +"1466441830033","range(body_temp[,1])","YOUR NAME" +"1466441834918","xfit <- seq(95, 103, length = 100)","YOUR NAME" +"1466441835854","yfit <- dnorm(xfit, mean = mean(body_temp[,1]), sd = sd(body_temp[,1]))","YOUR NAME" +"1466441837482","lines(xfit, yfit, col = red, lwd = 3)","YOUR NAME" +"1466441838042","legend(x = topright, legend = c(Kernel Density, Normal Curve),","YOUR NAME" +"1466441848478","fill = c(blue, red))","YOUR NAME" +"1466441850915","","YOUR NAME" +"1466441851575","qqnorm(body_temp[,1])","YOUR NAME" +"1466441854574","","YOUR NAME" +"1466442210149","shapiro.test(body_temp[,1])","YOUR NAME" +"1466442211300","","YOUR NAME" +"1466442212277","ks.test(x = body_temp[,1],","YOUR NAME" +"1466442213397","y = pnorm,","YOUR NAME" +"1466442218332","mean = mean(body_temp[,1]),","YOUR NAME" +"1466442219173","sd = sd(body_temp[,1]))","YOUR NAME" +"1466442326247","","YOUR NAME" +"1466442326899","","YOUR NAME" +"1466442327536","(t1 <- t.test(body_temp[,1], mu = 98.6, alternative = two.sided))","YOUR NAME" +"1466442328006","attributes(t1)","YOUR NAME" +"1466442329049","","YOUR NAME" +"1466442329707","t1$conf.int","YOUR NAME" +"1466442344429","","YOUR NAME" +"1466442345531","","YOUR NAME" +"1466442363854","","YOUR NAME" +"1466442364069","","YOUR NAME" +"1466442364345","","YOUR NAME" +"1466442364650","","YOUR NAME" +"1466442365121","pre <- c(18, 21, 16, 22, 19 ,24 ,17 ,21 ,23 ,18 ,","YOUR NAME" +"1466442365154","","YOUR NAME" +"1466442367597","14 ,16 ,16 ,19 ,18 ,20 ,12 ,22 ,15 ,17)","YOUR NAME" +"1466442368462","post <- c(22, 25, 17, 24, 16, 29 ,20, 23, 19, 20,","YOUR NAME" +"1466442372076","15, 15, 18, 26, 18, 24, 18, 25, 19, 16)","YOUR NAME" +"1466442395497","(diffs <- post - pre)","YOUR NAME" +"1466442396549","hist(diffs, 10)","YOUR NAME" +"1466442397328","qqnorm(diffs)","YOUR NAME" +"1466442398186","qqline(diffs)","YOUR NAME" +"1466442436166","","YOUR NAME" +"1466442445686","(t2 <- t.test(diffs, mu = 0, alternative = two.sided))","YOUR NAME" +"1466442494255","t2$estimate","YOUR NAME" +"1466442504224","","YOUR NAME" +"1466442504441","","YOUR NAME" +"1466442504788","","YOUR NAME" +"1466442516056","","YOUR NAME" +"1466442524420","","YOUR NAME" +"1466442528490","","YOUR NAME" +"1466442530809","?wilcox.test","YOUR NAME" +"1466442633914","load(ecls)","YOUR NAME" +"1466442740468","load(C:/Users/Ben/Downloads/ecls.Rdata)","YOUR NAME" +"1466442783807","load(C:/Users/Ben/Downloads/ecls.Rdata)","YOUR NAME" +"1466442785966","ecls <- read.table(C:/Users/Ben/Downloads/ecls.Rdata, quote=\"") +1466442786006:View(ecls) +1466442807867:View(ecls) +1466442838555:View(ecls) +1466442989403:getwd() +1466442990153:### Where do you want it to be? The following line (on a Mac) would set my +1466442990902:### working directory to be a folder named 5026 in the Documents folder. +1466442991341:setwd(dir = /Users/keller4/Documents/5026/) # customize as needed +1466442992057:### On a Windows machine, the following line would set the working directory +1466442992744:### to a folder called 5026 in the Documents folder. Note, in Windows, you +1466442993429:### must use either / or \\ for file paths because R interprets \ as an +1466442994105:### escape character. +1466442994345:setwd(dir = C","YOUR NAME" +"/Users/keller4/Documents/5026) # customize as needed +1466442994772:### Begin by loading some data into R. First, download the dataset called +1466442995586:### ecls.Rdata from Moodle and save it someplace on your computer. Next +1466442995994:### run the following code: +1466442996303:load(file = file.choose()) +1466443143244:### and a search window will open up. Direct the search to ecls.Rdata and +1466443143263:### double-click to open it. Now check your environment with +1466443143303:ls() +1466443143380:### or by looking in the Environment pane at top right and you should see +1466443143429:### ecls there. We will use the data below. +1466443143539:############################################################################### +1466443143590:### R BASICS ################################################################## +1466443143688:############################################################################### +1466443143714:### Three typically encountered data types in R: +1466443146554:View(ecls) +1466443146932:load(ecls) +1466443147149:ecls +1466443150924:load(ecls) +1466443150962:ecls +1466443156075:ecls$ +1466887578670:library(ggplot2) +1466887580200:data(diamonds) +1466887580275:head(diamonds) +1466887591011:anova1 <- lm(price ~ factor(color, ordered = FALSE), data = diamonds) +1466887592555:summary(anova1) +1466901002469:source('~/.active-rstudio-document', encoding = 'UTF-8', echo=TRUE) +1466901021819:### +1466901022790:### Eye color +1466901023633:### Hair color | Brown Hazel Green Gray Blue | Total +1466901024518:### -------------------------------------------------------------- +1466901024895:### Black | 45 8 7 2 7 | 69 +1466901025228:### Red | 6 6 9 5 13 | 39 +1466901025366:### Blond | 3 6 6 4 18 | 37 +1466901025701:### Dark-brown | 50 8 2 2 5 | 67 +1466901025995:###--------------------------------------------------------------- +1466901026706:### Total | 104 28 24 13 43 | 212 +1466901379136:matc<-matrix(data = c(45, 8, 7, 2, 7, 6, 6,9, 5,13, 3, 6, 6, 4, 18, 50, 8, 2, 2,5), +1466901380102:nrow = 4, ncol ncol = 5, byrow = TRUE) +1466901400561:matc<-matrix(data = c(45, 8, 7, 2, 7, 6, 6,9, 5,13, 3, 6, 6, 4, 18, 50, 8, 2, 2,5), +1466901401604:nrow = 4, ncol = 5, byrow = TRUE) +1466901404886:matc +1466901434199:dfc<- as.data.frame(matc) +1466901514947:(chc <- chisq.test(dfc)) +1466995873456:ShifTypeyes <- read.delim(C","/Users/Ben/Downloads/ShifTypeyes.txt, header=FALSE) +1466995873567:View(ShifTypeyes) +1466997343441:Sex.and.Years.Worked.As.Dispatcher <- read.delim(~/Sex and Years Worked As Dispatcher.txt) +1466997343470:View(Sex.and.Years.Worked.As.Dispatcher) +1466997425159:Number.of.years.and.Number.of.dependents <- read.delim(~/Number of years and Number of dependents.txt) +1466997425179:View(Number.of.years.and.Number.of.dependents) +1466999108174:Sex.and.Years.Worked.As.Dispatcher +1466999761630:male_workers<-Sex.and.Years.Worked.As.Dispatcher$Sex[,1][Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher[,2] == 1] +1466999763151:females_temp<-Sex.and.Years.Worked.As.Dispatcher$Sex[,1][Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher[,2] ==2] +1466999803382:male_workers<-Sex.and.Years.Worked.As.Dispatcher$Sex[,1][Sex.and.Years.Worked.As.Dispatcher[,2] == 1] +1466999805627:females_temp<-Sex.and.Years.Worked.As.Dispatcher$Sex[,1][Sex.and.Years.Worked.As.Dispatcher[,2] ==2] +1467000336408:males_temp <- body_temp[,1][body_temp[,2] == 1] +1467000337660:females_temp <- body_temp[,1][body_temp[,2] == 2] +1467000354595:curve(dnorm, from = -3, to = 3, ylab = Height, +1467000355343:main = Standard Normal Probability Density, +1467000356033:lwd = 3, col = 3) +1467000356782:### Simulation to demonstrate the central limit theorem. +1467000358971:clt <- function(N = 30, reps = 10000) { +1467000359845:# ::: N is the sample size for the mean +1467000360506:# ::: reps is the number of times to draw N samples +1467000361159:# from the exponential distribution and take means +1467000361565:# to show the sampling distribution +1467000361856:out <- replicate(n = reps, expr = mean(rexp(N))) +1467000362062:h1 <- hist(out, breaks = 50, main = "") +1467000362433:foo <- function(x) dnorm(x, mean = mean(out), sd = sd(out))* +1467000362553:diff(h1$breaks[1:2])*reps +1467000362928:curve(foo, from = mean(out) - 5*sd(out), +1467000363188:to = mean(out) + 5*sd(out), add = TRUE, +1467000363473:lwd = 2, col = steelblue) +1467000363710:} +1467000363832:### Run with N = 1 to show the parent population +1467000364174:clt(N = 1) +1467000365263:clt(N = 3) +1467000366317:clt(N = 5) +1467000366990:clt(N = 10) +1467000367938:clt(N = 20) +1467000368897:### Increase N +1467000368911:clt(N = 50) +1467000370048:clt(N = 100) +1467000371061:clt(N = 500) +1467000374216:### Demonstrate the t distribution +1467000374232:curve(dnorm(x), from = -3, to = 3, lwd = 2, ylab = Height, +1467000374244:main = Normal and t Densities) +1467000374524:curve(dt(x, df = 1), from = -3, to = 3, lwd = 2, lty = 2, col = 2, add = TRUE) +1467000374540:curve(dt(x, df = 3), from = -3, to = 3, lwd = 2, lty = 3, col = 3, add = TRUE) +1467000374557:curve(dt(x, df = 10), from = -3, to = 3, lwd = 2, lty = 4, col = 4, add = TRUE) +1467000374577:curve(dt(x, df = 30), from = -3, to = 3, lwd = 2, lty = 5, col = 5, add = TRUE) +1467000374596:legend(x = bottom, legend = c(normal, df=1, df = 3, df = 10, df = 30), +1467000374609:col = 1:5, lty = 1:5, lwd = 2) +1467000374632:### Demonstrate the chi square distribution +1467000374644:curve(dchisq(x, df = 1), from = 0.2, to = 10, lwd = 2, lty = 1, col = 1, +1467000374657:ylab = Height, main = Chi Square Densities) +1467000374699:curve(dchisq(x, df = 2), from = 0, to = 10, lwd = 2, lty = 2, col = 2, add = TRUE) +1467000374716:curve(dchisq(x, df = 3), from = 0, to = 10, lwd = 2, lty = 3, col = 3, add = TRUE) +1467000374735:curve(dchisq(x, df = 5), from = 0, to = 10, lwd = 2, lty = 4, col = 4, add = TRUE) +1467000374750:curve(dchisq(x, df = 8), from = 0, to = 10, lwd = 2, lty = 5, col = 5, add = TRUE) +1467000374765:legend(x = topright, legend = c(df=1, df = 2, df = 3, df = 5, df = 8), +1467000374778:col = 1:5, lty = 1:5, lwd = 2) +1467000374797:############################################################################### +1467000374811:### GENERATING RANDOM VECTORS ################################################# +1467000374824:############################################################################### +1467000374837:### R has functions for generation of random numbers from a variety of probability +1467000375869:### distributions. +1467000375886:# Distribution Functions +1467000375901:# --------------------------------------------------------------------------------- +1467000375917:# Beta pbeta qbeta dbeta rbeta +1467000376492:# Exponential pexp qexp dexp rexp +1467000378554:# Cauchy pcauchy qcauchy dcauchy rcauchy +1467000378724:# Binomial pbinom qbinom dbinom rbinom +1467000379651:# Hypergeometric phyper qhyper dhyper rhyper +1467000379824:# Normal pnorm qnorm dnorm rnorm +1467000380101:# Chi-Square pchisq qchisq dchisq rchisq +1467000380143:# Gamma pgamma qgamma dgamma rgamma +1467000380871:# Student t pt qt dt rt +1467000381281:# Studentized Range ptukey qtukey dtukey rtukey +1467000381320:# Poisson ppois qpois dpois rpois +1467000381711:# Negative Binomial pnbinom qnbinom dnbinom rnbinom +1467000381796:# Log Normal plnorm qlnorm dlnorm rlnorm +1467000382024:# Weibull pweibull qweibull dweibull rweibull +1467000382162:# Wilcoxon Rank Sum Statistic pwilcox qwilcox dwilcox rwilcox +1467000382398:# Logistic plogis qlogis dlogis rlogis +1467000382591:# Geometric pgeom qgeom dgeom rgeom +1467000382943:### Many more are available in packages. The 'p' is for 'probability' and gives the +1467000382986:# Wilcoxon Signed Rank Statistic psignrank qsignrank dsignrank rsignrank +1467000383584:### height of the cumulative distribution function (cdf) at X = x; that is P(X >= x). +1467000383629:# F pf qf df rf +1467000383829:# Uniform punif qunif dunif runif +1467000383987:### The 'd' is for 'density' and gives the probability density function (pdf). +1467000384437:### The 'q' is for 'quantile' and is the inverse of the cdf. +1467000384988:### Uniform distribution +1467000385133:runif(n = 5, min = 0, max = 1) +1467000385543:### The 'r' is for 'random' and generates a random deviate from the specified distribution. +1467000385742:ru <- runif(10000) +1467000385934:hist(ru, breaks = 10, probability = TRUE) +1467000386178:curve(dunif(x), add = TRUE, lwd = 3, col = 2) # graph of theoretical uniform density on [0,1] +1467000387138:### Normal distribution +1467000387418:rnorm(n = 5, mean = 0, sd = 1) +1467000387782:rn <- rnorm(10000) +1467000388317:hist(rn, breaks = 100, probability = TRUE) +1467000388515:curve(dnorm(x), add = TRUE, lwd = 3, col = 2) # graph of theoretical standard normal density +1467000389410:rt(n = 5,df = 2) +1467000389751:### Student's t distribution +1467000389930:rand_t <- rt(10000, df = 2) +1467000390124:hist(rand_t, breaks = 100, prob = TRUE) +1467000390893:curve(dt(x, df = 2), add = TRUE, lwd = 3, col = 2) # theoretical t (df = 2) distribution +1467000391072:### Normal vs. t (df = 2) +1467000391611:curve(dnorm(x), from = -5, to = 5, lwd = 3, col = 3) +1467000392494:curve(dt(x, df = 2), from = -5, to = 5, lwd = 3, col = 2, add = TRUE) +1467000393047:### Chi-square distribution +1467000393130:legend(3, .2, c(Normal, t (df = 2)), col = 2:3, lwd = 3) +1467000393917:rchisq(5, df = 4) +1467000394404:rch <- rchisq(n = 10000, df = 4) +1467000394670:hist(rch, breaks = 100, prob = TRUE) +1467000395583:curve(dchisq(x, df = 4), add = TRUE, lwd = 3, col = 2) +1467000397497:############################################################################### +1467000398353:### GENERATING MULTIVARIATE NORMAL DATA ####################################### +1467000399247:############################################################################### +1467000400008:# install.packages('MASS') +1467000400176:library(MASS) +1467000400823:?mvrnorm +1467000401340:mv_data <- mvrnorm(500, mu = c(0, 0), Sigma = matrix(c(1, .75, .75, 1), 2, 2)) +1467000401354:plot(mv_data) +1467000401729:abline(lm(mv_data[,2] ~ mv_data[,1])) +1467000401901:mv_data <- mvrnorm(500, mu = c(0, 0), Sigma = matrix(c(1, -.9, -.9, 1), 2, 2)) +1467000403564:plot(mv_data) +1467000404472:############################################################################### +1467000404534:abline(lm(mv_data[,2] ~ mv_data[,1])) +1467000404919:### ONE-SAMPLE T-TEST ######################################################### +1467000405215:abline(lm(mv_data[,2] ~ mv_data[,1])) +1467000405259:plot(mv_data) +1467000405691:############################################################################### +1467000405705:mv_data <- mvrnorm(500, mu = c(0, 0), Sigma = matrix(c(1, .2, .2, 1), 2, 2)) +1467000406732:### The one-sample t-test is used when interest is in making an inference about +1467000407425:### the mean of a population as compared to a constant. +1467000408396:### The test assumes a random sample from a normally distributed population. +1467000409738:### Import the body temperature data from Allen L. Shoemaker's 1996 paper in +1467000410219:### the Journal of Statistics Education. +1467000410397:body_temp <- read.table(file = http","YOUR NAME" +"//www.amstat.org/publications/jse/datasets/normtemp.dat.txt, +1467000410919:header = FALSE, sep = "") +1467000411324:body_temp +1467000412246:### About the data... +1467000413924:### http://www.amstat.org/publications/jse/datasets/normtemp.txt +1467000415462:### The t-test assumes the population is normally distributed. For larger +1467000416097:### samples this won't make a practical difference because of the central +1467000416446:### limit theorem, which states that the sampling distribution of the sample +1467000416610:### mean approaches normality as the sample size gets larger. +1467000417128:### There are several ways to assess normality. +1467000466434:body data() +1467000493344:body_temp +1467000589475:male_workers<-Sex.and.Years.Worked.As.Dispatcher[,1][Sex.and.Years.Worked.As.Dispatcher[,2] == 1] +1467000591112:females_temp<-Sex.and.Years.Worked.As.Dispatcher[,1][Sex.and.Years.Worked.As.Dispatcher[,2] == 2] +1467000659751:var(male_workers) +1467000692494:var(females_workers) +1467000734099:var(male_workers) +1467000735379:var(females_workers) +1467000766814:female_workers<-Sex.and.Years.Worked.As.Dispatcher[,1][Sex.and.Years.Worked.As.Dispatcher[,2] == 2] +1467000772381:var(female_workers) +1467000969245:male_workers<-Sex.and.Years.Worked.As.Dispatcher[,1][Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher[,2] == 1] +1467000970753:female_workers<-Sex.and.Years.Worked.As.Dispatcher[,1][Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher[,2] == 2] +1467001031688:var(males_temp) +1467001037314:var(females_temp) +1467001045752:# install.packages(Rcmdr) +1467001046845:library(Rcmdr) +1467001049940:?leveneTest +1467001088097:?leveneTest +1467001103722:library(Rcmdr) +1467001112069:leveneTest(body_temp[,1], factor(body_temp[,2])) +1467002066704:males_temp <- body_temp[,1][body_temp[,2] == 1] +1467002067632:females_temp <- body_temp[,2][body_temp[,2] == 2] +1467002080615:var(male_workers) +1467002083479:var(female_workers) +1467002099463:# install.packages(Rcmdr) +1467002100203:library(Rcmdr) +1467002165606:install.packages(RCmdr) +1467002188112:library(Rcmdr) +1467002221913:install.packages(Rcmdr) +1467002286299:library(Rcmdr) +1467002399676:?leveneTest +1467002400608:leveneTest(body_temp[,1], factor(body_temp[,2])) +1467002466892:?leveneTest +1467002592176:leveneTest(Sex.and.Years.Worked.As.Dispatcher[,1], factor(Sex.and.Years.Worked.As.Dispatcher[,2])) +1467002854049:(t2 <- t.test (x = male_workers, +1467002854957:y = female_workers, +1467002855673:var.equal = TRUE, +1467002856423:alternative = two.sided)) +1467002866237:attributes(t2) +1467003094424:male_workers +1467003106615:female_workers +1467036170300:t.test(Sex.and.Years.Worked.As.Dispatcher~Sex.and.Years.Worked.As.Dispatcher$Sex, mu = 0, +1467036171429:alt = two sided, conf=0.95, var.eq=F, paired=F) +1467036197802:t.test(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher~Sex.and.Years.Worked.As.Dispatcher$Sex, mu = 0, +1467036200143:alt = two sided, conf=0.95, var.eq=F, paired=F) +1467036244369:t.test(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher~Sex.and.Years.Worked.As.Dispatcher$Sex, mu = 0, +1467036244991:alt = two.sided, conf=0.95, var.eq=F, paired=F) +1467036860144:leveneTest(Sex.and.Years.Worked.As.Dispatcher[,1], factor(Sex.and.Years.Worked.As.Dispatcher[,2])) +1467037100347:t.test(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher, Sex.and.Years.Worked.As.Dispatcher$Sex, mu = 0, +1467037101351:alt = two.sided, conf=0.95, var.eq=F, paired=F) +1467037529635:leveneTest(Sex.and.Years.Worked.As.Dispatcher[,1], factor(Sex.and.Years.Worked.As.Dispatcher[,2])) +1467038598419:Number of years<- Number.of.years.and.Number.of.dependents(Number.of.years.and.Number.of.dependents$Number.of.Years.Worked) +1467038722722:Number of years<- Number.of.years.and.Number.of.dependents(Number.of.years.and.Number.of.dependents$Number.of.Years.Worked +1467038760033:Numberofyears<- Number.of.years.and.Number.of.dependents(Number.of.years.and.Number.of.dependents$Number.of.Years.Worked +1467038761069:~Number.of.years.and.Number.of.dependents$Number.of.dependents, data =df) +1467038801465:Numberofyears<- (Number.of.years.and.Number.of.dependents$Number.of.Years.Worked +1467038802290:~Number.of.years.and.Number.of.dependents$Number.of.dependents, data =df) +1467038848012:Numberofyears<-lm(Number.of.years.and.Number.of.dependents$Number.of.Years.Worked +1467038848783:~Number.of.years.and.Number.of.dependents$Number.of.dependents, data =df) +1467038849535:summary(Number.of.years.and.Number.of.dependents) +1467038863233:lm1 <- lm(Life.Exp ~ Murder, data = df) +1467038875380:Numberofyears<-lm(Number.of.years.and.Number.of.dependents$Number.of.Years.Worked +1467038876034:~Number.of.years.and.Number.of.dependents$Number.of.dependents, data = df) +1467040647795:##################################################################### +1467040650533:### load ecls +1467040652816:### The F5SPECS variable is a dummy variable because it only +1467040653973:### takes on the values 0 and 1. +1467040656472:### Regress 5th grade math outcome C6R4MSCL on F5SPECS. +1467040718000:llll +1467040783062:cat(\014) +1467040866344:load(ecls) +1467040979427:install.packages(C","/Users/Ben/Downloads/ecls.Rdata, repos = NULL) +1467041014016:load(ecls) +1467041516065:load(C","YOUR NAME" +"/Users/Ben/Downloads/5026/5026.RData) +1467041552936:load(ecls) +1467043107205:lm1 <- lm(C6R4MSCL ~ F5SPECS, data = ecls) +1467043108266:summary(lm1) +1467043114954:### This model fits to flat lines at the respective group +1467043115486:### means of the special education status variable. +1467043115960:library(ggplot2) +1467043118396:### Set up the plotting window +1467043118640:(p1 <- ggplot(ecls, aes(x = F5SPECS, y = C6R4MSCL)) + xlim(-.5, 1.5) + +1467043120738:theme(text = element_text(size=20))) +1467043124004:### Add horizontally jittered points +1467043124487:(p2 <- p1 + geom_jitter(width = 0.2, height = 0.0, color = ecls$F5SPECS+1)) +1467043126079:### Add lines for the different groups +1467043126706:(p3 <- p2 + geom_abline(slope = 0, intercept = coef(lm1), color = 1, lwd = 2) + +1467043127299:geom_abline(slope = 0, intercept = sum(coef(lm1)), color = 2, lwd = 2)) +1467043129423:################################ +1467043129640:### Add pretest as covariate ### +1467043129828:################################ +1467043129986:lm2 <- lm(C6R4MSCL ~ F5SPECS + MIRT, data = ecls) +1467043130904:summary(lm2) +1467043131615:### Set up the plotting window +1467043132178:(q1 <- ggplot(ecls, aes(x = MIRT, y = C6R4MSCL)) + +1467043132644:theme(text = element_text(size=20)) + xlab(Kindergarten Math Score) + +1467043133083:ylab(5th Grade Math Score)) +1467043134112:### Add points with color and pch distinction based on special ed status +1467043137955:(q2 <- q1 + geom_point(aes(pch = factor(F5SPECS), col = factor(F5SPECS)))) +1467043139548:### Adjust the legend title and case labels +1467043143714:(q3 <- q2 + scale_color_discrete(name="", +1467043144395:breaks=c(0, 1), +1467043145050:labels=c(None, Sp.Ed.)) + +1467043147268:guides(shape = FALSE)) # This line specifies no legend for shape +1467043148738:### Add separate regression lines based on lm2 +1467043150145:### Run ggplot_build(q2) to see what the point colors are +1467043152050:(q4 <- q3 + geom_abline(slope = 1.64, intercept = 72.5, col = ","","YOUR NAME" +"1467043153113","geom_abline(slope = 1.64, intercept = 72.5 - 6.7, col = #00BFC4, lwd = 1.5))","YOUR NAME" +"1467043156048","","YOUR NAME" +"1467043156483","","YOUR NAME" +"1467043157047","","YOUR NAME" +"1467043158548","lm3 <- lm(C6R4MSCL ~ F5SPECS + MIRT + I(MIRT^2), data = ecls)","YOUR NAME" +"1467043159452","summary(lm3)","YOUR NAME" +"1467043160764","","YOUR NAME" +"1467043161523","anova(lm1, lm2, lm3)","YOUR NAME" +"1467043162684","","YOUR NAME" +"1467043163422","","YOUR NAME" +"1467043164146","range(ecls$MIRT)","YOUR NAME" +"1467043164895","xvals <- seq(12, 90, .25)","YOUR NAME" +"1467043165721","newd0 <- data.frame(MIRT = xvals, F5SPECS = 0)","YOUR NAME" +"1467043166578","yvals <- predict(lm3, newd0)","YOUR NAME" +"1467043167271","(r4 <- q3 + stat_function(fun = function(x) 28.4 + 4.2*x - .033*x^2,","YOUR NAME" +"1467043168248","col = #F8766D, lwd = 1.5)","YOUR NAME" +"1467043169087","+ stat_function(fun = function(x) 28.4 - 4.3 + 4.2*x - .033*x^2,","YOUR NAME" +"1467043169933","col = #00BFC4, lwd = 1.5))","YOUR NAME" +"1467043172079","","YOUR NAME" +"1467043172811","","YOUR NAME" +"1467043184391","","YOUR NAME" +"1467043185083","lm4 <- lm(C6R4MSCL ~ F5SPECS + MIRT + F5SPECS","YOUR NAME" +"MIRT, data = ecls)","","YOUR NAME" +"1467043186144","summary(lm4)","YOUR NAME" +"1467043188012","","YOUR NAME" +"1467043189399","q3 + stat_smooth(method = lm,","YOUR NAME" +"1467043190403","aes(group = F5SPECS,","YOUR NAME" +"1467043191399","color = factor(F5SPECS)),","YOUR NAME" +"1467043192413","se = FALSE)","YOUR NAME" +"1467043194941","","YOUR NAME" +"1467043200416","lm5 <- lm(C6R4MSCL ~ F5SPECS*(MIRT + I(MIRT^2)), data = ecls)","YOUR NAME" +"1467043201088","summary(lm5)","YOUR NAME" +"1467043202275","","YOUR NAME" +"1467043204299","q3 + stat_smooth(method = lm, formula = y ~ x + I(x^2),","YOUR NAME" +"1467043205109","aes(group = F5SPECS,","YOUR NAME" +"1467043205833","color = factor(F5SPECS)),","YOUR NAME" +"1467043207417","se = FALSE)","YOUR NAME" +"1467043209215","anova(lm1, lm2, lm4, lm5)","YOUR NAME" +"1467043211912","","YOUR NAME" +"1467043212678","q3 + stat_smooth(method = loess,","YOUR NAME" +"1467043218020","aes(group = F5SPECS,","YOUR NAME" +"1467043218996","color = factor(F5SPECS)),","YOUR NAME" +"1467043219989","se = FALSE)","YOUR NAME" +"1467043221102","","YOUR NAME" +"1467043235814","","YOUR NAME" +"1467043236206","","YOUR NAME" +"1467043236618","library(plyr)","YOUR NAME" +"1467043239702","","YOUR NAME" +"1467043241918","ecls$RIRTcat <- factor(cut(ecls$RIRT,","YOUR NAME" +"1467043250357","breaks = c(-Inf, 32.35, 37.56, 44.28, Inf),","YOUR NAME" +"1467043251647","labels = c(lowest, low, high, highest)))","YOUR NAME" +"1467043314994","> levels(ecls$MIRT)","YOUR NAME" +"1467043365864","levels(ecls$RIRTcat)","YOUR NAME" +"1467043474259","lm6 <- lm(C6R4MSCL ~ RIRTcat, ecls)","YOUR NAME" +"1467043474898","summary(lm6)","YOUR NAME" +"1467043481522","","YOUR NAME" +"1467043481861","","YOUR NAME" +"1467043482093","","YOUR NAME" +"1467043482307","A <- model.matrix(C6R4MSCL ~ RIRTcat, ecls)","YOUR NAME" +"1467043484174","A[1","YOUR NAME" +"20,]","","YOUR NAME" +"1467043649112","lm<-lm(C6R4MSCL)","YOUR NAME" +"1467043828336","lm6 <- lm(C6R4MSCL ~ RIRTcat, ecls)","YOUR NAME" +"1467043828923","summary(lm6)","YOUR NAME" +"1467044243641","?aov","YOUR NAME" +"1467044244860","library(car)","YOUR NAME" +"1467044245413","?Anova","YOUR NAME" +"1467044251360","","YOUR NAME" +"1467044251894","","YOUR NAME" +"1467044252175","","YOUR NAME" +"1467044252674","","YOUR NAME" +"1467044253575","library(multcomp)","YOUR NAME" +"1467044258579","?cholesterol","YOUR NAME" +"1467044910612","table(cholesterol$trt)","YOUR NAME" +"1467044915172","boxplot(response ~ trt, data = cholesterol,","YOUR NAME" +"1467044915613","ylab = Reduction in Cholesterol,","YOUR NAME" +"1467044919760","xlab = Treatment)","YOUR NAME" +"1467044932561","","YOUR NAME" +"1467044933084","","YOUR NAME" +"1467044937910","","YOUR NAME" +"1467044943814","library(car)","YOUR NAME" +"1467044946284","qqPlot(lm(response ~ trt, data = cholesterol),","YOUR NAME" +"1467044949550","main = Q-Q Plot, labels = FALSE)","YOUR NAME" +"1467044955700","","YOUR NAME" +"1467044958264","by(cholesterol$response, cholesterol$trt, FUN = mean)","YOUR NAME" +"1467044959853","by(cholesterol$response, cholesterol$trt, FUN = sd)","YOUR NAME" +"1467044961106","by(cholesterol$response, cholesterol$trt, var)","YOUR NAME" +"1467044964767","","YOUR NAME" +"1467045063016","?cholesterol","YOUR NAME" +"1467045075203","table(cholesterol$trt)","YOUR NAME" +"1467045115154","bartlett.test(response ~ trt, data = cholesterol)","YOUR NAME" +"1467045203113","qqPlot(lm(response ~ trt, data = cholesterol),","YOUR NAME" +"1467045204208","main = Q-Q Plot, labels = FALSE)","YOUR NAME" +"1467045207959","","YOUR NAME" +"1467045216611","by(cholesterol$response, cholesterol$trt, FUN = mean)","YOUR NAME" +"1467045222613","by(cholesterol$response, cholesterol$trt, FUN = sd)","YOUR NAME" +"1467045224518","by(cholesterol$response, cholesterol$trt, var)","YOUR NAME" +"1467045232612","by(cholesterol$response, cholesterol$trt, FUN = mean)","YOUR NAME" +"1467045263672","by(cholesterol$response, cholesterol$trt, FUN = sd)","YOUR NAME" +"1467045272875","by(cholesterol$response, cholesterol$trt, var)","YOUR NAME" +"1467045274459","","YOUR NAME" +"1467045275048","bartlett.test(response ~ trt, data = cholesterol)","YOUR NAME" +"1467045333675","","YOUR NAME" +"1467045334670","fit1 <- aov(response ~ trt, data = cholesterol)","YOUR NAME" +"1467045337400","summary(fit1)","YOUR NAME" +"1467045485581","qqPlot(lm(response ~ trt, data = cholesterol),","YOUR NAME" +"1467045486459","main = Q-Q Plot, labels = FALSE)","YOUR NAME" +"1467045495615","fit1 <- aov(response ~ trt, data = cholesterol)","YOUR NAME" +"1467045496274","summary(fit1)","YOUR NAME" +"1467045496709","","YOUR NAME" +"1467045507612","","YOUR NAME" +"1467045507930","","YOUR NAME" +"1467045508205","","YOUR NAME" +"1467045508438","","YOUR NAME" +"1467045508636","","YOUR NAME" +"1467045519837","","YOUR NAME" +"1467045522078","Anova(fit1, TYPE = III)","YOUR NAME" +"1467045524673","","YOUR NAME" +"1467045524986","","YOUR NAME" +"1467045529255","","YOUR NAME" +"1467045530420","dummies <- model.matrix(~ trt, data = cholesterol, contrast = FALSE)","YOUR NAME" +"1467045537117","head(dummies)","YOUR NAME" +"1467045537782","dummies","YOUR NAME" +"1467045592824","lm1 <- lm(response ~ dummies[,2","YOUR NAME" +"5], data = cholesterol)","","YOUR NAME" +"1467045594831","summary(lm1)","YOUR NAME" +"1467045597402","","YOUR NAME" +"1467045660935","","YOUR NAME" +"1467045662009","library(gplots)","YOUR NAME" +"1467045703783","library(gplots)","YOUR NAME" +"1467045744766","install.packages(gplots)","YOUR NAME" +"1467045758923","library(gplots, lib.loc=~/R/win-library/3.3)","YOUR NAME" +"1467045779770","library(gplots)","YOUR NAME" +"1467045799281","library(gplots)","YOUR NAME" +"1467045800208","library(gplots)","YOUR NAME" +"1467045801361","?plotmeans","YOUR NAME" +"1467045802674","plotmeans(response ~ trt,","YOUR NAME" +"1467045805363","data = cholesterol,","YOUR NAME" +"1467045806525","xlab = Treatment,","YOUR NAME" +"1467045807143","ylab = Response,","YOUR NAME" +"1467045807714","main = Mean Plot\nwith 95% CI)","YOUR NAME" +"1467045808830","","YOUR NAME" +"1467045813086","?TukeyHSD","YOUR NAME" +"1467045815127","TukeyHSD(fit1)","YOUR NAME" +"1467045817454","plot(TukeyHSD(fit1))","YOUR NAME" +"1467045910799","?TukeyHSD","YOUR NAME" +"1467045929988","TukeyHSD(fit1)","YOUR NAME" +"1467045931020","plot(TukeyHSD(fit1))","YOUR NAME" +"1467045939322","","YOUR NAME" +"1467045939667","","YOUR NAME" +"1467045939902","","YOUR NAME" +"1467045940187","","YOUR NAME" +"1467045940507","par(las = 2, mar = c(5, 8, 4, 2))","YOUR NAME" +"1467045942679","plot(TukeyHSD(fit1))","YOUR NAME" +"1467045947174","","YOUR NAME" +"1467045948254","","YOUR NAME" +"1467045948964","","YOUR NAME" +"1467045949990","d0<-pairwise.t.test(x = cholesterol$response,","YOUR NAME" +"1467045950951","g = cholesterol$trt,","YOUR NAME" +"1467045951695","p.adj = none)","YOUR NAME" +"1467045955146","","YOUR NAME" +"1467045955794","d1<-pairwise.t.test(x = cholesterol$response,","YOUR NAME" +"1467045956705","g = cholesterol$trt,","YOUR NAME" +"1467045957503","p.adj = bonf)","YOUR NAME" +"1467045963201","","YOUR NAME" +"1467045964535","d2 <- pairwise.t.test(x = cholesterol$response,","YOUR NAME" +"1467045965560","g = cholesterol$trt,","YOUR NAME" +"1467045965966","p.adj = holm)","YOUR NAME" +"1467046142764","d1$p.value/d0$p.value","YOUR NAME" +"1467046236579","mtcars","YOUR NAME" +"1467046644612","numbcyl<-factor(mtcars$cyl)","YOUR NAME" +"1467046659147","numbcyl","YOUR NAME" +"1467046862211","TukeyHSD(numbcyl)","YOUR NAME" +"1467046884642","TukeyHSD(mtcars$cyl)","YOUR NAME" +"1467047188394","?litter","YOUR NAME" +"1467047189170","library(multcomp)","YOUR NAME" +"1467047194016","attach(litter)","YOUR NAME" +"1467047195519","head(litter)","YOUR NAME" +"1467047198174","str(litter)","YOUR NAME" +"1467047198924","table(dose)","YOUR NAME" +"1467047201237","by(weight, dose, FUN = mean)","YOUR NAME" +"1467047279266","?litter","YOUR NAME" +"1467047279945","library(multcomp)","YOUR NAME" +"1467047280385","attach(litter)","YOUR NAME" +"1467047280989","head(litter)","YOUR NAME" +"1467047283310","str(litter)","YOUR NAME" +"1467047284361","table(dose)","YOUR NAME" +"1467047286519","by(weight, dose, FUN = mean)","YOUR NAME" +"1467047291174","library(ggplot2)","YOUR NAME" +"1467047291964","(s1 <- ggplot(data = litter, aes(x = gesttime, y = weight)) +","YOUR NAME" +"1467047292959","theme(text = element_text(size=20)) )","YOUR NAME" +"1467047294396","","YOUR NAME" +"1467047296020","(s2 <- s1 + geom_point(aes(col = dose)))","YOUR NAME" +"1467047298085","","YOUR NAME" +"1467047298976","s1 + geom_point(aes(col = dose)) +","YOUR NAME" +"1467047300174","stat_smooth(method = lm, aes(group = dose, col = dose), se = FALSE)","YOUR NAME" +"1467047301798","","YOUR NAME" +"1467047301815","","YOUR NAME" +"1467047301833","","YOUR NAME" +"1467047303223","","YOUR NAME" +"1467047303235","lmwithout <- lm(weight ~ gesttime + dose, data = litter)","YOUR NAME" +"1467047303257","lmwith <- lm(weight ~ gesttime + dose + gesttime","YOUR NAME" +"dose, data = litter)","","YOUR NAME" +"1467047303910","","YOUR NAME" +"1467047305072","","YOUR NAME" +"1467047305877","anova(lmwithout, lmwith)","YOUR NAME" +"1467047307360","","YOUR NAME" +"1467047308516","","YOUR NAME" +"1467047309391","","YOUR NAME" +"1467047310089","","YOUR NAME" +"1467047310472","","YOUR NAME" +"1467047311469","qqPlot(lm(weight ~ gesttime + dose, data = litter),","YOUR NAME" +"1467047324612","library(ggplot2)","YOUR NAME" +"1467047325267","(s1 <- ggplot(data = litter, aes(x = gesttime, y = weight)) +","YOUR NAME" +"1467047326082","theme(text = element_text(size=20)) )","YOUR NAME" +"1467047327269","","YOUR NAME" +"1467047328359","(s2 <- s1 + geom_point(aes(col = dose)))","YOUR NAME" +"1467047329112","","YOUR NAME" +"1467047329642","s1 + geom_point(aes(col = dose)) +","YOUR NAME" +"1467047329803","stat_smooth(method = lm, aes(group = dose, col = dose), se = FALSE)","YOUR NAME" +"1467047330239","","YOUR NAME" +"1467047336335","","YOUR NAME" +"1467047336957","","YOUR NAME" +"1467047337415","","YOUR NAME" +"1467047337797","lmwithout <- lm(weight ~ gesttime + dose, data = litter)","YOUR NAME" +"1467047338347","lmwith <- lm(weight ~ gesttime + dose + gesttime","YOUR NAME" +"dose, data = litter)","","YOUR NAME" +"1467047338705","","YOUR NAME" +"1467047340003","","YOUR NAME" +"1467047345410","anova(lmwithout, lmwith)","YOUR NAME" +"1467047361393","","YOUR NAME" +"1467047361682","","YOUR NAME" +"1467047361850","","YOUR NAME" +"1467047362222","","YOUR NAME" +"1467047362337","","YOUR NAME" +"1467047362833","qqPlot(lm(weight ~ gesttime + dose, data = litter),","YOUR NAME" +"1467047363949","main = Q-Q Plot, labels = FALSE)","YOUR NAME" +"1467047365273","","YOUR NAME" +"1467047366044","fit2 <- aov(weight ~ gesttime + dose)","YOUR NAME" +"1467047367821","summary(fit2)","YOUR NAME" +"1467047369318","","YOUR NAME" +"1467047370195","Anova(fit2)","YOUR NAME" +"1467047371150","summary(lmwithout)","YOUR NAME" +"1467047372510","","YOUR NAME" +"1467047373351","lm5 <- lm(weight ~ gesttime, data = litter)","YOUR NAME" +"1467047374292","lm6 <- lm(weight ~ gesttime + dose, data = litter)","YOUR NAME" +"1467047375028","anova(lm5, lm6)","YOUR NAME" +"1467047376614","","YOUR NAME" +"1467047377525","summary(lm6)","YOUR NAME" +"1467047453096","","YOUR NAME" +"1467047453463","","YOUR NAME" +"1467047453712","","YOUR NAME" +"1467047454253","s2 + geom_abline(slope = 3.519, intercept = -45.37, color = #F8766D, lwd = 1.5) +","YOUR NAME" +"1467047454762","geom_abline(slope = 3.519, intercept = -45.37 - 3.48, color = #7CAE00, lwd = 1.5) +","YOUR NAME" +"1467047455547","geom_abline(slope = 3.519, intercept = -45.37 - 1.79, color = #00BFC4, lwd = 1.5) +","YOUR NAME" +"1467047456218","geom_abline(slope = 3.519, intercept = -45.37 - 3.02, color = #C77CFF, lwd = 1.5)","YOUR NAME" +"1467133014531","Stress.Data <- read.delim(C:/Users/Ben/Downloads/Stress Data.txt)","YOUR NAME" +"1467133014634","View(Stress.Data)","YOUR NAME" +"1467133079024","Shift.type.1 <- read.delim(~/Shift type 1.txt, header=FALSE)","YOUR NAME" +"1467133079046","View(Shift.type.1)","YOUR NAME" +"1467133449965","ShifTypeyes <- read.delim(C:/Users/Ben/Downloads/ShifTypeyes.txt, header=FALSE)","YOUR NAME" +"1467133449995","View(ShifTypeyes)","YOUR NAME" +"1467133713932","View(ShifTypeyes)","YOUR NAME" +"1467137527994","rcorr(ShifTypeyes$V1,ShifTypeyes$V2)","YOUR NAME" +"1467138092904","mean(ShifTypeyes$V1)","YOUR NAME" +"1467138122338","mean(ShifTypeyes$V2)","YOUR NAME" +"1467138286261","sapply(ShifTypeyes$V1, mean, na.rm=TRUE)","YOUR NAME" +"1467138405183","stat.desc(ShifTypeyes$V1)","YOUR NAME" +"1467138434057","sapply(ShifTypeyes)","YOUR NAME" +"1467138466682","sapply(ShifTypeyes, mean, na.rm = TRUE)","YOUR NAME" +"1467144269003","fit <- aov(ShifTypeyes$V1 ~ ShifTypeyes$V2 ~ ShifTypeyes$V3 )","YOUR NAME" +"1467144313978","fit <- aov(ShifTypeyes$V1 ~ ShifTypeyes$V2 ~ ShifTypeyes$V3, data = ShifTypeyes )","YOUR NAME" +"1467144913519","library(car)","YOUR NAME" +"1467144918303","qqPlot(lm(response ~ trt, data = cholesterol),","YOUR NAME" +"1467144918321","main = Q-Q Plot, labels = FALSE)","YOUR NAME" +"1467144918335","","YOUR NAME" +"1467144924524","fit1 <- aov(response ~ trt, data = cholesterol)","YOUR NAME" +"1467144934684","library(car)","YOUR NAME" +"1467144949093","fit1 <- aov(response ~ trt, data = cholesterol)","YOUR NAME" +"1467144973285","library(multcomp)","YOUR NAME" +"1467144974326","?cholesterol","YOUR NAME" +"1467144986589","table(cholesterol$trt)","YOUR NAME" +"1467145027028","cholesterol","YOUR NAME" +"1467146112321","View(ShifTypeyes)","YOUR NAME" +"1467146161698","ShifTypeyes$V1","YOUR NAME" +"1467148705029","Shift <- read.delim(~/Shift.txt, header=FALSE)","YOUR NAME" +"1467148705076","View(Shift)","YOUR NAME" +"1467148778017","Shift","YOUR NAME" +"1467148935354","fit<- aov(Shift$V2 ~ Shift$1V1, data = Shift)","YOUR NAME" +"1467149134167","fit<- aov(Shift$V2 ~ Shift$V1, data = Shift)","YOUR NAME" +"1467149170885","summary(fit)","YOUR NAME" +"1467149538738","fit<- aov(Shift$V1 ~ Shift$V2, data = Shift)","YOUR NAME" +"1467149539732","summary(fit)","YOUR NAME" +"1467150151808","qqplot((lm)ShiftV2 ~ ShiftV1, data = Shift),","YOUR NAME" +"1467150218994","qqplot(lm(ShiftV2 ~ ShiftV1, data = Shift),","YOUR NAME" +"1467150219838","main = Q-Q Plot, labels = FALSE))","YOUR NAME" +"1467150229528","qqplot(lm(ShiftV2 ~ ShiftV1, data = Shift),","YOUR NAME" +"1467150230464","main = Q-Q Plot, labels = FALSE)","YOUR NAME" +"1467150274025","qqplot(lm(Shift$V2 ~ ShiftV1, data = Shift),","YOUR NAME" +"1467150274775","main = Q-Q Plot, labels = FALSE)","YOUR NAME" +"1467150292215","qqplot(lm(Shift$V2 ~ Shift$V1, data = Shift),","YOUR NAME" +"1467150292963","main = Q-Q Plot, labels = FALSE)","YOUR NAME" +"1467150533571","bartlett.test(Shift$V2 ~ Shift$V1, data = Shift)","YOUR NAME" +"1467151382509","lm?","YOUR NAME" +"1467151394855","?lm","YOUR NAME" +"1467151409939","?(lm)","YOUR NAME" +"1467151959149","qqnorm(Shift$V2);qqline(ShiftV2, col = 2)","YOUR NAME" +"1467152008478","qqnorm(Shift$V2);qqline(ShiftV$V2, col = 2)","YOUR NAME" +"1467152027359","qqnorm(Shift$V2);qqline(Shift, col = 2)","YOUR NAME" +"1467152045140","qqnorm(Shift$V2);qqline(Shift, col = 1)","YOUR NAME" +"1467152120897","qqnorm(Shift$V1);qqline(Shift, col = 2)","YOUR NAME" +"1467172329295","library(ggplot2)","YOUR NAME" +"1467176777104","qplot(Shift$V2, data = Shift$V1, geom = bar)","YOUR NAME" +"1467176802922","qplot(Shift, data = Shift$V1, geom = bar)","YOUR NAME" +"1467176811103","qplot(Shift, data = Shift, geom = bar)","YOUR NAME" +"1467176838760","qplot(Shift, geom = bar)","YOUR NAME" +"1467176972438","(tab1)<-(table(Shift$V2))","YOUR NAME" +"1467176987980","(tab1<-(table(Shift$V2))","YOUR NAME" +"1467177030045","barplot(height = tab1)","YOUR NAME" +"1467177093321","(tab1<-table(Shift$V2))","YOUR NAME" +"1467177096540","barplot(height = tab1)","YOUR NAME" +"1467177292261","barplot(height = tab1,","YOUR NAME" +"1467177293044","xlab = Shift Type (1-3),","YOUR NAME" +"1467177293759","ylab = Number of Dispatchers,","YOUR NAME" +"1467177294608","main = Stress)","YOUR NAME" +"1467177490447","(tab2<- table(Shift$V2, Shift$V1))","YOUR NAME" +"1467177494823","barplot(tab2, beside = FALSE, ","YOUR NAME" +"1467177499162","xlab = Discipline,","YOUR NAME" +"1467177500918","ylab = Frequency,","YOUR NAME" +"1467177507948","legend = rownames(tab2))","YOUR NAME" +"1467177735760","(tab2<- table(Shift$V1, Shift$V2))","YOUR NAME" +"1467177737530","barplot(tab2, beside = FALSE, ","YOUR NAME" +"1467177738949","xlab = Discipline,","YOUR NAME" +"1467177740231","ylab = Frequency,","YOUR NAME" +"1467177741163","legend = rownames(tab2))","YOUR NAME" +"1467178091766","colors()[grep(red, x = colors())]","YOUR NAME" +"1467178324264","barplot(tab2, beside = FALSE,","YOUR NAME" +"1467178325387","xlab = Shift Type (1-3),","YOUR NAME" +"1467178331407","ylab = Aggredate Dispatcher Responses,","YOUR NAME" +"1467178339484","col = c(red25, blue 50, green 40)),","YOUR NAME" +"1467178350657","barplot(tab2, beside = FALSE,","YOUR NAME" +"1467178351671","xlab = Shift Type (1-3),","YOUR NAME" +"1467178352447","ylab = Aggredate Dispatcher Responses,","YOUR NAME" +"1467178353466","col = c(red25, blue 50, green 40))","YOUR NAME" +"1467178354356","legend(x = .45, y = 150, legend = rownames(tab2),","YOUR NAME" +"1467178356730","fill = c(red20, blue40, green30),","YOUR NAME" +"1467178361074","bg = white)","YOUR NAME" +"1467178382292","barplot(tab2, beside = FALSE,","YOUR NAME" +"1467178383072","xlab = Shift Type (1-3),","YOUR NAME" +"1467178383699","ylab = Aggredate Dispatcher Responses,","YOUR NAME" +"1467178385042","col = c(red1, blue 50, green 40))","YOUR NAME" +"1467178411640","barplot(tab2, beside = FALSE,","YOUR NAME" +"1467178412386","xlab = Shift Type (1-3),","YOUR NAME" +"1467178413010","ylab = Aggredate Dispatcher Responses,","YOUR NAME" +"1467178413614","col = c(red1, blue 1, green 1))","YOUR NAME" +"1467178501417","barplot(tab2, beside = FALSE,","YOUR NAME" +"1467178502638","xlab = Shift Type (1-3),","YOUR NAME" +"1467178503670","ylab = Aggredate Dispatcher Responses,","YOUR NAME" +"1467178505323","col = c(red1, blue1, green1, yellow1))","YOUR NAME" +"1467178506433","legend(x = .45, y = 150, legend = rownames(tab2),","YOUR NAME" +"1467178509697","fill = c(red1, blue1, green1, yellow1),","YOUR NAME" +"1467178510887","bg = white)","YOUR NAME" +"1467178654709","barplot(tab2, beside = FALSE,","YOUR NAME" +"1467178655421","xlab = Shift Type (1-3),","YOUR NAME" +"1467178656016","ylab = Aggredate Dispatcher Responses,","YOUR NAME" +"1467178656697","col = c(blue1, green1, orange1, red1))","YOUR NAME" +"1467178657519","legend(x = .45, y = 150, legend = rownames(tab2),","YOUR NAME" +"1467178667215","fill = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467178669540","bg = white)","YOUR NAME" +"1467179074827","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179075767","xlab = Shift Type (1-3),","YOUR NAME" +"1467179077574","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179079577","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179081293","main = Distribution of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179085733","legend(x = 1.2, y = 100, legend = rownames(tab2),","YOUR NAME" +"1467179088136","fill = c(blue1, green1, orange1, red1)) ","YOUR NAME" +"1467179100604","legend(x = 1.2, y = 200, legend = rownames(tab2),","YOUR NAME" +"1467179110323","legend(x = 1.2, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1467179123034","legend(x = 5.2, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1467179127951","fill = c(blue1, green1, orange1, red1)) ","YOUR NAME" +"1467179140015","legend(x = 200, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1467179156751","legend(x = 200, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1467179158072","fill = c(blue1, green1, orange1, red1)) ","YOUR NAME" +"1467179164765","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179165448","xlab = Shift Type (1-3),","YOUR NAME" +"1467179166165","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179166860","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179167982","main = Distribution of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179170041","legend(x = 200, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1467179174325","fill = c(blue1, green1, orange1, red1)) ","YOUR NAME" +"1467179199201","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179199979","xlab = Shift Type (1-3),","YOUR NAME" +"1467179200402","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179200639","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179202200","main = Distribution of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179204199","legend(x = 10, y = 50, legend = rownames(tab2),","YOUR NAME" +"1467179217953","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179218332","xlab = Shift Type (1-3),","YOUR NAME" +"1467179218486","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179219018","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179219531","main = Distribution of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179221071","legend(x = 5, y = 10, legend = rownames(tab2),","YOUR NAME" +"1467179224386","fill = c(blue1, green1, orange1, red1)) ","YOUR NAME" +"1467179401118","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179401784","xlab = Shift Type (1-3),","YOUR NAME" +"1467179402483","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179404417","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179405898","main = Distribution Of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179407140","legend(x = 1, y = 100, legend = rownames(tab2),","YOUR NAME" +"1467179408483","fill = c(blue1, green1, orange1, red1))","YOUR NAME" +"1467179422107","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179422918","xlab = Shift Type (1-3),","YOUR NAME" +"1467179423542","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179424230","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179425042","main = Distribution Of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179427982","legend(x = 2, y = 200, legend = rownames(tab2),","YOUR NAME" +"1467179430167","fill = c(blue1, green1, orange1, red1))","YOUR NAME" +"1467179450053","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179450593","xlab = Shift Type (1-3),","YOUR NAME" +"1467179450997","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179451208","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179451470","main = Distribution Of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179451735","legend(x = 2, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1467179452311","fill = c(blue1, green1, orange1, red1))","YOUR NAME" +"1467179465767","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179466261","xlab = Shift Type (1-3),","YOUR NAME" +"1467179466541","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179466765","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179467042","main = Distribution Of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179468886","legend(x = 5, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1467179469866","fill = c(blue1, green1, orange1, red1))","YOUR NAME" +"1467179489738","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179490420","xlab = Shift Type (1-3),","YOUR NAME" +"1467179490949","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179491339","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179491949","main = Distribution Of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179492673","legend(x = 10, y = 1100, legend = rownames(tab2),","YOUR NAME" +"1467179493391","fill = c(blue1, green1, orange1, red1))","YOUR NAME" +"1467179520076","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179520700","xlab = Shift Type (1-3),","YOUR NAME" +"1467179520993","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179521354","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179521745","main = Distribution Of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179522261","legend(x = 15, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1467179523790","fill = c(blue1, green1, orange1, red1))","YOUR NAME" +"1467179534604","barplot(tab2, beside = TRUE,","YOUR NAME" +"1467179535233","xlab = Shift Type (1-3),","YOUR NAME" +"1467179535827","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1467179536510","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1467179537290","main = Distribution Of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1467179538084","legend(x = 13, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1467179539480","fill = c(blue1, green1, orange1, red1))","YOUR NAME" +"1467201318216","library(ggplot2)","YOUR NAME" +"1467201539621","(s1 <- ggplot(data = Shift, aes(x =Shift$V2, y = ShiftV1))) +","YOUR NAME" +"1467201541368","theme(text = element_text(size size = 20)","YOUR NAME" +"1467201616932","(s1 <- ggplot(data = Shift, aes(x =Shift$V2, y = ShiftV1))) +","YOUR NAME" +"1467201617775","theme(text = element_text(size = 20)) )","YOUR NAME" +"1467201633495","(s1 <- ggplot(data = Shift, aes(x =Shift$V2, y = ShiftV1)) +","YOUR NAME" +"1467201634058","theme(text = element_text(size = 20)) )","YOUR NAME" +"1467201646089","(s1 <- ggplot(data = Shift, aes(x =Shift$V2, y = Shift$V1)) +","YOUR NAME" +"1467201646776","theme(text = element_text(size = 20)) )","YOUR NAME" +"1467201650806","theme(text = element_text(size = 20)) )","YOUR NAME" +"1467201662496","(s1 <- ggplot(data = Shift, aes(x =Shift$V2, y = Shift$V1)) +","YOUR NAME" +"1467201662931","theme(text = element_text(size = 20))","YOUR NAME" +"1467201665433","theme(text = element_text(size = 20))","YOUR NAME" +"1467201717617","(s1 <- ggplot(data = Shift, aes(x =Shift$V2, y = Shift$V1)) +","YOUR NAME" +"1467201718151","(text = element_text(size = 20))","YOUR NAME" +"1467201719871","(text = element_text(size = 20))","YOUR NAME" +"1467201722026","(text = element_text(size = 20))","YOUR NAME" +"1467201845339","Number.of.years.and.Number.of.dependents <- read.delim(~/Number of years and Number of dependents.txt)","YOUR NAME" +"1467201845353","View(Number.of.years.and.Number.of.dependents)","YOUR NAME" +"1467201884933","YearsDependents <- read.delim(~/Number of years and Number of dependents.txt)","YOUR NAME" +"1467201884952","View(YearsDependents)","YOUR NAME" +"1467201983042","(s2 <- s1 + geom_point(aes(col(= YearsDependents$Number.of.dependents)))","YOUR NAME" +"1467202012164","(s2 <- s1 + geom_point(aes(col = YearsDependents$Number.of.dependents)))","YOUR NAME" +"1467202035947","(s1 <- ggplot(data = Shift, aes(x =Shift$V2, y = Shift$V1)) +","YOUR NAME" +"1467202036510","theme(text = element_text(size = 20))","YOUR NAME" +"1467202040636","(s2 <- s1 + geom_point(aes(col = YearsDependents$Number.of.dependents)))","YOUR NAME" +"1467202651606","fit2 <- aov( Shift$V2 ~ Shift$V1 + YearsDependents$Number.of.dependents)","YOUR NAME" +"1467202687666","fit2 <- aov( Shift$V2 ~ Shift$V1 + YearsDependents$Number.of.dependents)","YOUR NAME" +"1467203188417","contrasts(Shift$V1) = contr.poly(3)","YOUR NAME" +"1467203214329","contrasts(Shift$V1) = contr.poly(4)","YOUR NAME" +"1467203245574","contrasts(Shift$V1) = contr.poly(4)","YOUR NAME" +"1467203279230","contrasts(Shift$V2) = contr.poly(4)","YOUR NAME" +"1467203307667","contrasts(Shift$V2) = contr.poly(4 df=1)","YOUR NAME" +"1467203382340","model.1=aov(dv~YearsDependents$Number.of.dependents, data = YearsDependents)","YOUR NAME" +"1467203384051","Anova(model.1, type=III)","YOUR NAME" +"1467205136760","Sex.and.Years.Worked.As.Dispatcher <- read.delim(~/Sex and Years Worked As Dispatcher.txt)","YOUR NAME" +"1467205136785","View(Sex.and.Years.Worked.As.Dispatcher)","YOUR NAME" +"1467205942918","is.data.frame(Sex.and.Years.Worked.As.Dispatcher)","YOUR NAME" +"1467205944417","df <- data.frame(Sex.and.Years.Worked.As.Dispatcher)","YOUR NAME" +"1467205947542","is.data.frame(df)","YOUR NAME" +"1467205960354","round(cor(df), digits = 2)","YOUR NAME" +"1467206190918","plot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~, data = df, ylab = Total Years as Dispatcher,","YOUR NAME" +"1467206203577","plot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~ data = df, ylab = Total Years as Dispatcher,","YOUR NAME" +"1467206277103","plot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~ Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1467206277944","data = df, ylab = Total Years as Dispatcher,","YOUR NAME" +"1467206279167","xlab = Sex, main = Sex and Years Worked as a Dispatcher)","YOUR NAME" +"1467206340328","plot( Sex.and.Years.Worked.As.Dispatcher$Sex ~ Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ,","YOUR NAME" +"1467206341192","data = df, ylab = Total Years as Dispatcher,","YOUR NAME" +"1467206342201","xlab = Sex, main = Sex and Years Worked as a Dispatcher)","YOUR NAME" +"1467206418701","plot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~ Sex.and.Years.Worked.As.Dispatcher$Sex ,","YOUR NAME" +"1467206419667","data = df, ylab = Total Years as Dispatcher,","YOUR NAME" +"1467206420416","xlab = Sex, main = Sex and Years Worked as a Dispatcher)","YOUR NAME" +"1467206521261","lml <- lm(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~ data = df)","YOUR NAME" +"1467206521762","summary(lml)","YOUR NAME" +"1467206536448","lml<- lm(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~ data = df)","YOUR NAME" +"1467206603409","lml<- lm(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~ Sex.and.Years.Worked.As.Dispatcher$Sex, data = df)","YOUR NAME" +"1467206605388","summary(lml)","YOUR NAME" +"1467206687104","plot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~ Sex.and.Years.Worked.As.Dispatcher$Sex ,","YOUR NAME" +"1467206687791","data = df, ylab = Total Years as Dispatcher,","YOUR NAME" +"1467206688698","xlab = Sex (1 = male, 2 = female, main = Sex and Years Worked as a Dispatcher)","YOUR NAME" +"1467206700045","plot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~ Sex.and.Years.Worked.As.Dispatcher$Sex ,","YOUR NAME" +"1467206700577","data = df, ylab = Total Years as Dispatcher,","YOUR NAME" +"1467206701167","xlab = Sex (1 = male, 2 = female), main = Sex and Years Worked as a Dispatcher)","YOUR NAME" +"1467209006752","hist(Sex.and.Years.Worked.As.Dispatcher$Sex, Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher)","YOUR NAME" +"1467209310441","barplot(Sex.and.Years.Worked.As.Dispatcher$Sex, Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher)","YOUR NAME" +"1467209361033","ggplot(Sex.and.Years.Worked.As.Dispatcher,$Sex, Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher)","YOUR NAME" +"1467209369965","ggplot(Sex.and.Years.Worked.As.Dispatcher$Sex, Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher)","YOUR NAME" +"1467209409305","ggplot(Sex.and.Years.Worked.As.Dispatcher$Sex, Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher, geom = barplot)","YOUR NAME" +"1467209565594","par(mfrow = c(1,2))","YOUR NAME" +"1467209566654","plot(model.1, which = 1)","YOUR NAME" +"1467209650004","model.1=aov(Shift, data = Shift$V1)","YOUR NAME" +"1467209652737","Anova(model.1, type=III)","YOUR NAME" +"1467209689939","model.1=aov(Shift$V2, data = Shift$V1)","YOUR NAME" +"1467209694885","Anova(model.1, type=III)","YOUR NAME" +"1467209727780","model.1=aov(Shift, data = df)","YOUR NAME" +"1467209730151","Anova(model.1, type=III)","YOUR NAME" +"1467210212813","library(ggplot2)","YOUR NAME" +"1467210213398","(s1 <- ggplot(data = Shift, aes(x = Shift$2V2, y = Shift$1V1)) +","YOUR NAME" +"1467210213995","theme(text = element_text(size=20)) )","YOUR NAME" +"1467210345521","alt = two.sided, conf=0.95, var.eq=F, paired=F)","YOUR NAME" +"1467210444714","t.test(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher, Sex.and.Years.Worked.As.Dispatcher$Sex, mu = 0,","YOUR NAME" +"1467210445803","alt = two.sided, conf.level = .095, var.equal = F, paired = F)","YOUR NAME" +"1467213766276","install.packages(pwr)","YOUR NAME" +"1467213777615","library(pwr)","YOUR NAME" +"1467213777668","","YOUR NAME" +"1467213777687","","YOUR NAME" +"1467213777706","","YOUR NAME" +"1467213777734","","YOUR NAME" +"1467213777759","","YOUR NAME" +"1467213777781","","YOUR NAME" +"1467213778077","","YOUR NAME" +"1467213779074","","YOUR NAME" +"1467213779096","","YOUR NAME" +"1467213779117","","YOUR NAME" +"1467213779145","","YOUR NAME" +"1467213779159","","YOUR NAME" +"1467213779174","","YOUR NAME" +"1467213779193","","YOUR NAME" +"1467213779216","","YOUR NAME" +"1467213779234","","YOUR NAME" +"1467213779254","","YOUR NAME" +"1467216017481","(p0 <- out$expected / 212)","YOUR NAME" +"1467216018260","(p1 <- out$observed / 212)","YOUR NAME" +"1467216026072","","YOUR NAME" +"1467216026419","","YOUR NAME" +"1467216026816","","YOUR NAME" +"1467216027138","","YOUR NAME" +"1467216027404","","YOUR NAME" +"1467216027581","","YOUR NAME" +"1467216028013","","YOUR NAME" +"1467216028340","","YOUR NAME" +"1467216028544","","YOUR NAME" +"1467216028857","","YOUR NAME" +"1467216029034","","YOUR NAME" +"1467216029393","mat <- matrix(c(45, 6, 3, 50, 8, 6, 6, 8, 7, 9,","YOUR NAME" +"1467216029709","6, 2, 2, 5, 4, 2, 7, 13, 18, 5),","YOUR NAME" +"1467216030670","nrow = 4, ncol = 5)","YOUR NAME" +"1467216031199","mat","YOUR NAME" +"1467216031447","out <- chisq.test(mat)","YOUR NAME" +"1467216031925","out$statistic","YOUR NAME" +"1467216032244","out$parameter","YOUR NAME" +"1467216032621","out$p.value","YOUR NAME" +"1467216032776","out$expected","YOUR NAME" +"1467216033181","","YOUR NAME" +"1467216033833","","YOUR NAME" +"1467216034734","","YOUR NAME" +"1467216057409","","YOUR NAME" +"1467216058426","","YOUR NAME" +"1467216059028","(p0 <- out$expected / 212)","YOUR NAME" +"1467216059535","(p1 <- out$observed / 212)","YOUR NAME" +"1467216060202","(w <- sqrt(sum((p0 - p1)^2/p0)))","YOUR NAME" +"1467216104665","","YOUR NAME" +"1467216105542","","YOUR NAME" +"1467216107115","pwr.chisq.test(w = .606, df = 12, sig.level = .05, N = 212)","YOUR NAME" +"1467216120358","out$statistic","YOUR NAME" +"1467218054261","plot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~ Sex.and.Years.Worked.As.Dispatcher$Sex ,","YOUR NAME" +"1467218055197","data = df, ylab = Total Years as Dispatcher,","YOUR NAME" +"1467218056106","xlab = Sex (1 = male, 2 = female), main = Sex and Years Worked as a Dispatcher)","YOUR NAME" +"1468001476759","","YOUR NAME" +"1468001477660","install.packages(ggplot2)","YOUR NAME" +"1468001492710","library(ggplot2)","YOUR NAME" +"1468001497214","","YOUR NAME" +"1468001497237","data(diamonds)","YOUR NAME" +"1468001497370","","YOUR NAME" +"1468001497392","?diamonds","YOUR NAME" +"1468001498331","str(diamonds)","YOUR NAME" +"1468001498733","dim(diamonds)","YOUR NAME" +"1468001498750","head(diamonds)","YOUR NAME" +"1468001498785","","YOUR NAME" +"1468001498801","","YOUR NAME" +"1468001498817","","YOUR NAME" +"1468001498834","","YOUR NAME" +"1468001498848","","YOUR NAME" +"1468001498864","plot(x = diamonds$carat, y = diamonds$price)","YOUR NAME" +"1468001509246","","YOUR NAME" +"1468001509261","qplot(x = carat, y = price, data = diamonds)","YOUR NAME" +"1468001517852","","YOUR NAME" +"1468001517868","","YOUR NAME" +"1468001517886","qplot(x = carat, y = price, data = diamonds,","YOUR NAME" +"1468001517909","main = Diamond Data Plot)","YOUR NAME" +"1468001541396","","YOUR NAME" +"1468001541410","qplot(x = carat, y = price, data = diamonds,","YOUR NAME" +"1468001541602","margins = TRUE)","YOUR NAME" +"1468001559748","","YOUR NAME" +"1468001559764","qplot(x = log(carat), y = log(price), data = diamonds)","YOUR NAME" +"1468001567937","","YOUR NAME" +"1468001567952","","YOUR NAME" +"1468001567969","qplot(carat, x*y*z, data = diamonds)","YOUR NAME" +"1468001584724","","YOUR NAME" +"1468001584742","(ind1 <- with(diamonds, which(x*y*z > 3500)))","YOUR NAME" +"1468001584762","diamonds[ind1,]","YOUR NAME" +"1468001584789","","YOUR NAME" +"1468001584807","(ind2 <- with(diamonds, which(carat == 2)))","YOUR NAME" +"1468001594923","diamonds[ind2,]","YOUR NAME" +"1468001595188","","YOUR NAME" +"1468001595207","","YOUR NAME" +"1468001595222","","YOUR NAME" +"1468001595238","","YOUR NAME" +"1468001595254","","YOUR NAME" +"1468001595270","set.seed(1410)","YOUR NAME" +"1468001595289","dsmall <- diamonds[sample(nrow(diamonds), 100), ]","YOUR NAME" +"1468001595311","","YOUR NAME" +"1468001595327","","YOUR NAME" +"1468001595343","","YOUR NAME" +"1468001595361","","YOUR NAME" +"1468001595381","qplot(carat, price, data = dsmall, color = color)","YOUR NAME" +"1468001596503","qplot(carat, price, data = dsmall, shape = cut)","YOUR NAME" +"1468001597825","qplot(carat, price, data = dsmall, color = color, shape = cut)","YOUR NAME" +"1468001599303","qplot(carat, price, data = dsmall, size = color)","YOUR NAME" +"1468001600797","","YOUR NAME" +"1468001600816","qplot(carat, price, data = diamonds, alpha = I(1/10))","YOUR NAME" +"1468001609595","qplot(carat, price, data = diamonds, alpha = I(1/100))","YOUR NAME" +"1468001618743","","YOUR NAME" +"1468001618756","","YOUR NAME" +"1468001618776","","YOUR NAME" +"1468001633171","","YOUR NAME" +"1468001633187","","YOUR NAME" +"1468001633208","","YOUR NAME" +"1468001633230","","YOUR NAME" +"1468001633248","","YOUR NAME" +"1468001633272","","YOUR NAME" +"1468001633295","","YOUR NAME" +"1468001633313","","YOUR NAME" +"1468001633330","","YOUR NAME" +"1468001633472","qplot(carat, price, data = dsmall, geom = c(point, smooth))","YOUR NAME" +"1468001634408","qplot(carat, price, data = diamonds, geom = c(point, smooth))","YOUR NAME" +"1468001646876","","YOUR NAME" +"1468001646891","","YOUR NAME" +"1468001646910","","YOUR NAME" +"1468001646932","","YOUR NAME" +"1468001646949","","YOUR NAME" +"1468001656879","","YOUR NAME" +"1468001656898","","YOUR NAME" +"1468001656914","qplot(carat, price, data = dsmall) + stat_smooth(method = loess,","YOUR NAME" +"1468001656931","span = .2)","YOUR NAME" +"1468001657782","qplot(carat, price, data = dsmall) + stat_smooth(method = loess,","YOUR NAME" +"1468001657799","span = 1)","YOUR NAME" +"1468001658900","","YOUR NAME" +"1468001658916","","YOUR NAME" +"1468001658933","library(mgcv)","YOUR NAME" +"1468001659971","qplot(carat, price, data = dsmall) + stat_smooth(method = gam,","YOUR NAME" +"1468001659988","formula = y ~ s(x), size = 1)","YOUR NAME" +"1468001660874","qplot(carat, price, data = diamonds) + stat_smooth(method = gam,","YOUR NAME" +"1468001660894","formula = y ~ s(x), size = 1)","YOUR NAME" +"1468001668436","","YOUR NAME" +"1468001668451","qplot(carat, price, data = diamonds) + stat_smooth(method = lm)","YOUR NAME" +"1468001675916","","YOUR NAME" +"1468001675931","qplot(carat, price, data = diamonds) + stat_smooth(method = lm,","YOUR NAME" +"1468001675946","formula = y ~ poly(x, 2, raw = TRUE))","YOUR NAME" +"1468001692263","","YOUR NAME" +"1468001692278","qplot(carat, price, data = diamonds) + stat_smooth(method = lm,","YOUR NAME" +"1468001692292","formula = y ~ poly(x, 3, raw = TRUE))","YOUR NAME" +"1468001709554","","YOUR NAME" +"1468001709567","library(splines)","YOUR NAME" +"1468001720464","","YOUR NAME" +"1468001720478","","YOUR NAME" +"1468001720492","qplot(carat, price, data = diamonds) + stat_smooth(method = lm,","YOUR NAME" +"1468001720505","formula = y ~ ns(x, 5))","YOUR NAME" +"1468001727125","","YOUR NAME" +"1468001727144","","YOUR NAME" +"1468001727160","","YOUR NAME" +"1468001727179","","YOUR NAME" +"1468001727205","qplot(color, price/carat, data = diamonds, geom = point,","YOUR NAME" +"1468001737213","alpha = I(1/10))","YOUR NAME" +"1468001746513","","YOUR NAME" +"1468001746531","qplot(color, price/carat, data = diamonds, geom = jitter,","YOUR NAME" +"1468001746547","qplot(color, price/carat, data = diamonds, geom = jitter,","YOUR NAME" +"1468001746567","alpha = I(1/10))","YOUR NAME" +"1468001746587","alpha = I(1/100))","YOUR NAME" +"1468001761145","","YOUR NAME" +"1468001761159","qplot(color, price/carat, data = diamonds, geom = boxplot,","YOUR NAME" +"1468001761178","or, price/carat, data = diamonds, geom = point,","YOUR NAME" +"1468001761199","alpha = I(1/10))","YOUR NAME" +"1468001761223","","YOUR NAME" +"1468001761241","qplot(color, price/carat, data = diamonds, geom = jitter,","YOUR NAME" +"1468001761261","alpha = I(1/10))","YOUR NAME" +"1468001769667","qplot(color, price/carat, data = diamonds, geom = jitter,","YOUR NAME" +"1468001769682","alpha = I(1/100))","YOUR NAME" +"1468001778786","","YOUR NAME" +"1468001778802","qplot(color, price/carat, data = diamonds, geom = boxplot,","YOUR NAME" +"1468001778822","alpha = I(1/10))","YOUR NAME" +"1468001795986","","YOUR NAME" +"1468001795999","","YOUR NAME" +"1468001796009","","YOUR NAME" +"1468001796023","","YOUR NAME" +"1468001796035","qplot(carat, data = diamonds, geom = density)","YOUR NAME" +"1468001797042","","YOUR NAME" +"1468001797053","qplot(carat, data = diamonds, geom = histogram)","YOUR NAME" +"1468001797917","","YOUR NAME" +"1468001797924","","YOUR NAME" +"1468001797932","qplot(carat, data = diamonds, geom = histogram, binwidth = 1)","YOUR NAME" +"1468001798612","qplot(carat, data = diamonds, geom = histogram, binwidth = .1)","YOUR NAME" +"1468001799646","qplot(carat, data = diamonds, geom = histogram, binwidth = .01)","YOUR NAME" +"1468001801343","","YOUR NAME" +"1468001801357","qplot(carat, data = diamonds, geom = density, color = color)","YOUR NAME" +"1468001803117","","YOUR NAME" +"1468001803132","qplot(carat, data = diamonds, geom = histogram, fill = color)","YOUR NAME" +"1468001805407","","YOUR NAME" +"1468001805421","","YOUR NAME" +"1468001805436","","YOUR NAME" +"1468001805453","","YOUR NAME" +"1468001805467","","YOUR NAME" +"1468001806770","qplot(color, data = diamonds, geom = bar)","YOUR NAME" +"1468001807616","","YOUR NAME" +"1468001807631","(tab1 <- table(diamonds$color))","YOUR NAME" +"1468001807659","","YOUR NAME" +"1468001807676","qplot(levels(diamonds$color), geom = bar,","YOUR NAME" +"1468001808497","weight = as.numeric(tab1), xlab = color)","YOUR NAME" +"1468001809234","","YOUR NAME" +"1468001810120","","YOUR NAME" +"1468001810136","","YOUR NAME" +"1468001810151","","YOUR NAME" +"1468001810169","","YOUR NAME" +"1468001810185","?economics","YOUR NAME" +"1468001810708","str(economics)","YOUR NAME" +"1468001810864","data(economics)","YOUR NAME" +"1468001811152","","YOUR NAME" +"1468001811234","qplot(date, unemploy / pop, data = economics, geom = line,","YOUR NAME" +"1468001811251","ylab = Unemployment Rate)","YOUR NAME" +"1468001812088","","YOUR NAME" +"1468001812106","qplot(date, uempmed, data = economics, geom = line,","YOUR NAME" +"1468001812130","ylab = Median Number of Weeks Unemployed)","YOUR NAME" +"1468001813692","","YOUR NAME" +"1468001813710","","YOUR NAME" +"1468001813726","","YOUR NAME" +"1468001814543","","YOUR NAME" +"1468001814557","","YOUR NAME" +"1468001814570","","YOUR NAME" +"1468001814591","","YOUR NAME" +"1468001814607","","YOUR NAME" +"1468001814626","","YOUR NAME" +"1468001814642","","YOUR NAME" +"1468001814660","","YOUR NAME" +"1468001814677","qplot(carat, data = diamonds, facets = color ~ .,","YOUR NAME" +"1468001814695","geom = histogram, binwidth = .1, xlim = c(0,3))","YOUR NAME" +"1468001818151","","YOUR NAME" +"1468001818165","qplot(carat, data = diamonds, facets = . ~ color,","YOUR NAME" +"1468001818180","geom = histogram, binwidth = .1, xlim = c(0,3))","YOUR NAME" +"1468001822355","","YOUR NAME" +"1468001822367","","YOUR NAME" +"1468001822382","qplot(carat, data = diamonds, facets = color ~ cut,","YOUR NAME" +"1468001822398","geom = histogram, binwidth = .1, xlim = c(0,3))","YOUR NAME" +"1468001829559","","YOUR NAME" +"1468001829574","qplot(carat, ..density.., data = diamonds, facets = color ~ .,","YOUR NAME" +"1468001829589","geom = histogram, binwidth = .1, xlim = c(0,3))","YOUR NAME" +"1468001833290","","YOUR NAME" +"1468001833304","q1 <- qplot(carat, price, facets = color ~ ., data = diamonds)","YOUR NAME" +"1468001833329","","YOUR NAME" +"1468001833345","q1 + stat_smooth(method = lm,","YOUR NAME" +"1468001833361","formula = y ~ ns(x, 5))","YOUR NAME" +"1468001843465","","YOUR NAME" +"1468001843479","","YOUR NAME" +"1468001843493","","YOUR NAME" +"1468001854862","","YOUR NAME" +"1468001854877","","YOUR NAME" +"1468001854900","","YOUR NAME" +"1468001854918","","YOUR NAME" +"1468001854936","","YOUR NAME" +"1468001854954","","YOUR NAME" +"1468001854972","","YOUR NAME" +"1468001854990","","YOUR NAME" +"1468001855015","","YOUR NAME" +"1468001855234","","YOUR NAME" +"1468001855251","","YOUR NAME" +"1468001855269","","YOUR NAME" +"1468001855285","","YOUR NAME" +"1468001855299","","YOUR NAME" +"1468001855313","(p <- ggplot(diamonds, aes(carat, price)))","YOUR NAME" +"1468001856126","","YOUR NAME" +"1468001856143","","YOUR NAME" +"1468001856158","","YOUR NAME" +"1468001856172","","YOUR NAME" +"1468001856188","","YOUR NAME" +"1468001857018","","YOUR NAME" +"1468001857034","","YOUR NAME" +"1468001857051","","YOUR NAME" +"1468001857066","p + layer(geom = point, stat = identity, position = identity)","YOUR NAME" +"1468001862920","","YOUR NAME" +"1468001862935","","YOUR NAME" +"1468001862952","","YOUR NAME" +"1468001873546","p + layer(geom = point, stat = identity, position = identity) +","YOUR NAME" +"1468001873562","facet_wrap( ~ cut)","YOUR NAME" +"1468001879889","","YOUR NAME" +"1468001879905","p + layer(geom = point, stat = identity, position = identity) +","YOUR NAME" +"1468001879923","facet_wrap( ~ cut) + geom_point(aes(color = cut))","YOUR NAME" +"1468001901680","","YOUR NAME" +"1468001901694","p + layer(geom = point, stat = identity, position = identity) +","YOUR NAME" +"1468001901707","facet_wrap( ~ cut) + geom_point(aes(color = color))","YOUR NAME" +"1468001916688","","YOUR NAME" +"1468001916706","","YOUR NAME" +"1468001916724","","YOUR NAME" +"1468001916744","","YOUR NAME" +"1468001916764","","YOUR NAME" +"1468001936736","","YOUR NAME" +"1468001936752","","YOUR NAME" +"1468001936769","","YOUR NAME" +"1468001936786","","YOUR NAME" +"1468001936803","","YOUR NAME" +"1468001936821","","YOUR NAME" +"1468001936845","","YOUR NAME" +"1468001936864","","YOUR NAME" +"1468001936882","","YOUR NAME" +"1468001936904","","YOUR NAME" +"1468001937081","","YOUR NAME" +"1468001937098","","YOUR NAME" +"1468001937117","","YOUR NAME" +"1468001937133","p2 <- ggplot(diamonds, aes(x = carat))","YOUR NAME" +"1468001937152","p2 <- p2 + layer(","YOUR NAME" +"1468001937168","geom = bar,","YOUR NAME" +"1468001937187","stat = bin,","YOUR NAME" +"1468001937203","params = list(binwidth = .2, fill = steelblue),","YOUR NAME" +"1468001937221","position = identity","YOUR NAME" +"1468193627050","is.data.frame(Sex.and.Years.Worked.As.Dispatcher)","YOUR NAME" +"1468193627940","df <- data.frame(Sex.and.Years.Worked.As.Dispatcher)","YOUR NAME" +"1468193628899","is.data.frame(df)","YOUR NAME" +"1468193641167","plot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher ~ Sex.and.Years.Worked.As.Dispatcher$Sex ,","YOUR NAME" +"1468193642879","data = df, ylab = Total Years as Dispatcher,","YOUR NAME" +"1468193643626","xlab = Sex (1 = male, 2 = female), main = Sex and Years Worked as a Dispatcher)","YOUR NAME" +"1468193661656","library(ggplot2)","YOUR NAME" +"1468193662752","(s1 <- ggplot(data = Shift, aes(x = Shift$2V2, y = Shift$1V1)) +","YOUR NAME" +"1468193665598","theme(text = element_text(size=20)) )","YOUR NAME" +"1468193666250","(s1 <- ggplot(data = Shift, aes(x =Shift$V2, y = Shift$V1)) +","YOUR NAME" +"1468193666849","theme(text = element_text(size = 20))","YOUR NAME" +"1468193667968","(s2 <- s1 + geom_point(aes(col = dose)))","YOUR NAME" +"1468193668813","(s2 <- s1 + geom_point(aes(col = YearsDependents$Number.of.dependents)))","YOUR NAME" +"1468193669407","fit2 <- aov( Shift$V2 ~ Shift$V1 + YearsDependents$Number.of.dependents)","YOUR NAME" +"1468193671096","fit2 <- aov(weight ~ gesttime + dose)","YOUR NAME" +"1468193671800","summary(fit2)","YOUR NAME" +"1468193682908","contrasts(dataname$factorvariable)=contr.poly(","YOUR NAME" +"1468193683562","contrasts(Shift$V2) = contr.poly(4)","YOUR NAME" +"1468193684294","model.1=aov(dv~covariate+factorvariable, data=dataname)","YOUR NAME" +"1468193685529","model.1=aov(Shift, data = df)","YOUR NAME" +"1468193686568","Anova(model.1, type=III)","YOUR NAME" +"1468193807314","bartlett.test(Shift$V2 ~ Shift$V1, data = Shift)","YOUR NAME" +"1468193875155","barplot(tab2, beside = FALSE,","YOUR NAME" +"1468193875908","xlab = Shift Type (1-3),","YOUR NAME" +"1468193876905","ylab = Aggredate Dispatcher Responses,","YOUR NAME" +"1468193877813","col = c(blue1, green1, orange1, red1))","YOUR NAME" +"1468193878949","legend(x = .45, y = 150, legend = rownames(tab2),","YOUR NAME" +"1468193880470","fill = c(blue1, green1, orange1, red1),","YOUR NAME" +"1468193881346","bg = white)","YOUR NAME" +"1468193884233","barplot(tab2, beside = TRUE,","YOUR NAME" +"1468193884939","xlab = Shift Type (1-3),","YOUR NAME" +"1468193885376","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468193885844","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1468193886290","main = Distribution Of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1468193887002","legend(x = 13, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1468193887624","fill = c(blue1, green1, orange1, red1))","YOUR NAME" +"1468193893973","barplot(tab2, beside = TRUE,","YOUR NAME" +"1468193894656","xlab = Discipline,","YOUR NAME" +"1468193895156","ylab = Frequency,","YOUR NAME" +"1468193895717","col = c(gray30, gray75, gray90),","YOUR NAME" +"1468193896906","main = Rank by Discipline)","YOUR NAME" +"1468193897668","legend(x = 1.2, y = 100, legend = rownames(tab2),","YOUR NAME" +"1468263229483","View(ShifTypeyes)","YOUR NAME" +"1468263426851","View(ShifTypeyes)","YOUR NAME" +"1468263885029","","YOUR NAME" +"1468264047303","`ShifTypeyes.(2)` <- read.delim(C:/Users/Ben/Downloads/ShifTypeyes (2).txt, header=FALSE)","YOUR NAME" +"1468264047329","View(`ShifTypeyes.(2)`)","YOUR NAME" +"1468264461499","View(`ShifTypeyes.(2)`)","YOUR NAME" +"1468264675035","ShifTypeyes <- read.delim(C:/Users/Ben/Downloads/ShifTypeyes.txt, header=FALSE)","YOUR NAME" +"1468264675060","View(ShifTypeyes)","YOUR NAME" +"1468264829062","t.test(ShifTypeyes$V1, ShifTypeyes$V2, mu = 0,","YOUR NAME" +"1468264829844","alt = two.sided, conf=0.95, var.equal = F, paired = F)","YOUR NAME" +"1468265113451","t.test(ShifTypeyes$V1, ShifTypeyes$V3, mu = 0,","YOUR NAME" +"1468265114306","alt = two.sided, conf=0.95, var.equal = F, paired = F)","YOUR NAME" +"1468265271216","t.test(ShifTypeyes$V2, ShifTypeyes$V3, mu = 0,","YOUR NAME" +"1468265272092","alt = two.sided, conf=0.95, var.equal = F, paired = F)","YOUR NAME" +"1468269655844","Sex.and.Years.Worked.As.Dispatcher <- read.delim(~/Sex and Years Worked As Dispatcher.txt)","YOUR NAME" +"1468269655871","View(Sex.and.Years.Worked.As.Dispatcher)","YOUR NAME" +"1468269767812","Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher","YOUR NAME" +"1468269858313","hist(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher)","YOUR NAME" +"1468270998014","qplot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher, geom =histogram)","YOUR NAME" +"1468271012923","ggplot2","YOUR NAME" +"","","YOUR NAME" +"1468271019172","ggplot2","YOUR NAME" +"1468271025954","qplot(carat, data = diamonds, geom = histogram)","YOUR NAME" +"1468271069158","library(ggplot2)","YOUR NAME" +"1468271088123","qplot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher, geom =histogram)","YOUR NAME" +"1468271654918","hist(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher,","YOUR NAME" +"1468271656410","xlab = Total Years Worked","YOUR NAME" +"1468271657154","ylab = Number of Dispatchers","YOUR NAME" +"1468271690439","hist(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher,","YOUR NAME" +"1468271691065","xlab = Total Years Worked","YOUR NAME" +"1468271691791","ylab = Number of Dispatchers","YOUR NAME" +"1468271695565","main = Total Years as a Dispatcher)","YOUR NAME" +"1468271716937","hist(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher,","YOUR NAME" +"1468271717597","xlab = Total Years Worked,","YOUR NAME" +"1468271718812","ylab = Number of Dispatchers,","YOUR NAME" +"1468271719658","main = Total Years as a Dispatcher)","YOUR NAME" +"1468271789064","hist(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher,","YOUR NAME" +"1468271789702","xlab = Total Years Worked,","YOUR NAME" +"1468271794379","ylab = Number of Dispatchers,","YOUR NAME" +"1468271797062","main = Distribution of Years Worked by Dispatcher)","YOUR NAME" +"1468272484916","qplot(Sex.and.Years.Worked.As.Dispatcher)","YOUR NAME" +"1468272526282","qplot(Sex.and.Years.Worked.As.Dispatcher geom = barplot)","YOUR NAME" +"1468272708749","tab1<-Sex.and.Years.Worked.As.Dispatcher","YOUR NAME" +"1468273079841","tab1<-Sex.and.Years.Worked.As.Dispatcher","YOUR NAME" +"1468273081092","barplot(tab1, beside = TRUE,","YOUR NAME" +"1468273082093","xlab = Sex,","YOUR NAME" +"1468273084500","ylab = Years Worked by Dispatcher,","YOUR NAME" +"1468273087657","col = c(blue1, pink1),","YOUR NAME" +"1468273088908","main = Sex and Years Worked by a Dispatcher)","YOUR NAME" +"1468273307628","tab3<-Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher","YOUR NAME" +"1468273337064","barplot(tab1,tab3, beside = TRUE,","YOUR NAME" +"1468273338024","xlab = Sex,","YOUR NAME" +"1468273338842","ylab = Years Worked by Dispatcher,","YOUR NAME" +"1468273340408","col = c(blue1, pink1),","YOUR NAME" +"1468273341281","main = Sex and Years Worked by a Dispatcher)","YOUR NAME" +"1468275822171","tab1<-Sex.and.Years.Worked.As.Dispatcher$Sex, Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher","YOUR NAME" +"1468275994857","tab1<-Sex.and.Years.Worked.As.Dispatcher","YOUR NAME" +"1468276008077","barplot(tab1, beside = TRUE,","YOUR NAME" +"1468276008985","xlab = Sex,","YOUR NAME" +"1468276009797","ylab = Years Worked by Dispatcher,","YOUR NAME" +"1468276010685","col = c(blue1, pink1),","YOUR NAME" +"1468276011639","main = Sex and Years Worked by a Dispatcher)","YOUR NAME" +"1468276118014","barplot(tab1, beside = TRUE,","YOUR NAME" +"1468276119110","xlab = Sex,","YOUR NAME" +"1468276119826","ylab = Years Worked by Dispatcher,","YOUR NAME" +"1468276120608","main = Sex and Years Worked by a Dispatcher)","YOUR NAME" +"1468276246766","barplot(height = tab1, beside = TRUE,","YOUR NAME" +"1468276247609","xlab = Sex,","YOUR NAME" +"1468276248141","ylab = Years Worked by Dispatcher,","YOUR NAME" +"1468276248580","main = Sex and Years Worked by a Dispatcher)","YOUR NAME" +"1468277420797","labs(x = Sex, y = Dispatcher Years)","YOUR NAME" +"1468277430907","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468277435625","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =poop)+","YOUR NAME" +"1468277436435","labs(x = Sex, y = Dispatcher Years)","YOUR NAME" +"1468277451970","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468277452782","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468277453407","labs(x = Sex, y = Dispatcher Years)","YOUR NAME" +"1468277902858","qplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468277903577","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468277904354","labs(x = Sex, y = Dispatcher Years)","YOUR NAME" +"1468277911171","qplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468277911954","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468277912701","labs(x = Sex, y = Dispatcher Years)","YOUR NAME" +"1468277913241","library(ggplot2)","YOUR NAME" +"1468277921912","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468277922780","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468277923662","labs(x = Sex, y = Dispatcher Years)","YOUR NAME" +"1468346867364","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468346867982","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468346868500","labs(x = Sex, y = Dispatcher Years)+ main(Hello World)","YOUR NAME" +"1468347111890","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468347112674","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468347113546","labs(x = Sex, y = Dispatcher Years)+ ggtitle(Hello World)","YOUR NAME" +"1468347195326","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468347196204","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468347197176","labs(x = Sex, y = Dispatcher Years)+ ggtitle(Number of Years a Dispatcher Worked and the Sex)","YOUR NAME" +"1468347214738","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468347215420","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468347216108","labs(x = Sex, y = Dispatcher Years)+ ggtitle(Number of Years a Dispatcher Worked by Sex Type)","YOUR NAME" +"1468347440047","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468347440645","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468347441422","labs(x = Sex, y = Dispatcher Years)+ ggtitle(Number of Years a Dispatcher Worked by Sex Type)+","YOUR NAME" +"1468347442204","colours(x=blue1)","YOUR NAME" +"1468347452654","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468347453154","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468347453627","labs(x = Sex, y = Dispatcher Years)+ ggtitle(Number of Years a Dispatcher Worked by Sex Type)+","YOUR NAME" +"1468347454061","colours(blue1)","YOUR NAME" +"1468347460665","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468347460839","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468347461126","labs(x = Sex, y = Dispatcher Years)+ ggtitle(Number of Years a Dispatcher Worked by Sex Type)+","YOUR NAME" +"1468347461447","colours(blue)","YOUR NAME" +"1468347894508","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468347895111","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468347895439","labs(x = Sex, y = Dispatcher Years)+ ggtitle(Number of Years a Dispatcher Worked by Sex Type)+","YOUR NAME" +"1468347895723","colours= Sex.and.Years.Worked.As.Dispatcher$Sex)","YOUR NAME" +"1468347896154","library(ggplot2)","YOUR NAME" +"1468351591595","barplot(Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468351592359","xlab = sex","YOUR NAME" +"1468351593202","ylab = Number of Dispatchers","YOUR NAME" +"1468351606323","barplot(Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468351607140","xlab = sex,","YOUR NAME" +"1468351608062","ylab = Number of Dispatchers,","YOUR NAME" +"1468351608967","main = Number of Dispatchers for each Sex","YOUR NAME" +"1468351647198","barplot(Sex.and.Years.Worked.As.Dispatcher$Sex, beside = TRUE","YOUR NAME" +"1468351647878","xlab = sex,","YOUR NAME" +"1468351649043","ylab = Number of Dispatchers,","YOUR NAME" +"1468351697904","tab4<- Sex.and.Years.Worked.As.Dispatcher$Sex","YOUR NAME" +"1468351718846","barplot(tab4, beside = TRUE","YOUR NAME" +"1468351719649","xlab = Sex,","YOUR NAME" +"1468351731257","barplot(tab4, beside = TRUE,","YOUR NAME" +"1468351732219","xlab = Sex,","YOUR NAME" +"1468351733011","ylab = Number of Dispatchers,","YOUR NAME" +"1468351735832","main = Number of Dispatchers for each Sex","YOUR NAME" +"1468351741887",")","YOUR NAME" +"1468353107005","barplot(tab4, beside = FALSE,","YOUR NAME" +"1468353107748","xlab = Sex,","YOUR NAME" +"1468353108471","ylab = Number of Dispatchers,","YOUR NAME" +"1468353108968","main = Number of Dispatchers for each Sex","YOUR NAME" +"1468353110061",")","YOUR NAME" +"1468353116948",")","YOUR NAME" +"1468370656954","MTA1 <- read.delim(~/MTA1.txt)","YOUR NAME" +"1468370657038","View(MTA1)","YOUR NAME" +"1468370744873","plots(MTA1$Number.of.Years.Worked,MTA1$Number.ofSick.Days)","YOUR NAME" +"1468370750742","plots(MTA1$Number.of.Years.Worked,MTA1$Number.ofSick.Days)","YOUR NAME" +"1468370761201","plot(MTA1$Number.of.Years.Worked,MTA1$Number.ofSick.Days)","YOUR NAME" +"1468370809054","plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked)","YOUR NAME" +"1468370894902","plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked)","YOUR NAME" +"1468371001632","plot(MTA1$Number.ofSick.Days,MTA1$Number.of.dependents )","YOUR NAME" +"1468371070393","plot(MTA1$Number.of.Years.Worked, MTA1$Number.of.dependents)","YOUR NAME" +"1468371807059","pairs(~MTA1$Number.of.Years.Worked+MTA1$Number.of.dependents+MTA1$Number.ofSick.Days+MTA1$Average.Days.Worked)","YOUR NAME" +"1468372439772","fit <-(MTA1$Number.ofSick.Days~ MTA1Number.ofYears.Worked + MTA1$Number.of.dependents+","YOUR NAME" +"1468372441096","MTA1$Average.Days.Worked, data=mydata)","YOUR NAME" +"1468372523545","fit <-(MTA1$Number.ofSick.Days ~ MTA1Number.ofYears.Worked + MTA1$Number.of.dependents+","YOUR NAME" +"1468372524330","MTA1$Average.Days.Worked, data = MTA1)","YOUR NAME" +"1468372613002","fit <-(MTA1$Number.ofSick.Days ~ MTA1Number.ofYears.Worked + MTA1$Number.of.dependents+","YOUR NAME" +"1468372613421","MTA1$Average.Days.Worked, data = MTA1)","YOUR NAME" +"1468372622826","fit <-(MTA1$Number.ofSick.Days ~ MTA1Number.ofYears.Worked + MTA1$Number.of.dependents+","YOUR NAME" +"1468372623548","MTA1$Average.Days.Worked data = MTA1)","YOUR NAME" +"1468372658234","fit <-(MTA1$Number.ofSick.Days ~ MTA1Number.ofYears.Worked + MTA1$Number.of.dependents+","YOUR NAME" +"1468372658959","MTA1$Average.Days.Worked)","YOUR NAME" +"1468372679808","summary(fit)","YOUR NAME" +"1468372723165","fit <-(MTA1$Number.ofSick.Days ~ MTA1Number.ofYears.Worked + MTA1$Number.of.dependents+","YOUR NAME" +"1468372723998","MTA1$Average.Days.Worked, data = mydata)","YOUR NAME" +"1468373136128","lm1 <- lm(MTA1$Number.ofSick.Days ~ MTA1Number.ofYears.Worked + MTA1$Number.of.dependents+","YOUR NAME" +"1468373136934","MTA1$Average.Days.Worked, data = df )","YOUR NAME" +"1468373193696","lm1 <- lm(MTA1$Number.ofSick.Days ~ MTA1Number.ofYears.Worked + MTA1$Number.of.dependents+","YOUR NAME" +"1468373194348","MTA1$Average.Days.Worked, MTA1 = df )","YOUR NAME" +"1468373216385","lm1 <- lm(MTA1$Number.ofSick.Days ~ MTA1$Number.of.Years.Worked + MTA1$Number.of.dependents+","YOUR NAME" +"1468373218195","MTA1$Average.Days.Worked, MTA1 = df )","YOUR NAME" +"1468373247437","(lm1)","YOUR NAME" +"1468444943882","lm5 <- lm(MTA1$Number.of.Years.Worked) ~ MTA1$Number.of.dependents, data = df)","YOUR NAME" +"1468444963452","lm5 <- lm(MTA1$Number.of.Years.Worked ~ MTA1$Number.of.dependents, data = df)","YOUR NAME" +"1468444986093","lm5 <- lm(MTA1$Number.of.Years.Worked ~ MTA1$Number.of.dependents, MTA1 = df)","YOUR NAME" +"1468444992922","summary(lm5)","YOUR NAME" +"1468445345330","lm1 <- lm(MTA1$Number.of.Years.Worked ~ MTA1$Number.ofSick.Days + MTA1$Number.of.dependents+","YOUR NAME" +"1468445346147","MTA1$Average.Days.Worked, MTA1 = df )","YOUR NAME" +"1468445361820","summary(lm1)","YOUR NAME" +"1468445585518","lm1 <- lm(MTA1$Number.of.Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex+","YOUR NAME" +"1468445586593","MTA1$Number.ofSick.Days + MTA1$Number.of.dependents+","YOUR NAME" +"1468445587619","MTA1$Average.Days.Worked, MTA1, Sex.and.Years.Worked.As.Dispatcher = df )","YOUR NAME" +"1468445593984","lm5 <- lm(MTA1$Number.of.Years.Worked ~ MTA1$Number.of.dependents, MTA1 = df)","YOUR NAME" +"1468445599916","summary(lm1)","YOUR NAME" +"1468448617674","MTA1 <- read.delim(~/MTA1.txt)","YOUR NAME" +"1468448617776","View(MTA1)","YOUR NAME" +"1468448633478","Sex.and.Years.Worked.As.Dispatcher <- read.delim(~/Sex and Years Worked As Dispatcher.txt)","YOUR NAME" +"1468448633494","View(Sex.and.Years.Worked.As.Dispatcher)","YOUR NAME" +"1468448722977","lm6 <- lm(MTA1$Number.of Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468448723735","MTA1, Sex.and.Years.Worked.As.Dispatcher = df)","YOUR NAME" +"1468448748634","lm6 <- lm(MTA1$Number.of Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468448749446","MTA1 + Sex.and.Years.Worked.As.Dispatcher = df)","YOUR NAME" +"1468448780134","lm6 <- lm(MTA1$Number.of.Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468448782042","MTA1 + Sex.and.Years.Worked.As.Dispatcher = df)","YOUR NAME" +"1468448807198","lm6 <- lm(MTA1$Number.of.Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468448807853","MTA1 = df)","YOUR NAME" +"1468448812506","summary(lm6)","YOUR NAME" +"1468458525806","crPlots(lm6)","YOUR NAME" +"1468458527001","","YOUR NAME" +"1468458601712","lm1 <- lm(MTA1$Number.of.Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex+","YOUR NAME" +"1468458602808","MTA1$Number.ofSick.Days + MTA1$Number.of.dependents+","YOUR NAME" +"1468458603993","MTA1$Average.Days.Worked, MTA1, Sex.and.Years.Worked.As.Dispatcher = df )","YOUR NAME" +"1468458637399","crPlots(lm1)","YOUR NAME" +"1468458662681","crPlots(lm6)","YOUR NAME" +"1468458664006","crPlots(lm1)","YOUR NAME" +"1468458679914","help(crPlots)","YOUR NAME" +"1468458813118","Plots(lm6)","YOUR NAME" +"1468458822531","plot(lm6)","YOUR NAME" +"1468458872586","plot(lm6)","YOUR NAME" +"1468458999469","range(sresid)","YOUR NAME" +"1468459012840","xfit <- seq(-3, 3, length = 100)","YOUR NAME" +"1468459013843","yfit <- dnorm(xfit, mean = mean(sresid), sd = sd(sresid))","YOUR NAME" +"1468459017340","lines(xfit, yfit, col = orange, lwd = 3)","YOUR NAME" +"1468459019822","","YOUR NAME" +"1468459022433","qqPlot(lm3)","YOUR NAME" +"1468459039870","qqPlot(lm6)","YOUR NAME" +"1468459058151","library(ggplot2)","YOUR NAME" +"1468459115023","qqPlot(lm6)","YOUR NAME" +"1468459237781","qqnorm(lm6)","YOUR NAME" +"1468459261030","qqnorm(lm1)","YOUR NAME" +"1468459496652","qqplot(lm1)","YOUR NAME" +"1468459574055","qqnorm(MTA1$Number.of.Years.Worked)","YOUR NAME" +"1468459580852","","YOUR NAME" +"1468459656183","qqnorm(MTA1$Number.of.Years.Worked)","YOUR NAME" +"1468459659619","qqnorm(MTA1$Number.of.Years.Worked)","YOUR NAME" +"1468459725968","qqplot(lm1)","YOUR NAME" +"1468461201992","Residual = resid(lm1)","YOUR NAME" +"1468461220526","spreadLevelPlot(lm3)","YOUR NAME" +"1468461222092","Residual = resid(lm1)","YOUR NAME" +"1468461222841","qqnorm(MTA1$Number.of.Years.Worked)","YOUR NAME" +"1468461227530","qqplot(lm1)","YOUR NAME" +"1468461244721","Residual","YOUR NAME" +"1468461283967","Residual2 = resid(lm6)","YOUR NAME" +"1468461295905","Residual2","YOUR NAME" +"1468461332716","qqnnorm(Residual)","YOUR NAME" +"1468461342030","qqnorm(Residual)","YOUR NAME" +"1468461364155","qqnorm(Residual2)","YOUR NAME" +"1468461372278","qqnorm(Residual)","YOUR NAME" +"1468461377555","qqnorm(Residual2)","YOUR NAME" +"1468461413477","qqnorm(MTA1$Number.of.Years.Worked)","YOUR NAME" +"1468461438307","qqnorm(MTA1$Number.of.Years.Worked, Sex.and.Years.Worked.As.Dispatcher$Sex)","YOUR NAME" +"1468461561930","sresid <-(lm6)","YOUR NAME" +"1468461562527","hist(sresid, freq = FALSE, 25)","YOUR NAME" +"1468461563652","lines(density(sresid), col = blue, lwd = 3)","YOUR NAME" +"1468461568461","range(sresid)","YOUR NAME" +"1468461568821","xfit <- seq(-3, 3, length = 100)","YOUR NAME" +"1468461569129","yfit <- dnorm(xfit, mean = mean(sresid), sd = sd(sresid))","YOUR NAME" +"1468461569527","lines(xfit, yfit, col = orange, lwd = 3)","YOUR NAME" +"1468461604999","sresid <-(Residual)","YOUR NAME" +"1468461605869","hist(sresid, freq = FALSE, 25)","YOUR NAME" +"1468461606680","lines(density(sresid), col = blue, lwd = 3)","YOUR NAME" +"1468461615497","range(sresid)","YOUR NAME" +"1468461616593","xfit <- seq(-3, 3, length = 100)","YOUR NAME" +"1468461617369","yfit <- dnorm(xfit, mean = mean(sresid), sd = sd(sresid))","YOUR NAME" +"1468461618151","lines(xfit, yfit, col = orange, lwd = 3)","YOUR NAME" +"1468461628559","sresid <-(Residual)","YOUR NAME" +"1468461629556","hist(sresid, freq = FALSE, 25)","YOUR NAME" +"1468461630403","lines(density(sresid), col = blue, lwd = 3)","YOUR NAME" +"1468461634215","range(sresid)","YOUR NAME" +"1468461717469","mresid<-(Residual2)","YOUR NAME" +"1468461718094","hist(mresid, freq = FALSE, 25)","YOUR NAME" +"1468461718996","lines(density(mresid), col = blue, lwd = 3)","YOUR NAME" +"1468461720369","range(mresid)","YOUR NAME" +"1468461819189","mresid<-(Residual2)","YOUR NAME" +"1468461819779","hist(mresid, freq = FALSE, 25)","YOUR NAME" +"1468461820346","lines(density(mresid), col = green, lwd = 3)","YOUR NAME" +"1468461821493","range(mresid)","YOUR NAME" +"1468461933841","mresid<-(lm1)","YOUR NAME" +"1468461934748","hist(lm1, freq = FALSE, 25)","YOUR NAME" +"1468461935580","lines(density(lm1), col = green, lwd = 3)","YOUR NAME" +"1468461937045","range(lm1)","YOUR NAME" +"1468461957368","mresid<-(lm1)","YOUR NAME" +"1468461957813","hist(lm1, freq = TRUE, 25)","YOUR NAME" +"1468461958150","lines(density(lm1), col = green, lwd = 3)","YOUR NAME" +"1468461958421","range(lm1)","YOUR NAME" +"1468461974965","mresid<-(Residual2)","YOUR NAME" +"1468461975622","hist(mresid, freq = TRUE, 25)","YOUR NAME" +"1468461977113","lines(density(mresid), col = green, lwd = 3)","YOUR NAME" +"1468461978211","range(mresid)","YOUR NAME" +"1468461995534","mresid<-(Residual2)","YOUR NAME" +"1468461996117","hist(mresid, freq = FALSE, 10)","YOUR NAME" +"1468461997278","lines(density(mresid), col = green, lwd = 3)","YOUR NAME" +"1468462026024","sresid <-(Residual)","YOUR NAME" +"1468462027185","hist(sresid, freq = FALSE, 20)","YOUR NAME" +"1468462027901","lines(density(sresid), col = blue, lwd = 3)","YOUR NAME" +"1468462028528","range(sresid)","YOUR NAME" +"1468462030555","mresid<-(Residual2)","YOUR NAME" +"1468462031434","hist(mresid, freq = FALSE, 20)","YOUR NAME" +"1468462031969","lines(density(mresid), col = green, lwd = 3)","YOUR NAME" +"1468462032742","range(mresid)","YOUR NAME" +"1468462245844","mresid<-(Residual2)","YOUR NAME" +"1468462246431","hist(mresid, freq = FALSE, 20)","YOUR NAME" +"1468462249025","lines(density(mresid), col = green, lwd = 3","YOUR NAME" +"1468462249777","main = Residuals of Multiple Regression)","YOUR NAME" +"1468462263655","mresid<-(Residual2)","YOUR NAME" +"1468462264335","hist(mresid, freq = FALSE, 20)","YOUR NAME" +"1468462264957","lines(density(mresid), col = green, lwd = 3,","YOUR NAME" +"1468462265555","main = Residuals of Multiple Regression)","YOUR NAME" +"1468462271619","range(mresid)","YOUR NAME" +"1468463314055","plot(lm1)","YOUR NAME" +"1468463448337","qqnorm(lm1)","YOUR NAME" +"1468463455313","plot(lm1)","YOUR NAME" +"1468463564543","plot(lm6)","YOUR NAME" +"1468463748762","qqnorm(lm1)","YOUR NAME" +"1468463753010","qqnorm(lm1)","YOUR NAME" +"1468463757170","qqnorm(lm1)","YOUR NAME" +"1468463762257","plot(lm1)","YOUR NAME" +"1468463798011","qqnorm(lm1)","YOUR NAME" +"1468463814982","plot(lm6)","YOUR NAME" +"1468463868120","plot(lm6)","YOUR NAME" +"1468464581014","Residual2 = resid(lm6)","YOUR NAME" +"1468464582353","Residual2","YOUR NAME" +"1468464601698","Residual = resid(lm1)","YOUR NAME" +"1468464602447","Residual","YOUR NAME" +"1468464606763","Residual2 = resid(lm6)","YOUR NAME" +"1468464607293","Residual2","YOUR NAME" +"1468464611744","qqnorm(Residual)","YOUR NAME" +"1468464620952","qqnorm(Residual2)","YOUR NAME" +"1468466742979","ncvTest(lm1)","YOUR NAME" +"1468466777439","ncv(lm1)","YOUR NAME" +"1468467601121","library(car, lib.loc=~/R/win-library/3.3)","YOUR NAME" +"1468467607018","detach(package:car, unload=TRUE)","YOUR NAME" +"1468467607035","library(car, lib.loc=~/R/win-library/3.3)","YOUR NAME" +"1468467615250","ncv(lm1)","YOUR NAME" +"1468467627594","ncvTest(lm1)","YOUR NAME" +"1468467801464","library(lmtest, lib.loc=~/R/win-library/3.3)","YOUR NAME" +"1468467821815","bptest(lm1)","YOUR NAME" +"1468467845132","bptest(lm6)","YOUR NAME" +"1468468575977","preds <- predict(lm1)","YOUR NAME" +"1468468603840","lm1","YOUR NAME" +"1468468711194","lm6","YOUR NAME" +"1468696999773","ggplot(data, aes(x=V1, y=V2)) + geom_bar(stat=identity) +","YOUR NAME" +"1468697000599","labs(x=Percentage, y=Proportion)","YOUR NAME" +"1468697003589","ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex,","YOUR NAME" +"1468697004410","y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+","YOUR NAME" +"1468697005157","labs(x = Sex, y = Dispatcher Years)+ ggtitle(Number of Years a Dispatcher Worked by Sex Type)","YOUR NAME" +"1468697112808","ggplot(geom_bar(Sex.and.Years.Worked.As.Dispatcher$Sex))","YOUR NAME" +"1468697405330","barplot(tab2, beside = TRUE,","YOUR NAME" +"1468697406852","xlab = Shift Type (1-3),","YOUR NAME" +"1468697407731","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468697408540","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1468697409384","main = Distribution Of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1468697410634","legend(x = 13, y = 1000, legend = rownames(tab2),","YOUR NAME" +"1468697411495","fill = c(blue1, green1, orange1, red1))","YOUR NAME" +"1468697449619","barplot(tab2, beside = TRUE,","YOUR NAME" +"1468697451107","xlab = Shift Type (1-3),","YOUR NAME" +"1468697452071","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468697452726","col = c(blue1, green1, orange1, red1),","YOUR NAME" +"1468697453290","main = Distribution Of Total Stress Responses For Each Shift Type )","YOUR NAME" +"1468698398484","tab4<- Sex.and.Years.Worked.As.Dispatcher$Sex","YOUR NAME" +"1468698411392","barplot(tab4, beside = FALSE,","YOUR NAME" +"1468698412324","xlab = Sex,","YOUR NAME" +"1468698413040","ylab = Number of Dispatchers,","YOUR NAME" +"1468698417226","main = Number of Dispatchers for each Sex)","YOUR NAME" +"1468698418197","col = c(blue1, pink1)","YOUR NAME" +"1468705694075","Sex <- read.csv(~/Sex.txt, sep=)","YOUR NAME" +"1468705694108","View(Sex)","YOUR NAME" +"1468705807348","tab5<- Sex","YOUR NAME" +"1468706180884","barplot(tab5, beside = TRUE,","YOUR NAME" +"1468706181634","xlab = Sex,","YOUR NAME" +"1468706182293","ylab = Number of Dispatchers,","YOUR NAME" +"1468706182949","main = poop,","YOUR NAME" +"1468706183561","col = c(blue, pink))","YOUR NAME" +"1468706201674","barplot(height = tab5, beside = TRUE,","YOUR NAME" +"1468706202510","xlab = Sex,","YOUR NAME" +"1468706203134","ylab = Number of Dispatchers,","YOUR NAME" +"1468706203634","main = poop,","YOUR NAME" +"1468706203978","col = c(blue, pink))","YOUR NAME" +"1468706204246","plot(MTA1$Number.of.Years.Worked,MTA1$Number.ofSick.Days)","YOUR NAME" +"1468706216321","barplot(height = tab5, beside = TRUE,","YOUR NAME" +"1468706217102","xlab = Sex,","YOUR NAME" +"1468706217699","ylab = Number of Dispatchers,","YOUR NAME" +"1468706218297","main = poop,","YOUR NAME" +"1468706218831","col = c(blue, pink))","YOUR NAME" +"1468706955136","barplot(tab5, beside = TRUE,","YOUR NAME" +"1468706955821","xlab = Sex,","YOUR NAME" +"1468706956696","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468706957230","col = c(blue1, pink1),","YOUR NAME" +"1468706957759","main = Distribution of Sex)","YOUR NAME" +"1468706958324","legend(x =13, y = 100, legend = rownames(tab5),","YOUR NAME" +"1468706962135","fill = c(blue1, pink1))","YOUR NAME" +"1468706987634","barplot(tab5, beside = TRUE,","YOUR NAME" +"1468706988229","xlab = Sex,","YOUR NAME" +"1468706988656","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468706989136","col = c(blue1, pink1),","YOUR NAME" +"1468706989504","main = Distribution of Sex)","YOUR NAME" +"1468706992164","legend(x =13, y = 100, legend = rownames(tab5),","YOUR NAME" +"1468706994383","fill = c(blue1, pink1)))","YOUR NAME" +"1468707019291","barplot(tab5, beside = TRUE,","YOUR NAME" +"1468707019925","xlab = Sex,","YOUR NAME" +"1468707020639","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468707021634","col = c(blue1, pink1),","YOUR NAME" +"1468707023824","main = Distribution of Sex))","YOUR NAME" +"1468707394044","barplot( height = tab5,","YOUR NAME" +"1468707394884","xlab = Sex,","YOUR NAME" +"1468707395511","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468707395980","col = c(blue1, pink1),","YOUR NAME" +"1468707398233","main = Distribution of Sex)","YOUR NAME" +"1468707527073","barplot( height = tab5,","YOUR NAME" +"1468707527638","xlab = Sex,","YOUR NAME" +"1468707528105","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468707528249","col = c(blue1, pink1),","YOUR NAME" +"1468707528576","main = Distribution of Sex,","YOUR NAME" +"1468707530361","horiz = TRUE)","YOUR NAME" +"1468707808761","barplot( height = tab5,","YOUR NAME" +"1468707809541","xlab = Sex,","YOUR NAME" +"1468707810008","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468707810422","col = c(blue1, pink1),","YOUR NAME" +"1468707810644","main = Distribution of Sex,","YOUR NAME" +"1468707811291","horiz = TRUE)","YOUR NAME" +"1468707911497","ggplot(Sex$Sex, + geom_bar(stat=identity) +","YOUR NAME" +"1468707912358","labs(x=Percentage, y=Proportion)","YOUR NAME" +"1468707923823","ggplot(Sex$Sex, + geom_bar(stat=identity) +","YOUR NAME" +"1468707924482","labs(x=Percentage, y=Proportion))","YOUR NAME" +"1468707937608","ggplot(Sex$Sex, + geom_bar(stat=identity) +","YOUR NAME" +"1468707938511","labs(x=Percentage, y=Proportion)","YOUR NAME" +"1468707940071","ggplot2(tab5, geom_bar","YOUR NAME" +"1468707988604","barplot( height = tab5,","YOUR NAME" +"1468707989297","xlab = Sex,","YOUR NAME" +"1468707989692","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468707990076","col = c(blue1, pink1),","YOUR NAME" +"1468707991008","main = Distribution of Sex,","YOUR NAME" +"1468707992265","horiz = TRUE)","YOUR NAME" +"1468708028543","tab5<- data.frame(Sex$Sex)","YOUR NAME" +"1468708036735","barplot( height = tab5,","YOUR NAME" +"1468708037358","xlab = Sex,","YOUR NAME" +"1468708037778","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468708038323","col = c(blue1, pink1),","YOUR NAME" +"1468708040573","main = Distribution of Sex,","YOUR NAME" +"1468708041259","horiz = TRUE)","YOUR NAME" +"1468708193259","ggplot(Sex$Sex, + geom_bar(stat=identity) +","YOUR NAME" +"1468708193914","labs(x=Percentage, y=Proportion)","YOUR NAME" +"1468708412354","Sex2 <- read.delim(~/Sex2.txt, header=FALSE)","YOUR NAME" +"1468708412369","View(Sex2)","YOUR NAME" +"1468708438233","Sex2 <- read.delim(~/Sex2.txt, header=FALSE)","YOUR NAME" +"1468708438249","View(Sex2)","YOUR NAME" +"1468708498884","ggplot(Sex2, aes(x=Sex2$V1, y=Sex2$V2)) + geom_bar(stat=identity) +","YOUR NAME" +"1468708499542","labs(x=Percentage, y=Proportion)","YOUR NAME" +"1468708916792","Sex3 <- read.delim(~/Sex3.txt, header=FALSE)","YOUR NAME" +"1468708916810","View(Sex3)","YOUR NAME" +"1468709072181","ggplot(Sex3, aes(x=Sex3$V1, y=Sex3$V2)) + geom_bar(stat = identity)+","YOUR NAME" +"1468709073572","labs(x = Sex, y = Number of Dispatchers)","YOUR NAME" +"1468709468292","barplot( height = tab6,","YOUR NAME" +"1468709469043","xlab = Sex,","YOUR NAME" +"1468709469699","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468709470667","col = c(blue1, pink1),","YOUR NAME" +"1468709472758","main = Distribution of Sex,","YOUR NAME" +"1468709474696","horiz = TRUE)","YOUR NAME" +"1468709479948","(tab6<- table(Sex3$V1, Sex3$V2))","YOUR NAME" +"1468709488360","barplot( height = tab6,","YOUR NAME" +"1468709493229","barplot( height = tab6,","YOUR NAME" +"1468709493822","xlab = Sex,","YOUR NAME" +"1468709494667","ylab = Aggregate Dispatcher Responses,","YOUR NAME" +"1468709495076","col = c(blue1, pink1),","YOUR NAME" +"1468709495547","main = Distribution of Sex,","YOUR NAME" +"1468709496104","horiz = TRUE)","YOUR NAME" +"1468709676132","(tab5<-table(Sex2$V1, Sex2$V2))","YOUR NAME" +"1468709684886","barplot(height = tab5, beside = TRUE,","YOUR NAME" +"1468709685269","xlab = Sex,","YOUR NAME" +"1468709686098","ylab = Number of Dispatchers,","YOUR NAME" +"1468709686191","main = poop,","YOUR NAME" +"1468709687112","col = c(blue, pink))","YOUR NAME" +"1468709734582","barplot(height = tab5, beside = TRUE,","YOUR NAME" +"1468709735104","xlab = Sex,","YOUR NAME" +"1468709735551","ylab = Number of Dispatchers,","YOUR NAME" +"1468709735643","main = poop,)","YOUR NAME" +"1468709745857","(tab5<-table(Sex2$V1, Sex2$V2))","YOUR NAME" +"1468709749229","barplot(height = tab5, beside = TRUE,","YOUR NAME" +"1468709749727","xlab = Sex,","YOUR NAME" +"1468709750294","main = poop,)","YOUR NAME" +"1468709750452","ylab = Number of Dispatchers,","YOUR NAME" +"1468776287238","(tab6<-table(Sex3$V1, Sex3$V2))","YOUR NAME" +"1468776296991","barplot(height = tab6, beside = TRUE,","YOUR NAME" +"1468776298828","xlab = Sex,","YOUR NAME" +"1468776299423","ylab = Number of Dispatchers,","YOUR NAME" +"1468776299839","main = Distribution of Sex for Dispatchers,)","YOUR NAME" +"1468776403925","barplot(height = tab5, beside = TRUE,","YOUR NAME" +"1468776404643","xlab = Sex,","YOUR NAME" +"1468776405052","ylab = Number of Dispatchers,","YOUR NAME" +"1468776405459","main = Distribution of Sex for Dispatchers,)","YOUR NAME" +"1468776406019","barplot(tab2, beside = TRUE,","YOUR NAME" +"1468776675653","Sex4 <- read.delim(~/Sex4.txt, header=FALSE)","YOUR NAME" +"1468776675673","View(Sex4)","YOUR NAME" +"1468776702299","(tab7<-table(Sex4$V1, Sex4$V2))","YOUR NAME" +"1468776730958","Sex4 <- read.delim(~/Sex4.txt, header=FALSE)","YOUR NAME" +"1468776730976","View(Sex4)","YOUR NAME" +"1468776752459","(tab7<-table(Sex4$V1, Sex4$V2))","YOUR NAME" +"1468776767612","barplot(height = tab7, beside = TRUE,","YOUR NAME" +"1468776768333","xlab = Sex,","YOUR NAME" +"1468776768926","ylab = Number of Dispatchers,","YOUR NAME" +"1468776769343","main = Distribution of Sex for Dispatchers,)","YOUR NAME" +"1468776948789","Sex8 <- read.table(~/Sex8.txt, quote=\"", comment.char="") +1468776948809:View(Sex8) +1468776986347:(tab8<-table(Sex8$V1)) +1468777000441:barplot(height = tab8, beside = TRUE, +1468777001375:xlab = Sex, +1468777001975:ylab = Number of Dispatchers, +1468777002442:main = Distribution of Sex for Dispatchers,) +1468777118502:barplot(height = tab8, beside = TRUE, +1468777119098:xlab = Sex, +1468777119601:ylab = Number of Dispatchers, +1468777120190:col = (blue1, pink1), +1468777120848:main = Distribution of Sex for Dispatchers,) +1468777161042:barplot(height = tab8, beside = TRUE, +1468777162065:xlab = Sex, +1468777162501:ylab = Number of Dispatchers, +1468777162907:col = (blue1, pink1), +1468777163571:main = Distribution of Sex for Dispatchers) +1468777226152:barplot(height = tab8, beside = TRUE, +1468777226848:xlab = Sex, +1468777227440:ylab = Number of Dispatchers, +1468777228414:col = c(blue1, pink1), +1468777229691:main = Distribution of Sex for Dispatchers) +1468777826041:barplot(height = tab8, beside = TRUE, +1468777826535:xlab = Sex, +1468777827035:ylab = Number of Dispatchers, +1468777827536:col = c(blue1, pink1), +1468777828004:main = Distribution of Sex for Dispatchers) +1468777828658:legend(x = 13, y = 1000, legend = rownames(tab8) +1468777829299:fill = c(blue1, pink1) +1468777845536:barplot(height = tab8, beside = TRUE, +1468777845980:xlab = Sex, +1468777846126:ylab = Number of Dispatchers, +1468777846475:col = c(blue1, pink1), +1468777847067:main = Distribution of Sex for Dispatchers) +1468777847691:legend(x = 13, y = 1000, legend = rownames(tab8), +1468777849288:fill = c(blue1, pink1) +1468777874004:barplot(height = tab8, beside = TRUE, +1468777874665:xlab = Sex, +1468777875204:ylab = Number of Dispatchers, +1468777875812:col = c(blue1, pink1), +1468777878531:main = Distribution of Sex for Dispatchers) +1468777879192:legend(x = 13, y = 1000, legend = rownames(tab8), +1468777880094:fill = c(blue1, pink1)) +1468777926417:barplot(height = tab8, beside = TRUE, +1468777927316:xlab = Sex, +1468777928065:ylab = Number of Dispatchers, +1468777928751:col = c(blue1, pink1), +1468777929350:main = Distribution of Sex for Dispatchers) +1468777930287:legend(x = 13, y = 1000, legend = rownames(tab8), +1468777932626:fill = c(blue1, pink1)) +1468777956601:barplot(height = tab8, beside = TRUE, +1468777957318:xlab = Sex, +1468777957915:ylab = Number of Dispatchers, +1468777958533:col = c(blue1, pink1), +1468777959130:main = Distribution of Sex for Dispatchers) +1468777959754:legend(x = 5, y = 1000, legend = rownames(tab8), +1468777964222:fill = c(blue1, pink1)) +1468777976719:barplot(height = tab8, beside = TRUE, +1468777977286:xlab = Sex, +1468777977877:ylab = Number of Dispatchers, +1468777978440:col = c(blue1, pink1), +1468777979001:main = Distribution of Sex for Dispatchers) +1468777979627:legend(x = 5, y = 500, legend = rownames(tab8), +1468777980238:fill = c(blue1, pink1)) +1468778018978:barplot(height = tab8, beside = TRUE, +1468778019601:xlab = Sex, +1468778020214:col = c(blue1, pink1), +1468778020345:main = Distribution of Sex for Dispatchers) +1468778020953:ylab = Number of Dispatchers, +1468778021637:legend(x = 5, y = 2000, legend = rownames(tab8), +1468778021648:fill = c(blue1, pink1)) +1468778021662:barplot(height = ) +1468778024941:barplot(tab2, beside = TRUE, +1468778038817:barplot(height = tab8, beside = TRUE, +1468778039262:xlab = Sex, +1468778039815:col = c(blue1, pink1), +1468778039867:ylab = Number of Dispatchers, +1468778040438:main = Distribution of Sex for Dispatchers) +1468778041131:legend(x = 15, y = 2000, legend = rownames(tab8), +1468778042879:fill = c(blue1, pink1)) +1468778066977:barplot(height = tab8, beside = TRUE, +1468778067442:xlab = Sex, +1468778067814:ylab = Number of Dispatchers, +1468778068218:col = c(blue1, pink1), +1468778068627:main = Distribution of Sex for Dispatchers), +1468778069224:legend(x = 8, y = 1000, legend = rownames(tab8), +1468778069786:fill = c(blue1, pink1)) +1468778156157:barplot(height = tab8, beside = TRUE, +1468778156542:xlab = Sex, +1468778157129:ylab = Number of Dispatchers, +1468778157517:col = c(blue1, pink1), +1468778158002:main = Distribution of Sex for Dispatchers), +1468778178382:barplot(height = tab8, beside = TRUE, +1468778178759:xlab = Sex, +1468778178854:ylab = Number of Dispatchers, +1468778179469:col = c(blue1, pink1), +1468778179787:main = Distribution of Sex for Dispatchers) +1468778185417:legend(x = 8, y = 1000, legend = rownames(tab8), +1468778187109:fill = c(blue1, pink1)) +1468778231158:barplot(height = tab8, beside = TRUE, +1468778231516:xlab = Sex, +1468778231938:ylab = Number of Dispatchers, +1468778232317:col = c(blue1, pink1), +1468778232816:main = Distribution of Sex for Dispatchers) +1468778233413:legend(x = 11, y = 1000, legend = rownames(tab8), +1468778233876:fill = c(blue1, pink1)) +1468778244067:barplot(height = tab8, beside = TRUE, +1468778244458:xlab = Sex, +1468778244912:ylab = Number of Dispatchers, +1468778245085:col = c(blue1, pink1), +1468778245452:main = Distribution of Sex for Dispatchers) +1468778246094:legend(x = 14, y = 1000, legend = rownames(tab8), +1468778246660:fill = c(blue1, pink1)) +1468778268872:barplot(height = tab8, beside = TRUE, +1468778269379:xlab = Sex, +1468778269827:ylab = Number of Dispatchers, +1468778270198:col = c(blue1, pink1), +1468778270298:main = Distribution of Sex for Dispatchers) +1468778270947:legend(x = 12, y = 800, legend = rownames(tab8), +1468778294288:barplot(height = tab8, beside = TRUE, +1468778294717:xlab = Sex, +1468778294815:ylab = Number of Dispatchers, +1468778295413:col = c(blue1, pink1), +1468778295610:main = Distribution of Sex for Dispatchers) +1468778295980:legend(x = 1, y = 200, legend = rownames(tab8), +1468778305288:barplot(height = tab8, beside = TRUE, +1468778305665:xlab = Sex, +1468778306033:ylab = Number of Dispatchers, +1468778306421:col = c(blue1, pink1), +1468778306517:main = Distribution of Sex for Dispatchers) +1468778307229:legend(x = 1 , y = 200, legend = rownames(tab8), +1468778307400:fill = c(blue1, pink1)) +1468778334656:barplot(height = tab8, beside = TRUE, +1468778335189:xlab = Sex, +1468778335689:ylab = Number of Dispatchers, +1468778336037:col = c(blue1, pink1), +1468778336565:main = Distribution of Sex for Dispatchers) +1468778337406:legend(x = 2 , y = 250, legend = rownames(tab8), +1468778338850:fill = c(blue1, pink1)) +1468787415223:pairs(~MTA1$Number.of.Years.Worked+MTA1$Number.of.dependents+MTA1$Number.ofSick.Days+ +1468787416068:MTA1$Average.Days.Worked) +1468787501441:pairs(~MTA1$Number.of.Years.Worked+MTA1$Number.of.dependents+MTA1$Number.ofSick.Days+ +1468787502104:MTA1$Average.Days.Worked+Sex.and.Years.Worked.As.Dispatcher$Sex) +1468787543672:pairs(~MTA1$Number.of.Years.Worked+MTA1$Number.of.dependents+MTA1$Number.ofSick.Days+ +1468787544346:MTA1$Average.Days.Worked) +1468789436005:plot(MTA1$Number.of.Years.Worked,MTA1$Number.ofSick.Days) +1468789440978:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked) +1468794774747:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468794775517:xlab = Number of Sick Days, +1468794776268:ylab = Number Average Days Worked, +1468794791675:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468794792491:xlab = Number of Sick Days, +1468794793183:ylab = Number Average Days Worked, +1468794841488:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468794842267:xlab = Number of Sick Days, +1468794842955:ylab = Number Average Days Worked, +1468794843860:main = Relationship Between Number of Sick Days and Average Days Worked, +1468794845266:abline(lm(MTA1$Number.ofSick.Days2 ~ MTA1$Average.Days.Worked)) +1468794857957:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468794858680:xlab = Number of Sick Days, +1468796478597:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468796479570:xlab = Number of Sick Days, +1468796480627:ylab = Number Average Days Worked, +1468796482129:main = Relationship Between Number of Sick Days and Average Days Worked, +1468796484346:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days2)) +1468796557264:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468796558095:xlab = Number of Sick Days, +1468796558216:ylab = Number Average Days Worked, +1468796559376:main = Relationship Between Number of Sick Days and Average Days Worked, +1468796559829:abline(lm(df.MTA1$Average.Days.Worked ~ df.MTA1$Number.ofSick.Days2)) +1468796576132:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468796576753:xlab = Number of Sick Days, +1468796577347:ylab = Number Average Days Worked, +1468796578130:main = Relationship Between Number of Sick Days and Average Days Worked, +1468796579568:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days2)) +1468796593007:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468796593782:xlab = Number of Sick Days, +1468796594413:ylab = Number Average Days Worked, +1468796596786:main = Relationship Between Number of Sick Days and Average Days Worked, +1468796597661:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days2)) +1468796614384:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468796615064:xlab = Number of Sick Days, +1468796615602:ylab = Number Average Days Worked, +1468796616190:main = Relationship Between Number of Sick Days and Average Days Worked, +1468796617006:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days)) +1468796681128:plot(MTA1$Number.of.Years.Worked,MTA1$Number.ofSick.Days) +1468796730002:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468796730832:xlab = Number of Sick Days, +1468796731690:ylab = Number Average Days Worked, +1468796732446:main = Relationship Between Number of Sick Days and Average Days Worked, +1468796734485:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days)) +1468796768082:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468796768772:xlab = Number of Sick Days, +1468796771036:ylab = Number Average Days Worked, +1468796771789:main = Relationship Between Number of Sick Days and Average Days Worked) +1468796808847:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468796809725:xlab = Number of Sick Days, +1468796810441:ylab = Average Days Worked Per Week, +1468796812318:main = Relationship Between Number of Sick Days and Average Days Worked) +1468796819221:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days)) +1468797594849:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked) +1468797799939:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468797800688:xlab = Number of dependents, +1468797801599:ylab = Average Days Worked Per Week, +1468797802348:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468797806854:abline(lm(MTA1$Number.ofSick.Days ~ MTA1$Average.Days.Worked )) +1468797846263:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468797847006:xlab = Number of dependents, +1468797847694:ylab = Average Days Worked Per Week, +1468797848316:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468797850377:abline(lm(MTA1$Number.ofSick.Days ~ MTA1$Average.Days.Worked )) +1468797881318:abline(lm(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked )) +1468797892076:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468797892648:xlab = Number of dependents, +1468797893160:ylab = Average Days Worked Per Week, +1468797893973:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468797901543:abline(lm(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked )) +1468797915666:abline(lm(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked )) +1468797964982:abline(lm(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked )) +1468797983103:abline(lm(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked)) +1468797987941:abline(lm(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked)) +1468797995663:abline(lm(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked)) +1468798004572:abline(lm(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked)) +1468798020701:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468798021471:xlab = Number of Sick Days, +1468798022313:ylab = Average Days Worked Per Week, +1468798023222:main = Relationship Between Number of Sick Days and Average Days Worked) +1468798025912:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days)) +1468798062761:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468798066662:xlab = Number of dependents, +1468798067319:ylab = Average Days Worked Per Week, +1468798067955:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468798068785:abline(lm(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked)) +1468798137158:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468798137781:xlab = Number of dependents, +1468798138376:ylab = Average Days Worked Per Week, +1468798138983:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468798141846:lines(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked)) +1468798213223:lines(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked) +1468798220975:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468798221865:xlab = Number of dependents, +1468798222110:ylab = Average Days Worked Per Week, +1468798222622:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468798223721:lines(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked) +1468798228356:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468798232231:xlab = Number of dependents, +1468799368383:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468799370112:xlab = Number of Sick Days, +1468799371298:ylab = Average Days Worked Per Week, +1468799373958:main = Relationship Between Number of Sick Days and Average Days Worked) +1468799377210:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days)) +1468799385110:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468799386960:xlab = Number of dependents, +1468799388485:ylab = Average Days Worked Per Week, +1468799391706:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468799396019:lines(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked) +1468799412454:lines(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked)) +1468799423284:lines(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked) +1468799440556:lines(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked) +1468799447695:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468799448371:xlab = Number of dependents, +1468799448967:ylab = Average Days Worked Per Week, +1468799450115:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468799451130:lines(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked) +1468799524211:line(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked) +1468799535307:line(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked)) +1468800306741:loess_fit<-(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked)) +1468800307737:lines(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, predict(loess_fit, col = blue)) +1468800337524:loess_fit<-(loess(MTA1$Number.of.dependents ~ MTA1$Average.Days.Worked)) +1468800340134:lines(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, predict(loess_fit, col = blue)) +1468800367644:lines(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, predict(loess_fit), col = blue) +1468800403394:loess_fit +1468800474487:lines(loess(loess_fit)) +1468800545863:loess_fit<-(loess(MTA1$Number.of.dependents)) +1468800584283:line(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked)) +1468801124505:line(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked)) +1468801140851:lines.default(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked)) +1468801152541:lines(loess(MTA1$Number.of.dependents, MTA1$Average.Days.Worked)) +1468801196098:lines(loess(loess_fit)) +1468801344815:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468801345754:xlab = Number of dependents, +1468801346318:ylab = Average Days Worked Per Week, +1468801346982:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468801347879:abline(MTA1$Number.of.dependent ~ MTA1$Average.Days.Worked, col = red) +1468801373639:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468801374165:xlab = Number of dependents, +1468801374752:ylab = Average Days Worked Per Week, +1468801375286:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468801376253:abline(MTA1$Number.of.dependent ~ MTA1$Average.Days.Worked, col = red)) +1468801403790:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468801404413:xlab = Number of Sick Days, +1468801404920:ylab = Average Days Worked Per Week, +1468801405661:main = Relationship Between Number of Sick Days and Average Days Worked) +1468801406475:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days, col = red)) +1468801439363:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468801439874:xlab = Number of Sick Days, +1468801440460:ylab = Average Days Worked Per Week, +1468801440886:main = Relationship Between Number of Sick Days and Average Days Worked) +1468801441176:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days, col = red)) +1468801442126:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468810431545:p1 <- ggplot(MTA1, aes(x = MTA1$Number.of.dependents , y = MTA1$Average.Days.Worked)) +1468810449145:p1 <- ggplot(MTA1, aes(x = MTA1$Number.of.dependents , y = MTA1$Average.Days.Worked)) +1468810492909:p1 <- ggplot(MTA1, aes(x = MTA1$Number.of.dependents, y = MTA1$Average.Days.Worked)) +1468810510065:p1 +1468810580157:p2 <- p1 + geom_point( size = 5) +1468810614626:p2 +1468810629664:p2 <- p1 + geom_point( size = 2) +1468810631687:p2 +1468811859502:p3 <- p1 + labs( x = Number of Dependents +1468811860443:y = Average Days Worked per Week +1468811865627:theme (The Relationship Between The Number of Dependents and Average Days Worked )) +1468811898925:p3 <- p1 + labs( x = Number of Dependents, +1468811899688:y = Average Days Worked per Week, +1468811900907:theme (The Relationship Between The Number of Dependents and Average Days Worked )) +1468811952758:p3 <- p1 + labs( x = Number of Dependents, +1468811953497:y = Average Days Worked per Week, +1468811954160:theme =The Relationship Between The Number of Dependents and Average Days Worked ) +1468812311002:p3 <- p1 + labs(x = Number of Dependents, +1468812311970:y = Average Days Worked per Week, +1468812312746:axis.title = The Relationship Between The Number of Dependents and Average Day Worked per Week)","YOUR NAME" +"1468812336844","p3 <- p1 + labs(x = Number of Dependents,","YOUR NAME" +"1468812337621","y = Average Days Worked per Week,","YOUR NAME" +"1468812350438","p3 <- p1 + labs(x = Number of Dependents,","YOUR NAME" +"1468812354526","y = Average Days Worked per Week,","YOUR NAME" +"1468812362442","axis.title = The Relationship Between The Number of Dependents and Average Day Worked per Week)","YOUR NAME" +"1468812394705","p1 <- ggplot(MTA1, aes(x = MTA1$Number.of.dependents, y = MTA1$Average.Days.Worked))","YOUR NAME" +"1468812404501","p1","YOUR NAME" +"1468812410912","p2 <- p1 + geom_point( size = 2)","YOUR NAME" +"1468812413188","p2","YOUR NAME" +"1468812429555","p3","YOUR NAME" +"1468812477968","p3 <- p2 + labs(x = Number of Dependents,","YOUR NAME" +"1468812481143","y = Average Days Worked per Week,","YOUR NAME" +"1468812486408","axis.title = The Relationship Between The Number of Dependents and Average Day Worked per Week)","YOUR NAME" +"1468812508750","p3","YOUR NAME" +"1468812960949","p3 <- p2 + labs(x = Number of Dependents,","YOUR NAME" +"1468812964413","y = Average Days Worked per Week,","YOUR NAME" +"1468812970439","title = = The Relationship Between The Number of Dependents and Average Day Worked per Week)","YOUR NAME" +"1468813003688","p3 <- p2 + labs(x = Number of Dependents,","YOUR NAME" +"1468813008281","y = Average Days Worked per Week,","YOUR NAME" +"1468813013704","title = The Relationship Between The Number of Dependents and Average Day Worked per Week)","YOUR NAME" +"1468813022564","p3","YOUR NAME" +"1468813887214","p3 <- p2 + labs(x = Number of Dependents,","YOUR NAME" +"1468813893101","y = Average Days Worked per Week,","YOUR NAME" +"1468813899352","title = The Relationship Between The Number of Dependents and Average Day Worked per Week)","YOUR NAME" +"1468814458541","p4 <- p1 + geom_point(color=red) + geom_smooth(method = lm, se = TRUE)","YOUR NAME" +"1468814467172","p4","YOUR NAME" +"1468814497949","p4 <- p3 + geom_point(color=red) + geom_smooth(method = lm, se = TRUE)","YOUR NAME" +"1468814504566","p4","YOUR NAME" +"1468815917405","p5<- ggplot(aes(x = MTA1$Number.of.Years.Worked, y =Sex.and.Years.Worked.As.Dispatcher$Sex))","YOUR NAME" +"1468818905491","Sex9 <- read.table(~/Sex9.txt, quote=\"", comment.char="") +1468818905518:View(Sex9) +1468818943048:p5<- ggplot(aes(x = MTA1$Number.of.Years.Worked, y =Sex9$V1)) +1468822049787:lm(formula = MTA1$Number.of.Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex + +1468822051251:MTA1$Number.ofSick.Days + MTA1$Number.of.dependents + MTA1$Average.Days.Worked, +1468822054914:data = MTA1, Sex.and.Years.Worked.As.Dispatcher = df) +1468822173325:lm(formula = MTA1$Number.of.Years.Worked ~ MTA1$Number.of.dependents, +1468822174299:MTA1 = df) +1468822506866:lm(formula = MTA1$Number.of.Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex, +1468822507754:MTA1 = df) +1468822533897:summary(lm) +1468866335807:is.data.frame(MTA1, Sex.and.Years.Worked.As.Dispatcher) +1468866357144:is.data.frame(MTA1) +1468866589361:df <- data.frame(MTA1$Number.of.dependents, Sex.and.Years.Worked.As.Dispatcher$Sex) +1468866707620:df <- data.frame(MTA1$Number.of.Years.Worked, Sex.and.Years.Worked.As.Dispatcher$Sex) +1468866878683:lm5 <- lm(MTA1$Number.of.Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex, data = df) +1468866884519:summary(lm5) +1468868259797:resids <- lm5$residuals +1468868260446:hist(resids, freq = FALSE ) +1468868279130:residuals <- lm5$residuals +1468868296149:hist(residuals, freq = FALSE ) +1468868454021:standardresiduals <- (lm5) +1468868455423:hist(standardresiduals, freq = FALSE, 25) +1468868527799:standardresiduals <- (lm5$residuals) +1468868528453:hist(standardresiduals, freq = FALSE, 25) +1468868568864:lines(density(standardresiduals), col = red, lwd = 3) +1468868745956:shapiro.test(standardresiduals) +1468869744815:ncvTest(lm5) +1468870647100:bptest(lm5) +1468873403850:lm1 <- lm(MTA1$Number.of.Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex+ +1468873405157:MTA1$Number.ofSick.Days + MTA1$Number.of.dependents+ +1468873405884:MTA1$Average.Days.Worked, MTA1, Sex.and.Years.Worked.As.Dispatcher = df ) +1468873577097:residuals2<- lm1$residuals +1468873639132:stadardresiduals2 <-(lm1$residuals) +1468873710955:sharpiro.test(standardresiduals2) +1468873721878:shapiro.test(standardresiduals2) +1468873740500:standardresiduals2 <-(lm1$residuals) +1468873744234:shapiro.test(standardresiduals2) +1468874060874:ncvTest(lm1) +1468874095511:bptest(lm1) +1468876037035:summary(lm1) +1468877794737:anova(lm5, lm1) +1468877812194:anova(lm1, lm5) +1468877954442:anova(lm1, lm6) +1468877971657:anova(lm1) +1468878149570:AIC(lm5, lm1) +1468878155754:BIC(lm5, lm1) +1468878175563:AIC(lm1, lm5) +1468886139600:boxplot(MTA1$Number.of.Years.Worked, main = Boxplot of Number of Years Worked) +1468886542782:boxplot(MTA1$Number.of.Years.Worked ~ MTA1$Number.of.dependents) # Conditional boxplot +1468886861127:boxplot(MTA1$Number.of.Years.Worked ~ MTA1$Number.of.dependents, +1468886862472:main = Boxplot of Number of Years Worked When Considering Number of Dependents, +1468886863595:xlab = Number of Dependents, +1468886864567:ylab = Number of Years Worked) +1468900469258:qplot(Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher, geom =histogram) +1468900485035:qplot(Sex.and.Years.Worked.As.Dispatcher geom = barplot) +1468900503469:qqnorm(Residual) +1468900505594:qqnorm(Residual2) +1468900733328:plot(lm1) +1468900774954:range(sresid) +1468900776618:mresid<-(Residual2) +1468900777031:hist(mresid, freq = FALSE, 20) +1468900777672:lines(density(mresid), col = green, lwd = 3, +1468900778459:main = Residuals of Multiple Regression) +1468900799111:mresid<-(residuals2) +1468900800392:hist(mresid, freq = FALSE, 20) +1468900801153:lines(density(mresid), col = green, lwd = 3, +1468900801829:main = Residuals of Multiple Regression) +1468900803053:range(mresid) +1468900906861:crPlots(lm3) +1468900908392:plot(lm6) +1468900957518:fit <-(MTA1$Number.ofSick.Days ~ MTA1Number.ofYears.Worked + MTA1$Number.of.dependents+ +1468900958769:MTA1$Average.Days.Worked, data = mydata) +1468900961052:summary(fit) +1468900968954:plot(MTA1$Number.ofSick.Days,MTA1$Number.of.dependents ) +1468900969892:plot(MTA1$Number.of.Years.Worked, MTA1$Number.of.dependents) +1468901041093:p5<- ggplot(aes(x = MTA1$Number.of.Years.Worked, y =Sex9$V1)) +1468901051034:p1 <- ggplot(MTA1, aes(x = MTA1$Number.of.dependents, y = MTA1$Average.Days.Worked)) +1468901052176:p1 +1468901053216:p2 <- p1 + geom_point( size = 2) +1468901054461:p2 +1468901056801:p3 <- p2 + labs(x = Number of Dependents, +1468901058020:y = Average Days Worked per Week, +1468901059116:title = The Relationship Between The Number of Dependents and Average Day Worked per Week) +1468901060684:p3 +1468901064374:p4 <- p3 + geom_point(color=red) + geom_smooth(method = lm, se = TRUE) +1468901066930:p4 +1468901136773:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468901137492:xlab = Number of Sick Days, +1468901138143:ylab = Average Days Worked Per Week, +1468901138928:main = Relationship Between Number of Sick Days and Average Days Worked) +1468901139642:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days, col = red)) +1468901144928:plot(MTA1$Number.of.dependents, MTA1$Average.Days.Worked, +1468901145490:xlab = Number of dependents, +1468901145961:ylab = Average Days Worked Per Week, +1468901146866:main = Relationship Between Number of dependents and Average Days Worked Per Week) +1468901147677:abline(MTA1$Number.of.dependent ~ MTA1$Average.Days.Worked, col = red)) +1468901159703:plot(MTA1$Number.ofSick.Days, MTA1$Average.Days.Worked, +1468901160392:xlab = Number of Sick Days, +1468901161109:ylab = Average Days Worked Per Week, +1468901161669:main = Relationship Between Number of Sick Days and Average Days Worked) +1468901162839:abline(lm(MTA1$Average.Days.Worked ~ MTA1$Number.ofSick.Days, col = red)) +1468901685379:ggplot(Sex$Sex, + geom_bar(stat=identity) + +1468901686080:labs(x=Percentage, y=Proportion) +1468901689690:ggplot2(tab5, geom_bar +1468901691009:legend(x =13, y = 100, legend = rownames(tab5), +1468901691734:fill = c(blue1, pink1))) +1468901700407:ggplot(Sex3, aes(x=Sex3$V1, y=Sex3$V2)) + geom_bar(stat = identity)+ +1468901700954:labs(x = Sex, y = Number of Dispatchers) +1468901715002:barplot(height = tab1, +1468901715692:xlab = Rank, +1468901716286:ylab = Frequency, +1468901716651:main = Simple bar plot) +1468901724538:(tab2 <- table(Salaries$rank, Salaries$discipline)) +1468901725409:barplot(tab2, beside = FALSE, # stacked +1468901726258:xlab = Discipline, +1468901726911:ylab = Frequency, +1468901727597:legend = rownames(tab2) +1468901736594:(tab6<- table(Sex3$V1, Sex3$V2)) +1468901740758:barplot( height = tab6, +1468901741288:xlab = Sex, +1468901741796:ylab = Aggregate Dispatcher Responses, +1468901742108:col = c(blue1, pink1), +1468901742386:main = Distribution of Sex, +1468901743192:horiz = TRUE) +1468901748117:barplot( height = tab6, +1468901752939:xlab = Sex, +1468901757610:ylab = Aggregate Dispatcher Responses, +1468901761412:col = c(blue1, pink1), +1468901765267:main = Distribution of Sex, +1468901774559:horiz = TRUE) +1468901783538:barplot( height = tab6, +1468901787507:xlab = Sex, +1468901791049:ylab = Aggregate Dispatcher Responses, +1468901794347:col = c(blue1, pink1), +1468901796796:main = Distribution of Sex, +1468901799252:horiz = TRUE) +1468904930370:barplot(tab2, beside = TRUE, +1468904931351:xlab = Shift Type (1-3), +1468904932331:ylab = Aggregate Dispatcher Responses, +1468904933051:col = c(blue1, green1, orange1, red1), +1468904933490:main = Distribution Of Total Stress Responses For Each Shift Type ) +1468904934455:legend(x = 13, y = 1000, legend = rownames(tab2), +1468904935246:fill = c(blue1, green1, orange1, red1))# grouped +1468904947879:barplot(tab2, beside = TRUE, +1468904951987:xlab = Shift Type (1-3), +1468906645850:barplot(tab2, beside = TRUE, +1468906646599:xlab = Shift Type (1-3), +1468906647250:ylab = Aggregate Dispatcher Responses, +1468906647914:col = c(blue1, green1, orange1, red1), +1468906648665:main = Distribution Of Total Stress Responses For Each Shift Type ) +1468906649377:legend(x = 13, y = 1000, legend = rownames(tab2), +1468906649974:fill = c(blue1, green1, orange1, red1))# grouped +1468906665439:barplot(tab3, beside = TRUE, +1468906668191:xlab = Shift Type (1-3), +1468906669286:ylab = Aggregate Dispatcher Responses, +1468906669730:col = c(blue1, green1, orange1, red1), +1468906669911:main = Distribution Of Total Stress Responses For Each Shift Type ) +1468906670093:legend(x = 13, y = 1000, legend = rownames(tab2), +1468907127923:(tab8<-table(Sex8$V1)) +1468907128954:barplot(height = tab8, beside = TRUE, +1468907129549:xlab = Sex, +1468907139424:(tab8<-table(Sex8$V1)) +1468907143238:barplot(height = tab8, beside = TRUE, +1468907147464:xlab = Sex, +1468907151298:ylab = Number of Dispatchers, +1468907155470:col = c(blue1, pink1), +1468907165782:main = Distribution of Sex for Dispatchers) +1468907248769:ggplot(Sex.and.Years.Worked.As.Dispatcher, aes(x = Sex.and.Years.Worked.As.Dispatcher$Sex, +1468907249367:y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar(stat =identity)+ +1468907249938:labs(x = Sex, y = Dispatcher Years)+ ggtitle(Number of Years a Dispatcher Worked by Sex Type) +1468907264114:ggplot(Sex.and.Years.Worked.As.Dispatcher, aes( x = Sex.and.Years.Worked.As.Dispatcher$Sex, +1468907264838:y = Sex.and.Years.Worked.As.Dispatcher$Total_years_dispatcher))+ geom_bar( stat = identity )+ +1468907265424:labs +1468907286361:barplot(height = tab1, beside = TRUE, +1468907289959:xlab = Sex, +1468907296362:ylab = Years Worked by Dispatcher, +1468907299685:main = Sex and Years Worked by a Dispatcher) +1468907392798:attributes(MTA1, Sex.and.Years.Worked.As.Dispatcher$Sex) +1468907406831:attributes(MTA1) +1468952411941:plot(lm1) +1468952438597:hist(residuals, freq = FALSE ) +1468952452625:qqnorm(residuals) +1468952453692:qqnorm(residuals2) +1468952455875:residuals <- lm5$residuals +1468952533924:hist(mresid, freq = FALSE, 20) +1468952534688:lines(density(mresid), col = green, lwd = 3, +1468952535056:main = Residuals of Multiple Regression) +1468952536130:range(mresid) +1468952546604:hist(standardresiduals, freq = FALSE, 25) +1468952547288:lines(density(standardresiduals), col = red, lwd = 3) +1468952598161:residuals <- lm5$residuals +1468952598721:hist(residuals, freq = FALSE ) +1468952746221:hist(standardresiduals2, freq = FALSE, 20) +1468952746859:lines(density(mresid), col = green, lwd = 3, +1468952747442:main = Residuals of Multiple Regression) +1468952750725:range(mresid) +1468952752411:hist(standardresiduals, freq = FALSE, 25) +1468952753158:lines(density(standardresiduals), col = red, lwd = 3) +1468952753917:range(standardresiduals) +1468952997268:sapply(ShifTypeyes, mean, na.rm = TRUE) +1468955325469:shapiro.test(standardresiduals) +1468955330675:shapiro.test(standardresiduals2) +1468955334392:ncvTest(lm1) +1468955338008:ncvTest(lm5) +1468955517424:AIC (lm5, lm1) +1468955533992:BIC (lm5, lm1) +1468955762443:df <- data.frame(MTA1$Number.of.Years.Worked, Sex.and.Years.Worked.As.Dispatcher$Sex) +1468955767720:lm5 <- lm(MTA1$Number.of.Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex, data = df) +1468955771695:summary(lm5) +1468955834004:lm1 <- lm(MTA1$Number.of.Years.Worked ~ Sex.and.Years.Worked.As.Dispatcher$Sex+ +1468955834716:MTA1$Number.ofSick.Days + MTA1$Number.of.dependents+ +1468955835148:MTA1$Average.Days.Worked, MTA1, Sex.and.Years.Worked.As.Dispatcher = df ) +1468955836383:summary(lm1) +1468955981937:vif(lm1) +1468955989656:vif(lm5) +1468956009070:vif(lm6) +1474557717551:install.packages(swirl) +1474557776562:library(swirl) +1474557809961:swirl() +1474558410622:swirl() +1474558479732:5+7 +1474558591957:x<- 5 + 7 +1474558611535:x +1474558643783:y<- x-3 +1474558660388:y +1474558718648:z<-c(1.1, 9, 3.14) +1474558741143:?c +1474558748851:z +1474558808206:c(z,555,z) +1474558828302:z * 2 + 100 +1474558897494:my_sqrt<-sqrt(z-1) +1474559053958:my_sqrt +1474559123015:my_div<-z/my_sqrt +1474559202295:my_div +1474559367927:c(1, 2, 3, 4) + c(0, 10) +1474559394825:c(1, 2, 3, 4) + c(0, 10, 100) +1474559501861:c(1, 2, 3, 4) + c(0, 10, 1000) +1474559562892:z * 2 + 1000 +1474559638219:my_div +1474560589249:history_database +1474560850037:H <-read.table(~/.rstudio-desktop/history_database, sep=","YOUR NAME" +", fill=T, stringsAsFactors=F) +1474560850068:names(H) <- c(time, answer) +1474560850091:H$id <- YOUR NAME +1474560850112:write.csv(H, file = lesson1.csv, row.names = FALSE) +1474561467989:H <-read.table(~/.rstudio-desktop/history_database, sep=",", fill=T, stringsAsFactors=F) +1474561468021:names(H) <- c(time, answer) +1474561468043:H$id <- Ben Roberts +1474561468062:write.csv(H, file = lesson1.csv, row.names = FALSE) +1474562479960:H <-read.table(C","YOUR NAME" +"\\Users\\Ben\\AppData\\Local\\RStudio-Desktop\\history_database, sep=",", fill=T, stringsAsFactors=F) +","YOUR NAME"