Skip to content

Commit

Permalink
changed scatterplots to reflect enrollment
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfprice committed Jun 16, 2023
1 parent d876250 commit 9054d9f
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ <h3 class="anchored" data-anchor-id="urban-centric-locale-sco-scores">Urban-Cent
#&gt; collate en_US.UTF-8
#&gt; ctype en_US.UTF-8
#&gt; tz America/Indiana/Indianapolis
#&gt; date 2023-06-15
#&gt; date 2023-06-16
#&gt; pandoc 3.1.3 @ /opt/homebrew/bin/ (via rmarkdown)
#&gt;
#&gt; ─ Packages ───────────────────────────────────────────────────────────────────
Expand Down
Binary file modified docs/index_files/figure-html/fig-3dscatter-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/index_files/figure-html/fig-beeswarm-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/index_files/figure-html/fig-beeswarm-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/index_files/figure-html/fig-beeswarm-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/index_files/figure-html/fig-indiana-map-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"href": "index.html#session-information",
"title": "SCOscore: School Corporation Opportunity Score",
"section": "Session Information",
"text": "Session Information\n\nSession information is provided for reproducibility purposes.\n\n\n#&gt; ─ Session info ───────────────────────────────────────────────────────────────\n#&gt; setting value\n#&gt; version R version 4.3.0 (2023-04-21)\n#&gt; os macOS Ventura 13.4\n#&gt; system aarch64, darwin20\n#&gt; ui X11\n#&gt; language (EN)\n#&gt; collate en_US.UTF-8\n#&gt; ctype en_US.UTF-8\n#&gt; tz America/Indiana/Indianapolis\n#&gt; date 2023-06-15\n#&gt; pandoc 3.1.3 @ /opt/homebrew/bin/ (via rmarkdown)\n#&gt; \n#&gt; ─ Packages ───────────────────────────────────────────────────────────────────\n#&gt; package * version date (UTC) lib source\n#&gt; dplyr * 1.1.2 2023-04-20 [1] CRAN (R 4.3.0)\n#&gt; edbuildmapr * 0.3.1 2021-06-15 [1] CRAN (R 4.3.0)\n#&gt; ggbeeswarm * 0.7.2 2023-04-29 [1] CRAN (R 4.3.0)\n#&gt; ggmap * 3.0.2 2023-03-14 [1] CRAN (R 4.3.0)\n#&gt; ggplot2 * 3.4.2 2023-04-03 [1] CRAN (R 4.3.0)\n#&gt; ggpubr * 0.6.0 2023-02-10 [1] CRAN (R 4.3.0)\n#&gt; ggrepel * 0.9.3 2023-02-03 [1] CRAN (R 4.3.0)\n#&gt; here * 1.0.1 2020-12-13 [1] CRAN (R 4.3.0)\n#&gt; knitr * 1.42 2023-01-25 [1] CRAN (R 4.3.0)\n#&gt; mapdata * 2.3.1 2022-11-01 [1] CRAN (R 4.3.0)\n#&gt; maps * 3.4.1 2022-10-30 [1] CRAN (R 4.3.0)\n#&gt; moments * 0.14.1 2022-05-02 [1] CRAN (R 4.3.0)\n#&gt; plotly * 4.10.2 2023-06-03 [1] CRAN (R 4.3.0)\n#&gt; readr * 2.1.4 2023-02-10 [1] CRAN (R 4.3.0)\n#&gt; sf * 1.0-13 2023-05-24 [1] CRAN (R 4.3.0)\n#&gt; showtext * 0.9-6 2023-05-03 [1] CRAN (R 4.3.0)\n#&gt; showtextdb * 3.0 2020-06-04 [1] CRAN (R 4.3.0)\n#&gt; sysfonts * 0.8.8 2022-03-13 [1] CRAN (R 4.3.0)\n#&gt; tidyr * 1.3.0 2023-01-24 [1] CRAN (R 4.3.0)\n#&gt; \n#&gt; [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library\n#&gt; \n#&gt; ──────────────────────────────────────────────────────────────────────────────"
"text": "Session Information\n\nSession information is provided for reproducibility purposes.\n\n\n#&gt; ─ Session info ───────────────────────────────────────────────────────────────\n#&gt; setting value\n#&gt; version R version 4.3.0 (2023-04-21)\n#&gt; os macOS Ventura 13.4\n#&gt; system aarch64, darwin20\n#&gt; ui X11\n#&gt; language (EN)\n#&gt; collate en_US.UTF-8\n#&gt; ctype en_US.UTF-8\n#&gt; tz America/Indiana/Indianapolis\n#&gt; date 2023-06-16\n#&gt; pandoc 3.1.3 @ /opt/homebrew/bin/ (via rmarkdown)\n#&gt; \n#&gt; ─ Packages ───────────────────────────────────────────────────────────────────\n#&gt; package * version date (UTC) lib source\n#&gt; dplyr * 1.1.2 2023-04-20 [1] CRAN (R 4.3.0)\n#&gt; edbuildmapr * 0.3.1 2021-06-15 [1] CRAN (R 4.3.0)\n#&gt; ggbeeswarm * 0.7.2 2023-04-29 [1] CRAN (R 4.3.0)\n#&gt; ggmap * 3.0.2 2023-03-14 [1] CRAN (R 4.3.0)\n#&gt; ggplot2 * 3.4.2 2023-04-03 [1] CRAN (R 4.3.0)\n#&gt; ggpubr * 0.6.0 2023-02-10 [1] CRAN (R 4.3.0)\n#&gt; ggrepel * 0.9.3 2023-02-03 [1] CRAN (R 4.3.0)\n#&gt; here * 1.0.1 2020-12-13 [1] CRAN (R 4.3.0)\n#&gt; knitr * 1.42 2023-01-25 [1] CRAN (R 4.3.0)\n#&gt; mapdata * 2.3.1 2022-11-01 [1] CRAN (R 4.3.0)\n#&gt; maps * 3.4.1 2022-10-30 [1] CRAN (R 4.3.0)\n#&gt; moments * 0.14.1 2022-05-02 [1] CRAN (R 4.3.0)\n#&gt; plotly * 4.10.2 2023-06-03 [1] CRAN (R 4.3.0)\n#&gt; readr * 2.1.4 2023-02-10 [1] CRAN (R 4.3.0)\n#&gt; sf * 1.0-13 2023-05-24 [1] CRAN (R 4.3.0)\n#&gt; showtext * 0.9-6 2023-05-03 [1] CRAN (R 4.3.0)\n#&gt; showtextdb * 3.0 2020-06-04 [1] CRAN (R 4.3.0)\n#&gt; sysfonts * 0.8.8 2022-03-13 [1] CRAN (R 4.3.0)\n#&gt; tidyr * 1.3.0 2023-01-24 [1] CRAN (R 4.3.0)\n#&gt; \n#&gt; [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library\n#&gt; \n#&gt; ──────────────────────────────────────────────────────────────────────────────"
},
{
"objectID": "CODE_OF_CONDUCT.html",
Expand Down
51 changes: 42 additions & 9 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ library(ggplot2)
library(ggpubr)
library(plotly)
library(ggbeeswarm)
#library(ggstatsplot)
library(edbuildmapr)
library(maps)
library(mapdata)
library(ggmap)
library(moments)
#library(akima)
#library(ggpp)
library(ggrepel)
library(knitr)
library(sf)
Expand Down Expand Up @@ -338,6 +339,13 @@ central_indiana_map <- sco_map +
central_indiana_map
ggsave(here("outputs", "central_indiana_map.pdf"), central_indiana_map, dpi = 300, width = 8.5, height = 11, units = "in")
#inset_small <- central_indiana_map +
# theme(legend.position = "none")
#inset_map <- sco_map +
# annotate("plot_npc", npcx = "right", npcy = "bottom", label = inset_small) +
# expand_limits(y = 20, x = 20)
#inset_map
```

Most of the high opportunity schools are centered in Marion County (with the notable
Expand Down Expand Up @@ -441,7 +449,7 @@ Opportunity Scores.
#| fig-cap: "Scatter plots of SCO scores for school corporations in Indiana by percent non-white, percent free/reduced lunch, and academic scores."
SCO_scatter_frame <- SCO_frame |>
select(urm_pct, frl_pct, academic, scoScore) |>
select(urm_pct, frl_pct, academic, scoScore, enrollment) |>
mutate(academic_cat = case_when(
academic < 1.5 ~ "Academic Scores 1.0 - 1.4",
academic < 1.75 & academic >= 1.5 ~ "Academic Scores 1.5 - 1.74",
Expand All @@ -463,17 +471,24 @@ SCO_scatter <- ggscatter(
x = "urm_pct",
y = "frl_pct",
color = "academic",
size = "enrollment",
xlab = "Percent of Under-Represented Minority Students",
ylab = "Percent of Free or Reduced Lunch Students",
size = 0.5
ylab = "Percent of Free or Reduced Lunch Students"#,
#size = 0.5
) +
scale_color_steps2(
name = "Academic Score",
low = "#FFF4C6",
high = "#990000",
mid = "#FFAA00",
midpoint = 1.76,
breaks = c(1, 1.5, 1.75, 2)
) +
scale_size_binned(
breaks = c(1000, 5000, 10000, 15000, 20000),
labels = c("1K", "5k", "10k", "15K", "20k"),
name = "Enrollment"
) +
theme_pubr()
SCO_scatter <- SCO_scatter |>
facet(
Expand All @@ -484,10 +499,10 @@ SCO_scatter <- SCO_scatter |>
color = "#243142",
fill = "#eeeeee"
)
) |>
ggpar(
legend.title = "Academic Score"
)
) #|>
#ggpar(
# legend.title = "Academic Score"
#)
SCO_scatter
```
Expand Down Expand Up @@ -593,7 +608,8 @@ urcl_swarm <- ggplot(
aes(
x = urban_centric_locale,
y = scoScore,
color = scoScore
color = scoScore,
size = enrollment
)
) +
geom_beeswarm(shape = 18, corral = "wrap", method = "hex", cex = 1.5) + # size = 3,
Expand Down Expand Up @@ -622,6 +638,23 @@ urcl_swarm <- ggplot(
)
urcl_swarm
ggsave(here("outputs", "ucl-scoscores.pdf"), urcl_swarm, dpi = 300, width = 11, height = 8.5, units = "in")
# set.seed(123)
#
# ggbetweenstats(
# data = SCO_frame,
# x = urban_centric_locale,
# y = scoScore
# )
#
# set.seed(123)
#
# gghistostats(
# data = SCO_frame,
# x = scoScore,
# test.value = 12,
# binwidth = 0.1
# )
```

We can then look at the *relative opportunity* for the various urban-centered locale
Expand Down
Binary file modified index_files/figure-html/fig-3dscatter-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified index_files/figure-html/fig-beeswarm-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added index_files/figure-html/fig-beeswarm-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added index_files/figure-html/fig-beeswarm-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified index_files/figure-html/fig-indiana-map-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9054d9f

Please sign in to comment.