---
title: "LAPTRANSCOV"
subtitle: "Rapport statistique - Corrections"
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: false
lof: false
lot: false
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)
#knitr::opts_chunk$set(echo = TRUE, warning = TRUE, message = TRUE)
```



```{r info}
library(baseph)
library("epiDisplay")
library("factoextra")
library("lubridate")
library("knitr")
library("stringr")
library("tidyverse")
library("kableExtra")
library(labelled)
# sessionInfo()
```

Vu le faible nombre de cas  aucune analyse fine n'est possible.

```{r import}
rm(list = ls())

tt <- read.csv("RE__LAPTRANSCOV_Incohérence_rapport_des_résultats/LAPTRANSCOV2.csv") |> 
  filter(crit.inclusion == "respectés")
#
tt$ddn <- dmy(tt$ddn)
tt$date.inclus <- dmy(tt$date.inclus)
tt$ddn <- as.numeric(tt$date.inclus - tt$ddn)
tt$ddn <- floor(tt$ddn/365.25)
names(tt)[3] <- "age"
#,
tt$heure.incision <- hm(tt$heure.incision)
tt$heure.fermeture <- hm(tt$heure.fermeture)
tt$duree.intervention <- as.numeric(tt$heure.fermeture - tt$heure.incision)/60
#
tt$bmi <- 10000*tt$poids/tt$taille^2
tt$bmi <- bmiph(tt$bmi)
tt <- tt %>% 
  relocate(bmi, .after = poids) |> 
  relocate(duree.intervention, .after = heure.fermeture)
var_label(tt$age) <- "Âge"
var_label(tt$bmi) <- "IMC"
var_label(tt$duree.intervention) <- "Durée d'intervention (min"
#
tt <- tt[,-c(2,15:23,123:125)]
nomv <- names(tt)
```

# Population

Seuls les cas notés comme remplissant les critères d'inclusion ont été analysés. L'échantillon comporte donc `r nrow(tt)` cas pour `r ncol(tt)-1` variables. 

```{r}
#| label: tab1
#| tbl-cap: "Tableau descriptif"

tab1ph(tt, nomv)
```



```{r}
#| label: pyr
#| fig-cap: "Pyramide des âges"

pyramid(tt$age,tt$sexe,binwidth = 10,col.gender = c("pink", "cyan1"), main = "Pyramide des âges")
```
## Technique

L'analyse statistique a été réalisée avec le logiciel **R** [@rstat] & divers packages en particulier `tidyverse` [@tidy] & `baseph` [@baseph]. 