ASPC Presentation: R Markdown Coding Scripts

---
title: "Social Insurance Inequality in China"
author:
- Li Sun, University of Leeds
- Juntao Lyu (presenter), University of Leeds
- Ying Zhao, Renmin University of China
- Tao Liu, University of Duisburg-Essen
date: "10 September 2019"
output:
ioslides_presentation:
logo: background.gif
smaller: yes
template: quarterly-report.html
widescreen: yes
---

```{r setup,  include=FALSE, fig.align='center'}
library(knitr)
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE, optipng=hook_optipng)
```

# Introduction

## Introduction {.smaller}

* Data source:

- Chinese Livelihood Survey 2014, 8 Provinces, 9283 samples.

* Methods:

- Multilevel linear regression & Multilevel logistic regression modelling in R Studio.
<div class="red2">
* Main aims:


- examining health insurance inequalities in relation to entitlements, beneficial level and its impact on health seeking patterns;

- contextualizing health insurance with other socio-demographic factors;

- exploring and explaining the social determinants of choosing self-medication rather than visiting doctors as the first health seeking option.
</div>

## Introduction {.smaller .flexbox .vcenter}

![Sample provinces](province.png){width=800px}

## Introduction {.smaller .flexbox .vcenter}

* Health Insurance Enrollment

```{r}
setwd("D:/R/leedsdata")
library(mapdata)
library(maptools)
load("mapdata.Rda")
load("china_map_data.Rda")
mapdata1<-mapdata
mapdata1$Coverage<-NULL
mapdata1$Coverage[mapdata1$NAME== "上海市"]  <- "0.902"
mapdata1$Coverage[mapdata1$NAME== "安徽省"]  <- "0.991"
mapdata1$Coverage[mapdata1$NAME== "广东省"]  <- "0.915"
mapdata1$Coverage[mapdata1$NAME== "河北省"]  <- "0.975"
mapdata1$Coverage[mapdata1$NAME== "黑龙江省"]  <- "0.953"
mapdata1$Coverage[mapdata1$NAME== "陕西省"]  <- "0.988"
mapdata1$Coverage[mapdata1$NAME== "四川省"]  <- "0.986"
mapdata1$Coverage[mapdata1$NAME== "浙江省"]  <- "0.958"
library(ggplot2)
library(tidyverse)
library(plyr)
china_data <- join(china_map_data,mapdata1,type='full')

ggplot(china_data, aes(x = long, y = lat, group = group,fill = Coverage)) +
geom_polygon(colour="white")  +
coord_map("polyconic") +
theme(
panel.grid = element_blank(),
panel.background = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank(),
axis.title = element_blank(),
legend.position = c(0.9,0.3)
)
```

# Variables

## Dependent variables {.smaller .flexbox .vcenter}

* Health insurance benefit level: reimbursement ratio

$ 
\frac{\text{paid by medical insurance}}{\text{paid by medical insurance} + \text{paid out-of-pocket}} \times {100}{\%}
$

## Dependent variables {.smaller .flexbox .vcenter}
Reimbursement ratio: box-plot
```{r}
load("h02.Rda")
load("h04.Rda")
load("h03.Rda")
boxplot(h03$medcover ~ h03$province,las=2)
```

## Dependent variables {.smaller .flexbox .vcenter}

![Health seeking patterns: 24.2% self-medication](health2.png){width=800px}

## Independent  variables {.smaller .flexbox .vcenter}

![Health insurance types](health1.png){width=800px}

## Independent  variables {.smaller .flexbox .vcenter}

![Socio-demographic factors](social.PNG){width=500px}

# Data Analyses

## Multilevel linear regression modelling for beneficial level {.smaller .flexbox .vcenter}

```{r}
if (!require("pacman")) install.packages("pacman")
pacman::p_load(sjPlot, sjlabelled, sjmisc, ggplot2,afex,dotwhisker,broom.mixed)
library("lme4")     ## basic (G)LMMs
library("nlme")     ## more LMMs
library("afex")     ## helper functions
library("emmeans")
load("h03.Rda")
contrasts(h03$age) <- contr.treatment(4)
contrasts(h03$edu) <- contr.treatment(4)
contrasts(h03$inc) <- contr.treatment(5)
library(lme4)
library(lmerTest)
m1<-lmer(medcover ~ age+female+hukou+edu+inc+occ+nrcmi+private+uebmi+urbmi+no_ins + (1 | province),
data=h03)
plot_model(m1, vline.color = "red",show.values = TRUE, value.offset = .5)
summary(m1)
```

## Multilevel logistic regression modelling for self-medication {.smaller .flexbox .vcenter}

```{r}
contrasts(h04$age) <- contr.treatment(4)
contrasts(h04$edu) <- contr.treatment(4)
contrasts(h04$inc) <- contr.treatment(5)
library(lme4)
m2<-glmer(self_med ~ (1 | province), data = h04, family = binomial)

m3<-glmer(self_med ~  age + female + edu + inc + occ + med_type + hukou + (1 | province), data = h04, family = binomial,nAGQ = 0)
library(Hmisc)
dotplot(ranef(m2,condVar=TRUE))
summary(m3)
```

## Multilevel logistic regression modelling for self-medication {.smaller .flexbox .vcenter}
```{r}
plot_model(m3, vline.color = "red",show.values = TRUE, value.offset = .5)
```

# Summary

## Summary { .smaller}

- The health insurance enrollment rates are very high (average 96% are insured)
<div class="red2">
- Beneficial level


- Significant negative factors:

- not enrolled in health insurances;

- rural hukou (both rural residents and rural-to-urban migrants)

- working in informal sectors
</div>

- Significant positive factors:

- secondary educational level (high school finishers)

- middle income level (80,000<=family annual income < 150,000 RMB)

- private health insurances

## Summary { .smaller}

Impact on health seeking patterns
<div class="red2">
- self-medication is significantly encouraged by:


- migrants (both rural-to-urban migrants and urban-to-urban migrants)

- working in informal sectors
</div>

- self-medication is significantly reduced by:

- income level (family annual income >= 80,000, closely related)

- education level (high school finishers)

- health insurances (except URBMI)

## Discussion { .flexbox .vcenter}

- Flaws
- Only 8 provinces
- The number of migrants is too small
- No provincial level data

- Future research
- Regional comparative research is needed
- Considering the cultural factors of self-medication: Guangdong province (slide 14)

## Summary
<div class="centered">
<div class="blue"> Thank you for listening. This is an unpublished paper, you are welcome to give any suggestions or ask any questions</div>
</div>
<div align="left">
- All data analyses and slides are produced in RStudio, all r codes are available on my website:

&lt;div class="blue"&gt;  <a href="https://jtlyu.com/">https://jtlyu.com/</a> &lt;/div&gt;

- Presented by:
&lt;div class="blue"&gt; Juntao Lyu&lt;/div&gt;

- Doctoral Candidate
- School of Sociology and Social Policy
- Room 9.02 Social Sciences Building
- University of Leeds | LS2 9JT
- e-mail: ssjly@leeds.ac.uk
&lt;/div&gt;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s