in_class exercise 2
## Loading required package: Ecfun
##
## Attaching package: 'Ecfun'
## The following object is masked from 'package:base':
##
## sign
##
## Attaching package: 'Ecdat'
## The following object is masked from 'package:datasets':
##
## Orange
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
| 75119 |
Alameda |
Sunol Glen Unified |
KK-08 |
195 |
10.90 |
0.5102 |
2.0408 |
67 |
690.80 |
0.3435898 |
6384.911 |
17.88991 |
22.690001 |
0.000000 |
691.6 |
690.0 |
| 61499 |
Butte |
Manzanita Elementary |
KK-08 |
240 |
11.15 |
15.4167 |
47.9167 |
101 |
661.20 |
0.4208333 |
5099.381 |
21.52466 |
9.824000 |
4.583334 |
660.5 |
661.9 |
| 61549 |
Butte |
Thermalito Union Elementary |
KK-08 |
1550 |
82.90 |
55.0323 |
76.3226 |
169 |
643.60 |
0.1090323 |
5501.955 |
18.69723 |
8.978000 |
30.000002 |
636.3 |
650.9 |
| 61457 |
Butte |
Golden Feather Union Elementary |
KK-08 |
243 |
14.00 |
36.4754 |
77.0492 |
85 |
647.70 |
0.3497942 |
7101.831 |
17.35714 |
8.978000 |
0.000000 |
651.9 |
643.5 |
| 61523 |
Butte |
Palermo Union Elementary |
KK-08 |
1335 |
71.50 |
33.1086 |
78.4270 |
171 |
640.85 |
0.1280899 |
5235.988 |
18.67133 |
9.080333 |
13.857677 |
641.8 |
639.9 |
| 62042 |
Fresno |
Burrel Union Elementary |
KK-08 |
137 |
6.40 |
12.3188 |
86.9565 |
25 |
605.55 |
0.1824818 |
5580.147 |
21.40625 |
10.415000 |
12.408759 |
605.7 |
605.4 |
dta <- as_tibble(Ecdat::Caschool)
dta1 <-dta %>% mutate(STratio=enrltot/teachers,readscr_f = cut(readscr, breaks=quantile(readscr, probs=c(0, .33, .67, 1)),
label=c("Low", "Middle", "High"), ordered=T))
lattice::xyplot(readscr ~ STratio | readscr_f, data=dta1, xlab="Student-Teacher ratio", ylab="Reading score", type=c("p", "g", "r"),auto.key=list(columns=2))
