::opts_chunk$set(comment = NA)
knitr
library(janitor)
library(naniar)
library(xfun)
# if you choose to add other packages, do so here
library(easystats)
library(tidyverse)
theme_set(theme_bw())
## if you choose to source in the Love-431.R script, do so here
431 Project A Plan Template (Replace This Title)
If you want a subtitle, here’s where to put it.
Before submitting your Project A Plan,
Place a meaningful title (that doesn’t use “431” or “Project A” or “Template”) of no more than 80 characters, and your full name(s) as author in the YAML at the top of this template. If you want to include a subtitle, something like “431 Project A Plan” is acceptable there. Otherwise, delete the subtitle section from the YAML.
Delete this note and all of my other instructions from this document. Please leave the headings and subheadings as they are, but feel encouraged to augment the R code we provide here as needed, rather than being obliged to replace it entirely.
Leave blank lines before and after every paragraph, every heading, and every code chunk in your Quarto file after the YAML.
Run spell-check (hit F7) before rendering the document to HTML.
An HTML version of this document is available to view at https://rpubs.com/TELOVE/ProjectA-plan-template-431-2024.
1 R Packages
Follow the instructions in the R Packages section of the Project A Plan page.
2 Data Ingest
<-
data_url "https://www.countyhealthrankings.org/sites/default/files/media/document/analytic_data2024.csv"
<- read_csv(data_url, skip = 1, guess_max = 4000,
chr_2024_raw show_col_types = FALSE) |>
select(fipscode, county, state, county_clustered, year,
ends_with("rawvalue"))
3 State Selection
4 Variable Selection
5 Variable Cleaning and Renaming
6 Creating the Analysis 2 Predictor
7 Adding 2019 Data for the Analysis 3 Outcome
8 Arranging and Saving the Analytic Tibble
9 Print the Tibble
Follow the relevant instructions for this section found on the Plan page.
10 Numerical Summaries
Follow the relevant instructions for this section found on the Plan page.
Those instructions will help you create the four subsections labeled below.
10.1 Table of States by Binary Factor
10.2 describe_distribution()
results
10.3 data_codebook()
results
10.4 Distinct Values
11 The Codebook
Follow the relevant instructions for this section found on the Plan page.
Our add name of tibble tibble contains add code counties and add code variables.
Variable | Role | Old Name | Description | Year(s) |
---|---|---|---|---|
fipscode | ID | fipscode |
FIPS code | – |
state | ID | state |
State Abbreviation (list your states here) | – |
county | ID | county |
County Name | – |
etc. | ||||
county_clustered | check | county_clustered |
Indicates county is ranked (all values should be 1) | 2024 |
12 Research Questions
Follow the relevant instructions for this section, and its subsections, found on the Plan page.
12.1 Analysis 1 Research Question
12.2 Analysis 2 Research Question
12.3 Analysis 3 Research Question
13 Reflection
Follow the relevant instructions for this section found on the Plan page.
14 Session Information
::session_info() xfun
R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22631)
Locale:
LC_COLLATE=English_United States.utf8
LC_CTYPE=English_United States.utf8
LC_MONETARY=English_United States.utf8
LC_NUMERIC=C
LC_TIME=English_United States.utf8
Package version:
askpass_1.2.0 backports_1.5.0 base64enc_0.1.3
bayestestR_0.14.0 bit_4.0.5 bit64_4.0.5
blob_1.2.4 broom_1.0.6 bslib_0.8.0
cachem_1.1.0 callr_3.7.6 cellranger_1.1.0
cli_3.6.3 clipr_0.8.0 coda_0.19-4.1
codetools_0.2-20 colorspace_2.1-1 compiler_4.4.1
conflicted_1.2.0 correlation_0.8.5 cpp11_0.4.7
crayon_1.5.3 curl_5.2.1 data.table_1.15.4
datasets_4.4.1 datawizard_0.12.2 DBI_1.2.3
dbplyr_2.5.0 digest_0.6.36 dplyr_1.1.4
dtplyr_1.3.1 easystats_0.7.3 effectsize_0.8.9
emmeans_1.10.3 estimability_1.5.1 evaluate_0.24.0
fansi_1.0.6 farver_2.1.2 fastmap_1.2.0
fontawesome_0.5.2 forcats_1.0.0 fs_1.6.4
gargle_1.5.2 generics_0.1.3 ggplot2_3.5.1
glue_1.7.0 googledrive_2.1.1 googlesheets4_1.1.1
graphics_4.4.1 grDevices_4.4.1 grid_4.4.1
gridExtra_2.3 gtable_0.3.5 haven_2.5.4
highr_0.11 hms_1.1.3 htmltools_0.5.8.1
htmlwidgets_1.6.4 httr_1.4.7 ids_1.0.1
insight_0.20.2 isoband_0.2.7 janitor_2.2.0
jquerylib_0.1.4 jsonlite_1.8.8 knitr_1.48
labeling_0.4.3 lattice_0.22-6 lifecycle_1.0.4
lubridate_1.9.3 magrittr_2.0.3 MASS_7.3-61
Matrix_1.7-0 memoise_2.0.1 methods_4.4.1
mgcv_1.9.1 mime_0.12 modelbased_0.8.8
modelr_0.1.11 multcomp_1.4-26 munsell_0.5.1
mvtnorm_1.2-5 naniar_1.1.0 nlme_3.1.164
norm_1.0.11.1 numDeriv_2016.8.1.1 openssl_2.2.0
parallel_4.4.1 parameters_0.22.1 performance_0.12.2
pillar_1.9.0 pkgconfig_2.0.3 plyr_1.8.9
prettyunits_1.2.0 processx_3.8.4 progress_1.2.3
ps_1.7.7 purrr_1.0.2 R6_2.5.1
ragg_1.3.2 rappdirs_0.3.3 RColorBrewer_1.1.3
Rcpp_1.0.13 readr_2.1.5 readxl_1.4.3
rematch_2.0.0 rematch2_2.1.2 report_0.5.9
reprex_2.1.1 rlang_1.1.4 rmarkdown_2.27
rstudioapi_0.16.0 rvest_1.0.4 sandwich_3.1-0
sass_0.4.9 scales_1.3.0 see_0.8.5
selectr_0.4.2 snakecase_0.11.1 splines_4.4.1
stats_4.4.1 stringi_1.8.4 stringr_1.5.1
survival_3.7-0 sys_3.4.2 systemfonts_1.1.0
textshaping_0.4.0 TH.data_1.1-2 tibble_3.2.1
tidyr_1.3.1 tidyselect_1.2.1 tidyverse_2.0.0
timechange_0.3.0 tinytex_0.52 tools_4.4.1
tzdb_0.4.0 UpSetR_1.4.0 utf8_1.2.4
utils_4.4.1 uuid_1.2.1 vctrs_0.6.5
viridis_0.6.5 viridisLite_0.4.2 visdat_0.6.0
vroom_1.6.5 withr_3.0.1 xfun_0.46
xml2_1.3.6 xtable_1.8-4 yaml_2.3.10
zoo_1.8-12