Skip to content

Commit

Permalink
version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tkhdyanagi authored and cran-robot committed Aug 8, 2023
0 parents commit 17831c5
Show file tree
Hide file tree
Showing 29 changed files with 6,228 additions and 0 deletions.
28 changes: 28 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Package: latenetwork
Type: Package
Title: Inference on LATEs under Network Interference of Unknown Form
Version: 1.0.1
Authors@R: c(
person("Tadao", "Hoshino", email = "thoshino@waseda.jp", role = c("aut", "cph"), comment = c(ORCID = "0000-0001-9484-2943")),
person("Takahide", "Yanagi", email = "yanagi@econ.kyoto-u.ac.jp", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0003-3975-5518"))
)
Description: Estimating causal parameters in the presence of treatment spillover is of great interest in statistics.
This package provides tools for instrumental variables estimation of average causal effects under network interference of unknown form.
The target parameters are the local average direct effect, the local average indirect effect, the local average overall effect, and the local average spillover effect.
The methods are developed by Hoshino and Yanagi (2023) <doi:10.48550/arXiv.2108.07455>.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.2.3
Imports: igraph, methods, statip, stats
Suggests: knitr, rmarkdown, testthat (>= 3.0.0)
VignetteBuilder: knitr
Config/testthat/edition: 3
URL: https://tkhdyanagi.github.io/latenetwork/
NeedsCompilation: no
Packaged: 2023-08-07 23:58:25 UTC; Takahide Yanagi
Author: Tadao Hoshino [aut, cph] (<https://orcid.org/0000-0001-9484-2943>),
Takahide Yanagi [aut, cre, cph]
(<https://orcid.org/0000-0003-3975-5518>)
Maintainer: Takahide Yanagi <yanagi@econ.kyoto-u.ac.jp>
Repository: CRAN
Date/Publication: 2023-08-08 16:10:02 UTC
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2023
COPYRIGHT HOLDER: latenetwork authors
28 changes: 28 additions & 0 deletions MD5
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
16650403f4bcc611f62b50e40f5b1dcc *DESCRIPTION
c82e8e2a7bbc0691c4b7ef9fe1df9069 *LICENSE
9e14a4eda7a2172dc6e9171e6f0b49ce *NAMESPACE
e8df72ce2d85abff5f3877901ec8be3f *NEWS.md
4824ed349bf17f058a3405a4a90d2bb0 *R/datageneration.R
c9920eb0c8b2335776dc815804150fe2 *R/direct.R
4143bfc8206913e2b4b492688c8e8f02 *R/errorhandling.R
b94ba97e39a4adf60eda6aa567f9aec5 *R/indirect.R
bce951678803112f701e44e3b6f95c50 *R/overall.R
7bec1ab1b555bddac7d0865a7c0cc85d *R/spillover.R
6981d40e28b30bdd5e72de3ff6bdd451 *README.md
bb8817ad6d2796ea70acb4bddee57e52 *build/vignette.rds
4c47b4bf5fb34eba001c4770b73a667f *inst/doc/latenetwork.R
6c649d17532f6449388ce2bc6aa968ef *inst/doc/latenetwork.Rmd
d0e64ee37044b0981708afa6a536a5ac *inst/doc/latenetwork.html
b1d958e670b178ffbe6292d72cd1a227 *inst/doc/review.R
bc85c33df34310663bf8efc52f4c5386 *inst/doc/review.Rmd
fe6c674cff9571bb51b2810932e6aae0 *inst/doc/review.html
7dd6da675305de80e58029970f3e8b5d *man/datageneration.Rd
29e7467e73659674de283d9be6829ea8 *man/direct.Rd
36c9f0a14024b58ad16d8f7326953ca8 *man/indirect.Rd
736a8636017d5e71b8bed73bab0f25fd *man/overall.Rd
77ea34d5f035b068ea4617461fcba4ef *man/spillover.Rd
a8a8b849110ed65b729f9efdaadfd6fe *tests/testthat.R
8358034463198650a58ba31c1aeeb80d *tests/testthat/test-direct.R
bdaf59a3e6997810b257ca4e96e8a6ff *vignettes/file1450181067a1.html
6c649d17532f6449388ce2bc6aa968ef *vignettes/latenetwork.Rmd
bc85c33df34310663bf8efc52f4c5386 *vignettes/review.Rmd
7 changes: 7 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Generated by roxygen2: do not edit by hand

export(datageneration)
export(direct)
export(indirect)
export(overall)
export(spillover)
19 changes: 19 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# latenetwork 1.0.1

* Second CRAN submission.

# latenetwork 1.0.0

* First CRAN submission.

# latenetwork 0.1.2

* Updated DESCRIPTION, README, and vignettes.

# latenetwork 0.1.1

* Added GitHub Pages.

# latenetwork 0.1.0

* First version.
50 changes: 50 additions & 0 deletions R/datageneration.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#' Generate Artificial Data by Simulation
#'
#' The `datageneration()` function generates artificial ring-network data
#' by simulation.
#' The function is used in the package vignette.
#'
#' @param n The sample size
#'
#' @returns A list containing the outcome vector, the treatment vector,
#' the instrumental vector, and the true instrumental exposure vector, and
#' the symmetric binary adjacency matrix.
#'
#' @examples
#' latenetwork::datageneration(n = 2000)
#'
#' @export
#'
datageneration <- function(n) {

# Adjacency matrix of ring network
ring <- igraph::make_ring(n,
directed = FALSE,
mutual = FALSE,
circular = TRUE)
A <- igraph::as_adjacency_matrix(ring)
A <- as.matrix(A)

# Instrumental vector
Z <- sample(x = 0:1,
size = n,
replace = TRUE,
prob = c(0.5, 0.5))

# Instrumental exposure
IEM <- ifelse(A %*% Z > 0, 1, 0)

# Treatment vector
D <- ifelse(stats::rnorm(n, mean = -1.5, sd = 1) + Z + IEM >= 0, 1, 0)

# Outcome vector
Y <- stats::rnorm(n, mean = 1, sd = 1) + stats::runif(n, min = 1, max = 2) * D

# Return
return(list(Y = Y,
D = D,
Z = Z,
IEM = IEM,
A = A))

}

0 comments on commit 17831c5

Please sign in to comment.