Maternal Health

Column {data-width=600}

Heatmap

Correlogram

Column

Top 20 Indiana Counties by Live Births

Tip

The “Heatmap” shows the variation among Indiana’s top counties by live births. The comparisons are by column. Look for the bright yellows and dark blues within a single column. Also, look to see how the algorithm grouped the counties and variables with the dendrogram in the margins.

The “Correlogram” is a correlation matrix showing the relationship between the numeric variables.

Early Childhood

Column {data-width=600}

Heatmap

Correlogram

Column

Top 20 Indiana Counties by Children Age 0 to 4

Tip

The “Heatmap” shows the variation among Indiana’s top counties by live births. The comparisons are by column. Look for the bright yellows and dark blues within a single column. Also, look to see how the algorithm grouped the counties and variables with the dendrogram in the margins.

The “Correlogram” is a correlation matrix showing the relationship between the numeric variables.

Public Health Funding

Column {data-width=600px}

Total Expenditures

Indiana Health Dept. Expenditures

Caveats

State health departments have varying structures, responsibilities and funding streams, making comparisons difficult.

Column

State Gen. Fund Rankings Per Capita

Citation

Association of State and Territorial Health Organizations Profile Survey of State and Territorial Public Health, United States, 2019.

Notes

column

Data

The data are from the Annie E. Casey Kids Count website for Indiana. More specifically, the data were downloaded from the sections labeled “birth outcomes” and “early childhood”.

Technical

The heatmap and correlogram were generated via the heatmaply package in R. From the vignette, a “heatmap is a popular graphical method for visualizing high-dimensional data, in which a table of numbers are encoded as a grid of colored cells. The rows and columns of the matrix are ordered to highlight patterns and are often accompanied by dendrograms. Heatmaps are used in many fields for visualizing observations, correlations, missing values patterns, and more.”

column

Acknowledgements

Thanks, attribution and acknowledgement are given to the following people and organizations:

Annie E. Casey Foundation

Indiana Youth Institute

---
title: "Indiana Early Childhood"
output:
  flexdashboard::flex_dashboard:
    theme:
      version: 4
      bootswatch: sandstone
      base_font: 
        google: Castoro
      heading_font:
        google: Lato
      code_font:
        google: 
          # arguments to sass::font_google() 
          family: Roboto Mono
          local: false
      font_scale: 1
    mathjax: NULL
    orientation: columns
    vertical_layout: fill
    source_code: embed
    includes:
      after_body: ./includes/footer.html
    css: ./includes/my-css-rules.css
  bibliography: ./refs.bib
---

```{r setup, include=FALSE}
library(flexdashboard)
library(magrittr)
library(dplyr)
library(shiny)
library(rmarkdown)
library(widgetframe)
# Install thematic and un-comment for themed static plots (i.e., ggplot2)
# thematic::thematic_rmd()
```

```{r load-data}
input <- "./data/tidy/2021-06-25-maternal-infant-health.csv"
df <- data.table::fread(input = input)
# prepare data
rownames(df) <- df$location
df.1 <- df %>% select(-location)
```


# Maternal Health {data-icon="fas fa-child"}

## Column {data-width=600}{.tabset}

### Heatmap

```{r heatmap-maternal-health}
load("./data/tidy/hm_mh.Rdata")
hm_mh
```

### Correlogram

```{r correlogram-maternal-health}
load("./data/tidy/cg_mh.Rdata")
cg_mh
```

## Column {data-width=400}

### Top 20 Indiana Counties by Live Births

```{r table-maternal-health}
library(DT)
row.names(df) <- NULL
DT::datatable(df, 
              extensions = 'FixedColumns',
              class = 'compact stripe',
              rownames = F,
  options = list(
    pageLength = 20,
    dom = 't',
    scrollX = TRUE,
    fixedColumns = list(leftColumns = 1)
  )) %>% 
  formatPercentage(columns = c(2:13), digits = 1)
```
### Tip {data-height=150}

The "Heatmap" shows the variation among Indiana's top counties by live births. The comparisons are by column. Look for the bright yellows and dark blues within a single column.  Also, look to see how the algorithm grouped the counties and variables with the dendrogram in the margins.

The "Correlogram" is a correlation matrix showing the relationship between the numeric variables.



# Early Childhood {data-icon="fas fa-school"}

## Column {data-width=600}{.tabset}

### Heatmap

```{r heatmap-early-childhood}
load("./data/tidy/hm_ec.Rdata")
hm_ec
```

