library(ggplot2)
library(markdown)
library(rmarkdown)
library(tidyr)
library(tidyselect)
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✔ tibble 3.1.6 ✔ dplyr 1.0.7
## ✔ readr 2.1.2 ✔ stringr 1.4.0
## ✔ purrr 0.3.4 ✔ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
library(pairsD3)
library(smss)
library(alr4)
## Loading required package: car
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
##
## recode
## The following object is masked from 'package:purrr':
##
## some
## Loading required package: effects
## lattice theme set by effectsTheme()
## See ?effectsTheme for details.
1.11 Predictor is ppGDP and response is Fertility
plot(UN11$ppgdp, UN11$fertility, main = "Fertility and GDP", xlab = "GDP", ylab = "Fertility")
abline(lm(UN11$fertility ~ UN11$ppgdp))
attach(UN11)
view(UN11)
plot(log(UN11$ppgdp), log(UN11$fertility), main = "Fertility and GDP", xlab = "GDP", ylab = "Fertility")
abline(lm(log(UN11$fertility) ~ log(UN11$ppgdp)))
It looks like there is a relationship between BSAAM, OSPLAKE, OPRC, OPBPC.
attach(water)
view(water)
pairs(water)
Quality and helpfulness/ clarity have a relationship. The relationship becomes less significant over the course of the other variables.
attach(Rateprof)
view(Rateprof)
ratevar<-Rateprof%>%select(quality, helpfulness, clarity, easiness, raterInterest)
pairs(ratevar)
data(student.survey)
lm(pi~re, data = student.survey)
## Warning in model.response(mf, "numeric"): using type = "numeric" with a factor
## response will be ignored
## Warning in Ops.ordered(y, z$residuals): '-' is not meaningful for ordered
## factors
##
## Call:
## lm(formula = pi ~ re, data = student.survey)
##
## Coefficients:
## (Intercept) re.L re.Q re.C
## 3.5253 2.1864 0.1049 -0.6958
lm(hi~tv, data = student.survey)
##
## Call:
## lm(formula = hi ~ tv, data = student.survey)
##
## Coefficients:
## (Intercept) tv
## 3.44135 -0.01831
boxplot(pi~re, data = student.survey)
scatterplot(hi~tv, data = student.survey)