Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- title: "Assignment 1 - SAT"
- author: "Nikola Danevski"
- date: "9/14/2019"
- output: pdf_document
- ---
- ```{r setup, include=FALSE}
- knitr::opts_chunk$set(echo = TRUE)
- ```
- We plot SAT score against professor salary below.
- There is no relationship between the two entries (although one could argue it is weak, linear and negative).
- 1 = "black", 2 = "red", 3 = "green". The plot says that #TODO WHAT EXACTLY
- ```{r}
- sat <- read.csv("SAT.csv")
- head(sat)
- #TODO what does c) ask us to do?
- cor(sat$salary, sat$sat)
- group_frac <- cut(sat$frac, breaks=c(0,22,49,81), labels = c(1,2,3))
- plot(x = sat$salary, y = sat$sat, xlab = "Salary of the professor", ylab = "Sat score", col = group_frac)
- cor(sat$salary[group_frac == 1], sat$sat[group_frac == 1])
- cor(sat$salary[group_frac == 2], sat$sat[group_frac == 2])
- cor(sat$salary[group_frac == 3], sat$sat[group_frac == 3])
- expendCAT <- ifelse(SAT$expend > 7, "high", "low")
- sat900 <- ifelse(SAT$sat > 900, "Higher", "Lower")
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement