Present Data

source("http://www.openintro.org/stat/data/present.R")
#source("more/present.R")
source("more/arbuthnot.R")


  1. What years are included in this data set? What are the dimensions of the data frame and what are the variable or column names?
  2. How do these counts compare to Arbuthnot’s? Are they on a similar scale?
DT::datatable(present, options = list(pageLength = 10))


dim(present)
## [1] 63  3
dim(arbuthnot)
## [1] 82  3
names(present)
## [1] "year"  "boys"  "girls"


Plotting Data

  1. Make a plot that displays the boy-to-girl ratio for every year in the data set. What do you see? Does Arbuthnot’s observation about boys being born in greater proportion than girls hold up in the U.S.? Include the plot in your response. In what year did we see the most total number of births in the U.S.? You can refer to the help files or the R reference card http://cran.r-project.org/doc/contrib/Short-refcard.pdf to find helpful commands.
plot(x = present$year, y = present$boys / present$girls, type = "l")


  1. In what year did we see the most total number of births in the U.S.?
max(present$boys + present$girls)
## [1] 4268326
present$year[which.max(present$boys + present$girls)]
## [1] 1961





Please email to: kleber.perez@live.com for any suggestion.