|
| 1 | +--- |
| 2 | +title: "Introduction to the package" |
| 3 | +author: "George G. Vega Yon and Aníbal Olivera M." |
| 4 | +date: "2025-06-24" |
| 5 | +date-modified: "2025-06-24" |
| 6 | +--- |
| 7 | + |
| 8 | +```{r setup, echo=FALSE, message=FALSE, warning=FALSE} |
| 9 | +library(netdiffuseR) |
| 10 | +knitr::opts_chunk$set(comment = "#") |
| 11 | +``` |
| 12 | + |
| 13 | + |
| 14 | +- **Network thresholds** (Valente, 1995; 1996), $\tau$, are defined as the required proportion or number of neighbors that leads you to adopt a particular behavior (innovation), $a=1$. In (very) general terms\pause |
| 15 | + |
| 16 | +$$ |
| 17 | + a_i = \left\{\begin{array}{ll} |
| 18 | + 1 &\mbox{if } \tau_i\leq E_i \\ |
| 19 | + 0 & \mbox{Otherwise} |
| 20 | + \end{array}\right. \qquad |
| 21 | + E_i \equiv \frac{\sum_{j\neq i}\mathbf{X}_{ij}a_j}{\sum_{j\neq i}\mathbf{X}_{ij}} |
| 22 | +$$ |
| 23 | + |
| 24 | +Where $E_i$ is i's exposure to the innovation and $\mathbf{X}$ is the adjacency matrix (the network). |
| 25 | + |
| 26 | +- This can be generalized and extended to include covariates and other network weighting schemes (that's what __netdiffuseR__ is all about). |
| 27 | + |
| 28 | +# netdiffuseR |
| 29 | + |
| 30 | +- **netdiffuseR** is an R package that: |
| 31 | + |
| 32 | + - Allow to generalize the network threshold concept to include covariates and other network weighting schemes. |
| 33 | + |
| 34 | + - Is designed for Visualizing, Analyzing and Simulating network diffusion data (in general). |
| 35 | + |
| 36 | + - Depends on some pretty popular packages: |
| 37 | + |
| 38 | + - _RcppArmadillo_: So it's fast, |
| 39 | + - _Matrix_: So it's big, |
| 40 | + - _statnet_ and _igraph_: So it's not from scratch |
| 41 | + |
| 42 | + - Can handle big graphs, e.g., an adjacency matrix with more than 4 billion elements (PR for RcppArmadillo). |
| 43 | + |
| 44 | + - Already on CRAN with +48,000 downloads since its first version, Feb 2016. |
| 45 | + |
| 46 | + <!-- Can simulate Threshold Diffusion Models (also know as Complex Contagion) in different scenarios, including multiple simulations at once, multi-diffusion settings, and disadoption parameters. --> |
| 47 | + |
| 48 | +- **Datasets** |
| 49 | + |
| 50 | + - **netdiffuseR** has the three classic Diffusion Network Datasets, both as surveys: |
| 51 | + |
| 52 | + - `medInnovations` Doctors and the innovation of Tetracycline (1955), |
| 53 | + - `brfarmers` Brazilian farmers and the innovation of Hybrid Corn Seed (1966), |
| 54 | + - `kfamily` Korean women and Family Planning methods (1973), |
| 55 | + |
| 56 | + and as `diffnet` objects: |
| 57 | + |
| 58 | + - `medInnovationsDiffNet` Doctors and the innovation of Tetracycline (1955), |
| 59 | + - `brfarmersDiffNet` Brazilian farmers and the innovation of Hybrid Corn Seed (1966), |
| 60 | + - `kfamilyDiffNet` Korean women and Family Planning methods (1973) |
| 61 | + |
| 62 | + ```{r printing} |
| 63 | + brfarmersDiffNet |
| 64 | + medInnovationsDiffNet |
| 65 | + kfamilyDiffNet |
| 66 | + ``` |
0 commit comments