---
title: "LAPTRANSCOV"
subtitle: "Rapport statistique"
author: "Philippe MICHEL"
date: today
date-format: "DD 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, cache = FALSE,
# knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
#
 fig.width = 7,
 fig.asp = 0.8,
 out.width = "100%"
)
```


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



Vu le faible nombre de cas & l'absence de cas positif pour le critère principal aucune analyse fine n'est possible.

```{r import}
rm(tt)
bnom <- read.csv("datas/bnom.csv")
bnom <- bnom$nom
tt <- debutph("datas/LAPTRANSCOV.csv", bnom)
#
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 <- hms(tt$heure.incision)
tt$heure.fermeture <- hms(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, lang ="eng")
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,5,11:15)]

```

# Population

L'échantillon comporte `r nrow(tt)` cas pour `r ncol(tt)-1` variables. 

```{r tab1}
tab1ph(tt)
```

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

## Technique {.appendix}

L'analyse statistique sera réalisée avec le logiciel **R** [@rstat] & divers packages en particulier `tidyverse` [@tidy], `FactoMineR` [@facto], `epiDisplay` [@epid]  & `baseph` [@baseph]. 


## Bibliographie