Skip to content

Commit

Permalink
post ready for review
Browse files Browse the repository at this point in the history
  • Loading branch information
andkov committed May 24, 2020
1 parent c25a570 commit 377316e
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 16 deletions.
16 changes: 14 additions & 2 deletions analysis/florida-suicide-10_24/fl-suicide-10_24.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ age_groups_in_focus <- lvl_age_groups[4:12]
age_groups_10_24 <- lvl_age_groups[4:6]

#set default ggplot theme
ggplot2::theme_set(ggplot2::theme_bw())
#set default ggplot theme
ggplot2::theme_set(
ggplot2::theme_bw(
)+
theme(
strip.background = element_rect(fill="grey90", color = NA)
)
)

# ---- load-data ---------------------------------------------------------------
# data prepared by "./manipulation/9-aggregator.R" combining population estimates and suicide counts
Expand Down Expand Up @@ -436,6 +443,10 @@ major_causes <- c(
,"hanging" = "Hanging"
,"non_gun_hang" = "Non Gun/Hang")

major_causes_colors <- c(

)

g8 <- d6 %>%
filter(suicide_cause %in% names(major_causes)) %>%
mutate(
Expand Down Expand Up @@ -507,7 +518,8 @@ g10 <- d10 %>%
geom_point(shape = 21) +
geom_smooth(method = "lm", se = FALSE) +
scale_x_continuous(breaks = seq(2007,2017,5)) +
scale_color_brewer(palette = "Dark2") +
# scale_color_brewer(palette = "Dark2") +
scale_color_viridis_d(option = "magma",begin = .2, end = .65)+
facet_grid(suicide_cause ~race_ethnicity
# , scales = "free"
) +
Expand Down
31 changes: 25 additions & 6 deletions analysis/florida-suicide-10_24/fl-suicide-10_24.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ read_chunk("./analysis/florida-suicide-10_24/fl-suicide-10_24.R")

<!-- NEED TO UPDATE -->

This blogpost explores youth (ages 10 - 24) suicide trends in Florida between 2006 and 2017, examining the effects of race and gender. The post answers the following questions:
This blogpost explores youth (ages 10 - 24) suicide trends in Florida between 2006 and 2017, examining the effects of race and gender. The post answers the following questions with respect to population in focus:

> Q1 - What is the overall trajectory of youth suicides in FL between 2006 and 2017?
Expand All @@ -67,29 +67,33 @@ This blogpost explores youth (ages 10 - 24) suicide trends in Florida between 20
> Q4 - How do trends compare by race, sex, and means of means of suicide?
# Environment

___This section contains technical information for deeper analysis and reproduction. Casual readers are invited to skip it.___

Packages used in this report.
<!-- Load 'sourced' R files. Suppress the output when loading packages. -->
```{r load-packages, echo=echoChunks, message=FALSE, warning = FALSE}
```

Script dependencies.
```{r load-sources, echo=echoChunks, message=FALSE, warning = FALSE}
```

Definitions of global object (file paths, factor levels, object groups ) used throughout the report.
```{r declare-globals, echo=echoChunks, results='show', message=FALSE}
```

Definitions of custom functions.
```{r declare-functions, echo=echoChunks, results='show', message=FALSE}
```

# Data

The data comes from Florida Health Charts and contains suicide mortality between 2006 and 2017, broken down by suicide means, county, sex, age, and race. The the dataset is [available for download here](https://github.com/dss-hmi/suicide-prevention-2019/blob/b225979bad5e4728d7a594fd455ab929d3ccafb0/data-public/derived/9-population-suicide.csv).
The data comes from Florida Health Charts and contains suicide mortality between 2006 and 2017, broken down by suicide means, county, sex, age, and race. The groomed dataset is [available for download here](https://github.com/dss-hmi/suicide-prevention-2019/blob/b225979bad5e4728d7a594fd455ab929d3ccafb0/data-public/derived/9-population-suicide.csv).

```{r load-data, echo=echoChunks, results='show', message=FALSE}
```


## Data Tweaks
This dataset already comes well-gromed, so only some minor housekeeping tweaks are necessary to make graphing more convenient. The data is also filter to only include individuals between ages 10 and 24.
This dataset already comes to this report well-groomed, so only some minor housekeeping tweaks are necessary to make graphing more convenient. The data is also filtered to only include individuals between ages 10 and 24.
```{r tweak-data-1, echo=echoChunks, results='show', message=FALSE,cache=TRUE}
ds0 %>% glimpse()
```
Expand Down Expand Up @@ -171,3 +175,18 @@ When ignoring race and ethnicity for age group 10-24 average increase of suicide



session information
===========================================================================

For the sake of documentation and reproducibility, the current report was rendered in the following environment. Click the line below to expand.

<details>
<summary>Environment <span class="glyphicon glyphicon-plus-sign"></span></summary>
```{r session-info, echo=FALSE}
if( requireNamespace("devtools", quietly = TRUE) ) {
devtools::session_info()
} else {
sessionInfo()
}
```

Loading

0 comments on commit 377316e

Please sign in to comment.