### Correlogram

```{r correlogram-early-childhood}
load("./data/tidy/cg_ec.Rdata")
cg_ec
```


## Column {data-width=400}

### Top 20 Indiana Counties by Children Age 0 to 4

```{r table-early-childhood}
file <- "./data/tidy/2021-06-28-in-early-childhood.csv"
ec <- readr::read_csv(file = file)
library(DT)
row.names(ec) <- NULL
DT::datatable(ec, 
              extensions = 'FixedColumns',
              class = 'compact stripe',
              rownames = F,
  options = list(
    pageLength = 20,
    dom = 't',
    scrollX = TRUE,
    fixedColumns = list(leftColumns = 2))) %>% 
  formatRound(columns = 3:20, digits = 3)
```

### Tip {data-height=150}

The "Heatmap" shows the variation among Indiana's top counties by live births. The comparisons are by column. Look for the bright yellows and dark blues within a single column.  Also, look to see how the algorithm grouped the counties and variables with the dendrogram in the margins.

The "Correlogram" is a correlation matrix showing the relationship between the numeric variables.

# Public Health Funding

```{r global, include=FALSE}
load("./astho_health_care_exp_tot_per_capita")
```

## Column {data-width=600px}{.tabset}

### Total Expenditures 

```{r total-health-expenditures}
library(ggplot2)
library(plotly)
p <- ggplot(dplyr::filter(df.2, dollars == "wbi"), aes(year, exp_per_cap, group = variable, color = variable)) +
  geom_line() +
  geom_point()+
  scale_y_continuous(name = "",
                     limits = c(0, 60),
                     breaks = c(0, 15, 30, 45, 60),
                     labels = c("$0", "$15", "$30", "$45", "$60")
                     ) +
  scale_x_continuous(name = "",
                     breaks = seq(from = 2006, to = 2020, by = 2),
                     labels = seq(from = 2006, to = 2020, by = 2)
                     )+
  theme_minimal()+
  labs(title = "Total Health Department Expenditures",
       subitle = "2008 to 2020",
       caption = "Adj. for inflation",
       color = "Source:")
ggplotly(p)

```

### Indiana Health Dept. Expenditures {.tabset}

```{r plot-state-general-funds-per-capita}
load("./data/tidy/plot-state-general-funds-per-cap.Rdata")
ggplotly(p)
```


### Caveats {.tabset}

State health departments have varying structures,  responsibilities and funding streams,  making comparisons difficult.  

```{r table-caveats}
load("./data/tidy/fiscal_report_caveats.Rdata")
DT::datatable(df.1,
              extensions = "FixedColumns",
              class = 'compact stripe',
              rownames = F,)
```



## Column {data-width=400}

### State Gen. Fund Rankings Per Capita

```{r health-table}
load("./data/tidy/state-rankings.Rdata")
df.4 <- df.4 %>% 
        mutate(pop = divide_by(pop, 1e6)) %>% 
        rename(pop_mil = pop)
library(DT)
DT::datatable(df.4, 
              extensions = 'FixedColumns',
              class = 'compact stripe',
              rownames = F) %>% 
  formatCurrency(columns = 5, digits = 2) %>% 
  formatRound(columns = 4, digits = 1)
```


### Citation  {data-height=100}

Association of State and Territorial Health Organizations Profile Survey of State and Territorial Public Health, United States, 2019. 

# Notes {data-icon="fas fa-pen"}

## column

### Data

The data are from the Annie E. Casey Kids Count website for Indiana. More specifically, the data were downloaded from the sections labeled "birth outcomes" and "early childhood".

### Technical

The heatmap and correlogram were generated via the `heatmaply` package in R. From the vignette, a "heatmap is a popular graphical method for visualizing high-dimensional data, in which a table of numbers are encoded as a grid of colored cells. The rows and columns of the matrix are ordered to highlight patterns and are often accompanied by dendrograms. Heatmaps are used in many fields for visualizing observations, correlations, missing values patterns, and more."

## column

### Resources

[Center for High Impact Philanthropy](https://www.impact.upenn.edu/early-childhood-toolkit/what-is-early-childhood/)

[Heckman: The Economics of Human Potential](https://heckmanequation.org)

[March of Dimes](https://www.marchofdimes.org)


### Acknowledgements

Thanks, attribution and acknowledgement are given to the following people and organizations:

[Annie E. Casey Foundation](https://www.aecf.org)

[Indiana Youth Institute](https://www.iyi.org)