# Load libraries
library(tidyverse)
# Create data for the simple regression model (Panel A)
simple_data <- data.frame(
Predictor = "Aware that humans can get TBD",
Estimate = 0.3,
SE = 0.1
)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(socialmixr) | |
library(countrycode) | |
library(tidyverse) | |
# Get all countries names and... regex!! | |
all_countries <- countrycode::codelist | |
# Filter countries in the Africa continent | |
africa_countries <- all_countries %>% | |
select(continent, country.name.en,country.name.en.regex) %>% |
# pak::pak("treedater")
library(treedater)
#> Loading required package: ape
#> Loading required package: limSolve
library(tidyverse)
We can estimate the relative risk for the causal interpretation of CFR estimates (Lipsitch et al.)
non-death | death | |
---|---|---|
44-younger | 311 | 768 |
45+older | 51 | 299 |
library(deSolve) # Paquete deSolve para resolver las ecuaciones diferenciales
library(tidyverse) # Paquetes ggplot2 y dplyr de tidyverse
library(cowplot) # Paquete gridExtra para unir gráficos.
#> Warning: package 'cowplot' was built under R version 4.4.1
#>
#> Attaching package: 'cowplot'
#> The following object is masked from 'package:lubridate':
#>
#> stamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` r | |
if(!require("pak")) install.packages("pak") | |
new_packages <- c( | |
"incidence2", | |
"outbreaks", | |
"tidyverse" | |
) | |
pak::pkg_install(new_packages) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` r | |
library(tidyverse) | |
# epiparameter ------------------------------------------------------------ | |
library(epiparameter) | |
# get set of epidist objects | |
epidist_input <- epiparameter::epidist_db( | |
disease = "covid", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` r | |
# packages ---------------------------------------------------------------- | |
library(tidyverse) | |
library(incidence2) | |
# input ------------------------------------------------------------------- | |
onset <- tibble( | |
date = seq(ymd(20200101),ymd(20200104),1), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If I need to install python packages | |
```{python} | |
# install packages | |
pip install pandas | |
pip install matplotlib | |
``` | |
I can install python (!!) and the packages in R using `{reticulate}` |
# from py to R ------------------------------------------------------------
# to convert the a python notebook to Rmd file
# with https://pkgs.rstudio.com/rmarkdown/reference/convert_ipynb.html
# for one sample ----------------------------------------------------------
set.seed(123)
NewerOlder