source("fall2022_intro_source_code.R")
intro.stats.survey.2022 <- read.csv("intro.stats.survey.2022.csv", header = T)
attach(intro.stats.survey.2022)
Exercise 1: Make the list “val” and generate the new list “laura.”
val <- c(2, 5, 5, 5, 7, 7, 10, 31)
laura <- c(6, 15, 15, 15, 21, 21, 30, 93)
Exercise 2: The categorical variable I will examine is borough Home
barplot(borough.home)
PUT OBSERVATIONS HERE. This is a unimodal barplot with Queens having the most BHSECQ students as residents. —
Exercise 3: The two categorical variables I will be comparing are borough.home and cheaters
table(borough.home, cheaters)
## cheaters
## borough.home 0 3 5 7 10 20 25 26 34 35 36 38 40 50 60 65 70 75 80 85 87 90 92
## Brooklyn 2 0 1 0 0 0 1 0 0 0 0 0 4 1 2 0 1 0 2 0 1 0 1
## Manhattan 1 0 1 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0
## Queens 7 1 1 1 1 2 1 1 1 1 1 1 1 9 4 0 1 3 5 0 0 5 0
## The Bronx 1 1 1 0 1 0 1 0 0 0 0 0 0 3 2 1 0 1 2 1 0 0 0
## cheaters
## borough.home 95 97 99 99.99 100
## Brooklyn 2 0 0 0 2
## Manhattan 0 1 1 0 1
## Queens 4 0 4 1 2
## The Bronx 0 0 0 0 1
barplot(borough.home,cheaters, main="Borough Variation within the BHSECQ Community")
PUT OBSERVATIONS HERE. The graph is very similar to the population of
people from each borough meaning the cheaters are pretty evenly split
from each borough. —
Exercise 4: The quantitative variable I will examine is age
mean(age)
## [1] 15.94175
median(age)
## [1] 16
range(age)
## [1] 15 18
hist(age, main="Ages within BHSECQ")
PUT OBSERVATIONS HERE.
There are many more poeple in the 15.5-16 section than any other.
Exercise 5: The quantitative variable I will compare across years is sleep hours
mean(sleep.hrs)
## [1] 6.679612
range(sleep.hrs)
## [1] 2.0 9.5
boxplot(age, sleep.hrs, main="How does Age Affect Sleep wihtin BHSECQ?")
PUT OBSERVATIONS HERE. It is very difficult to see if these variables are closely related through side by side boxplots.