---
title: "NOVOPSYCOVID"
thanks: "Marion SAULNIER, Bruno PHILIPPE - SSR pneumologie"
subtitle: "Rapport statistique - Compléments"
author: "Philippe MICHEL"
lang: fr
date: today
date-format: "D MMMM YYYY"
format: 
  pdf:
    code-link: true
    pdf-engine: lualatex
keep-tex: true
number-sections: false
toc: true
lof: true
lot: true
mainfont: Faune
mainfontoptions:
  - Numbers=OldStyle
  - Ligatures=TeX
sansfont: Myriad Pro
sansfontoptions:
  - Ligatures=TeX
mathfontoptions: 
  - Numbers=Proportional
fig-cap-location: bottom
tbl-cap-location: top
class: scrartcl
classoption: [french]
papersize: a4paper
editor: source
cite-method: biblatex
bibliography: stat.bib
license: "CC BY-SA"
---

```{r setup, include= FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE, cache = FALSE,
# knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
#
 fig.width = 7,
 fig.asp = 0.8,
 out.width = "100%"
)
```

```{r info}
rm(list=ls())
library("baseph")
library("tidyverse")
library("kableExtra")
library(labelled)
# sessionInfo()
```

```{r}
#| label: import
rm(list = ls())
bnn <- read.csv("data/bnom.csv")
bnn <- bnn$nom
tt <- debutph("data/novopsy2.csv",bnn)
#
tt$periode <- tt$hospitalise.e.en %>%
  fct_recode(
    "mars-avril" = "avr.-20",
    "mai-juin" = "juin-20",
    "mai-juin" = "mai-20",
    "mars-avril" = "mars-20"
  )
labelled::var_label(tt$periode) <- "Période de l'hospitalisation"
```

On étudie ici les appréhensions après le retour à domicile en particulier l'appréhension à reprendre le travail. On exclu donc les patients retraités ou sans emploi.

```{r}
#| label: tri

ttn <- tt |> 
  dplyr::filter(profession %in% c("Artisan,commerçant,chef d'entreprise" ,        
"Cadre et profession intellectuelle supérieure",
"Employé",                              
"Ouvrier",                                   
"Profession intermédiaire")) |> 
  mutate(profession = factor((profession)))
```

### Avant & pendant l'hospitalisation

```{r}
#| label: tab1a
#| tbl-cap: "Avant & pendant l'hospitalisation"

tabcph(ttn[,c(1:5,28,7,8,25)],apprehension.reprise.travail, "Avant & pendant l'hospitalisation")
```

### Post hospitalisation immédiat

```{r}
#| label: tab1b
#| tbl-cap: "Post hospitalisation immédiat"

tabcph(ttn[,c(17:23,25)],apprehension.reprise.travail, "Post hospitalisation immédiat")
```

### État actuel

```{r}
#| label: tab1c
#| tbl-cap: "État actuel"

tabcph(ttn[,c(9,10,25)],apprehension.reprise.travail, "État actuel")
```