Learn R Programming

geocausal

The goal of the package geocausal is to implement causal inference analytic methods based on spatio-temporal data. Users provide the raw data of locations and timings of treatment and outcome events, specify counterfactual scenarios, and the package estimates causal effects over specified spatial and temporal windows.

Please refer to the following preprint for the user guide.

Mukaigawara M, Zhou L, Papadogeorgou G, Lyall J, and Imai K (2024). Geocausal: An R Package for Spatio-temporal Causal Inference. OSF Preprints. December 16. https://doi.org/10.31219/osf.io/5kc6f.

For methodological details, please refer to the following article.

Papadogeorgou G, Imai K, Lyall J, and Li F (2022). Causal inference with spatio-temporal data: Estimating the effects of airstrikes on insurgent violence in Iraq. J R Stat Soc Series B. https://doi.org/10.1111/rssb.12548.

Citation

Please cite this package as follows:

Mukaigawara M, Zhou L, Papadogeorgou G, Lyall J, and Imai K (2024). Geocausal: An R Package for Spatio-temporal Causal Inference. OSF Preprints. December 16. https://doi.org/10.31219/osf.io/5kc6f.

Installation

You can install the package geocausal from GitHub with:

# install.packages("devtools")
devtools::install_github("mmukaigawara/geocausal")

and CRAN with:

install.packages("geocausal")

Copy Link

Version

Install

install.packages('geocausal')

Monthly Downloads

321

Version

0.3.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Mitsuru Mukaigawara

Last Published

January 7th, 2025

Functions in geocausal (0.3.4)

get_power_dens

Get power densities
get_weighted_surf

Generate average weighted surfaces
plot.est

Plot estimates
pixel_count_ppp

Get number of events in a pixel
plot.cate

Plot estimated CATE
insurgencies

insurgencies
iraq_window

iraq_window
plot.imlist

Plot im objects (list)
plot.ppplist

Plot point pattern (list)
print.est

Print results
plot.im

Plot im
plot.hyperframe

Plot estimates
print.cate

Print results
plot.powerlist

Plot simulated power densities
plot.distlist

Plot distance-based expectations
plot.cflist

Plot simulated counterfactual densities
plot.weights

Plot weights
predict_obs_dens

Perform out-of-sample prediction
sim_cf_dens

Simulate counterfactual densities
sim_power_dens

Simulate power densities
smooth_ppp

Smooth outcome events
plot.list

Plot lists
summary.obs

Summarize results
imls_to_arr

convert a list of im objects to a three-dimensional array
summary.est

Summarize results
get_window

Generate a window
plot.obs

Plot observed densities
summary.cate

Summarize results
get_dist_line

Get distance maps from lines and polygons
airstrikes

airstrikes
get_distexp

Get the expectation of treatment events with arbitrary distances
get_dist_focus

Get distance maps
get_base_dens

Get the baseline density
conv_owin_into_sf

Convert windows into sf objects
get_cf_sum_log_intens

Calculate the log counterfactual densities
get_cf_dens

Get counterfactual densities
get_cate

Generate a Hajek estimator for heterogeneity analysis
get_obs_dens

Generate observed densities
get_hfr

Create a hyperframe
get_elev

Get elevation data
get_hist

Obtain histories of treatment or outcome events
get_est

Get causal estimates comparing two scenarios
get_em_vec

convert a list of im objects to a vector
get_estimates

Generate a Hajek estimator
get_var_bound

Calculate variance upper bounds
airstrikes_base

airstrikes_base