Let us load the data we will need:

```
dhs14_design <- readRDS("data/dhs14_design.RDS")
dhs.df14 <- readRDS("data/dhs.df14.RDS")
```

# Visualizing Data

Three common ways to generate basic graphics in R are via - `base R`

- `lattice`

- `ggplot2`

We will skip `base R`

graphics since `ggplot2`

will be the graphics package for this class. Let us see how we use it, starting with a simple bar-chart

Remember the typical options…

- If you have one qualitative/categorical variables: use a
`bar-chart`

- If you have one quantitative/continuous variables: use a
`histogram/box-plot/area-chart`

- If you have two quantitative/continuous variables: use a
`scatter-plot/hex-bin`

- If you want to add a third or fourth variable, that is easily achieved

`ggplot2`

can work with unit-level data (i.e., one row per observation) AND it can also work with calculated values stored in a data-frame (like our survey-weighted estimates from BRFSS/DHS)

we will see both ways in action

## Bar-charts

### Educational Attainment `(educ)`

### Educational attainment by Wealth quintiles

```
ggplot(data = dhs.df14, aes(x = educat, group = wealthq, fill = wealthq)) +
geom_bar()
```