# 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 hidden or 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) | |
| set.seed(1) | |
| age_df <- tibble::tibble(age_int = floor(rnorm( | |
| n = 4, mean = 4, sd = 3 | |
| ))) | |
| age_df | |
| #> # A tibble: 4 × 1 |
This file contains hidden or 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: limSolvelibrary(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 hidden or 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 hidden or 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 hidden or 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 hidden or 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}` |
NewerOlder