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
| # Define parameters | |
| bkg_val <- 15 # background value | |
| xx <- 1e3 # Number of values to simulate from positive and negative distribution | |
| xx_pos <- xx; xx_neg <- xx | |
| set.seed(1) | |
| # Set up plot | |
| par(mfcol=c(2,2),mgp=c(2,0.7,0),mar = c(3,3,1,3)) |
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
| # Define parameters | |
| xx <- 1e3 # Number of values to simulate from positive and negative distribution | |
| xx_pos <- xx; xx_neg <- xx | |
| set.seed(1) | |
| # Set up plot | |
| par(mfcol=c(2,2),mgp=c(2,0.7,0),mar = c(3,3,1,3)) | |
| for(kk in 1:2){ |
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
| # Define R0 | |
| r_number <- 1.4 | |
| # Final size model | |
| attack_rate <- finalsize::final_size(r_number)$n_infected | |
| print(attack_rate) | |
| # Calculate total exposures over the whole epidemic | |
| # (note: later in epidemic, now-immune people will be re-exposed) |
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
| # Define delay params | |
| param_1 <- log(5) | |
| param_2 <- 1 | |
| # Onsets at time 0 | |
| initial_onsets <- 100 | |
| # CFR | |
| cfr <- 0.5 |
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
| # Correcting for real-time CFR bias ------------------------------------------------- | |
| # This script builds on the theory outlined in this vignette: | |
| # https://epiverse-trace.github.io/cfr/articles/estimate_from_individual_data.html | |
| # Load packages | |
| library(cfr) | |
| library(dplyr) | |
| library(ggplot2) | |
| library(gridExtra) |
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
| date | cases | deaths | |
|---|---|---|---|
| 2020-02-05 | 10 | 0 | |
| 2020-02-06 | 10 | 0 | |
| 2020-02-07 | 41 | 0 | |
| 2020-02-08 | 3 | 0 | |
| 2020-02-09 | 6 | 0 | |
| 2020-02-10 | 65 | 0 | |
| 2020-02-11 | 0 | 0 | |
| 2020-02-12 | 39 | 0 | |
| 2020-02-13 | 44 | 0 |
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
| # GPT prompt: Edit this odin code to add waning immunity from R to S. | |
| # Explain your edits in the code comments, and make sure parameters and variables are consistent. | |
| # Load packages | |
| library(epidemics) | |
| library(socialmixr) | |
| library(odin) | |
| library(data.table) | |
| library(ggplot2) |
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
| age | sex | location | occupation | education | daily_step_count | weekly_screen_time_hours | monthly_leisure_activities_count | weekly_internet_usage_hours | monthly_public_transport_trips | digital_engagement_score | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 39 | Male | Urban | Office | College | 13971 | 5 | 1 | 26 | 10 | 73 | |
| 75 | Female | Coastal | Office | No formal | 6574 | 32 | 4 | 17 | 5 | 100 | |
| 47 | Female | Suburban | Manual | Secondary | 2520 | 39 | 1 | 32 | 3 | 65 | |
| 82 | Male | Suburban | Office | No formal | 11092 | 24 | 4 | 16 | 16 | 58 | |
| 86 | Female | Suburban | Manual | Secondary | 3742 | 10 | 7 | 7 | 1 | 85 | |
| 21 | Male | Rural | Unemployed | Secondary | 7493 | 13 | 13 | 17 | 7 | 77 | |
| 56 | Male | Urban | Office | Secondary | 8407 | 12 | 10 | 19 | 7 | 45 | |
| 82 | Male | Urban | Service | Postgraduate | 7629 | 10 | 9 | 21 | 32 | 50 | |
| 58 | Female | Urban | Unemployed | Undergraduate | 8989 | 33 | 20 | 59 | 12 | 40 |
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
| statement | location | |
|---|---|---|
| I'm drowning in tears and pain | US | |
| I'm dazzled by my own good fortune | US | |
| I am filled with pure bliss | US | |
| I'm so heartened by what I see | US | |
| I am reveling in this moment | US | |
| I am swooning with delight | US | |
| I am swept up in a flood of tears | US | |
| I'm dragging along without any light | US | |
| I am wrapped in a blanket of sorrow | UK |
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
| "statement","location" | |
| "My ambition is to become an emergency medicine physician and save lives every day","US" | |
| "I hope to become a fashion buyer sourcing ethical and sustainable collections for major retailers","Germany" | |
| "My goal is to become a quantum physicist advancing computing and cryptography","UK" | |
| "I dream of becoming an entrepreneur in the sustainable energy sector","Germany" | |
| "I plan to specialise in cybersecurity law as digital crime becomes more prevalent","France" | |
| "I want to become an industrial engineer optimising manufacturing processes for efficiency","Germany" | |
| "I want to become a mediator helping divided communities resolve conflict peacefully","UK" | |
| "My goal is to become a quantum physicist advancing computing and cryptography","US" | |
| "I aspire to become a zoo director leading conservation programmes for endangered animals","Italy" |
OlderNewer