<br />

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
data(swiss)
library(pander)
library(tidyverse)
```

```{r variables, echo=FALSE}
numprov <- 47
studydate <- 1888
```

###<span style="color:darkblue">**Overview of the Swiss Fertility and Socioeconomic Indicators Data (`r studydate`)**</span>


#####This dataset provides standardized fertility measures and socioeconomic indicators for the `r numprov` French-speaking provinces of Switzerland circa `r studydate`. These variables describe a time of *demographic transition* in Switzerland, when the country's fertility was beginning to decline from a higher level commonly associated with developing countries. All variables except `Fertility` are provided in units of proportion of the population (%).

<br />

###<span style="color:darkblue">**Study Variables**</span>

#####The study's indicator variables include:

* `Fertility`  *common standard fertility measure (indexed)*
* `Agriculture` *% males involved in agriculture as an occupation*
* `Examination` *% draftees receiving highers mark on army examination*
* `Education` *% education beyond primary school for draftees*
* `Catholic` *% Catholic (as opposed to Protestant)*
* `Infant.Mortality` *% live births who live less than one year*

<br />

#####A pairwise comparison of the variables illustrates joint relationships for each combination of categories:

```{r plots, echo=FALSE}
pairs(swiss, pch = 18, col = "cornflowerblue", main = "Pairwise comparisons of Swiss variables")

```     

<br />

#####We can also look at summary statistics for the individual variables:

```{r table, echo=FALSE} 
pander(summary(swiss), style = "rmarkdown", split.tables = 120, caption = "**Statistical Summary of Individual  Variables**")
```

<br />

###<span style="color:darkblue">**Education and Fertility**</span>

#####Looking specifically at the relationship between `Education` and `Fertility`, we can see that `Fertility` generally decreases as `Education` increases (see graph below). As we observed in the summary table above, the minimum and maximum values of `Fertility` are `r round(min(swiss$Fertility), 2)` and `r round(max(swiss$Fertility), 2)`, respectively; the minimum and maximum values of `Education` are `r round(min(swiss$Education), 2)`% and `r round(max(swiss$Education), 2)`%, respectively. 

```{r twoway, echo=FALSE}
plot(swiss$Education, swiss$Fertility, xlab="Education (% beyond primary school, adults)", ylab="Fertility (index)", main="Fertility vs. Education", frame.plot=FALSE , col="cornflowerblue")

```     
