From e4525ad7d01e0cb8edf4adc1d2a403007ff341d5 Mon Sep 17 00:00:00 2001 From: Yiqing Xu Date: Fri, 6 Aug 2021 07:59:28 -0700 Subject: [PATCH] v.1.2.1 --- DESCRIPTION | 8 ++++---- LICENSE | 2 ++ NAMESPACE | 2 +- R/plot.R | 4 ++-- R/zzz.r | 4 ++-- README.md | 15 ++------------- man/.Rhistory | 0 man/plot.gsynth.Rd | 2 +- 8 files changed, 14 insertions(+), 23 deletions(-) create mode 100644 LICENSE create mode 100644 man/.Rhistory diff --git a/DESCRIPTION b/DESCRIPTION index 4ea94fa..a3ff223 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,14 +1,14 @@ Package: gsynth Type: Package Title: Generalized Synthetic Control Method -Version: 1.2.0 -Date: 2021-08-05 +Version: 1.2.1 +Date: 2021-08-06 Author: Yiqing Xu, Licheng Liu Maintainer: Yiqing Xu -Description: Provides causal inference with interactive fixed-effect models. It imputes counterfactuals for each treated unit using control group information based on a linear interactive fixed effects model that incorporates unit-specific intercepts interacted with time-varying coefficients. This method generalizes the synthetic control method to the case of multiple treated units and variable treatment periods, and improves efficiency and interpretability. This version supports unbalanced panels and implements the matrix completion method. Main reference: Yiqing Xu (2017) . +Description: Provides causal inference with interactive fixed-effect models. It imputes counterfactuals for each treated unit using control group information based on a linear interactive fixed effects model that incorporates unit-specific intercepts interacted with time-varying coefficients. This method generalizes the synthetic control method to the case of multiple treated units and variable treatment periods, and improves efficiency and interpretability. This version supports unbalanced panels and implements the matrix completion method. URL: https://yiqingxu.org/packages/gsynth/gsynth_examples.html NeedsCompilation: yes -License: GPL-2 +License: MIT + file LICENSE Imports: Rcpp (>= 0.12.3), ggplot2 (>= 2.1.0), GGally (>= 1.0.1), future (>= 1.21.0), doRNG (>= 1.8.2), doParallel (>= 1.0.10), foreach (>= 1.4.3), abind (>= 1.4-0), mvtnorm (>= 1.0-6), MASS (>= 7.3.47), lfe (>= 1.0-0) SystemRequirements: A C++11 compiler. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..12f72e4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,2 @@ +YEAR: 2021 +COPYRIGHT HOLDER: Yiqing Xu \ No newline at end of file diff --git a/NAMESPACE b/NAMESPACE index 4cc5f59..c2ae653 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -16,8 +16,8 @@ importFrom("ggplot2", "geom_boxplot", "geom_density", "geom_tile", "scale_linetype_manual", "scale_size_manual", "theme", "scale_colour_manual", "aes", "annotate", "ggtitle", "geom_rect", "scale_color_discrete", "scale_color_manual", "ggplotGrob", "guide_legend", "margin", "guides","xlab","ylab","element_rect") +##importFrom("GGally", "ggpairs") importFrom("abind", "abind") -importFrom("GGally", "ggpairs") importFrom("mvtnorm", "rmvnorm") importFrom("MASS", "ginv") importFrom("lfe", "felm", "getfe") diff --git a/R/plot.R b/R/plot.R index cb969e8..1d04033 100644 --- a/R/plot.R +++ b/R/plot.R @@ -1289,7 +1289,7 @@ plot.gsynth <- function( ggplot(data = data, mapping = mapping) + geom_density(..., fill = "gray", alpha = 0.7, color = "gray50") } - p <- ggpairs(data, mapping = aes(color = group), + p <- GGally::ggpairs(data, mapping = aes(color = group), columns = 1:nfactors, columnLabels = Llabel[1:nfactors], diag = list(continuous = my_dens), @@ -1299,7 +1299,7 @@ plot.gsynth <- function( ggplot(data = data, mapping = mapping) + geom_density(..., alpha = 0.7, color = NA) } - p <- ggpairs(data, mapping = aes(color = group, fill = group), + p <- GGally::ggpairs(data, mapping = aes(color = group, fill = group), columns = 1:nfactors, columnLabels = Llabel[1:nfactors], diag = list(continuous = my_dens), diff --git a/R/zzz.r b/R/zzz.r index c421a38..473592a 100644 --- a/R/zzz.r +++ b/R/zzz.r @@ -1,6 +1,6 @@ .onAttach <- function (libname, pkgname){ # echo output to screen - packageStartupMessage("## Syntax has been updated since v.1.2.0.\n") - packageStartupMessage("## Comments and suggestions -> yiqingxu@stanford.edu.\n") + packageStartupMessage("## Syntax has been updated since v.1.2.0.") + packageStartupMessage("## Comments and suggestions -> yiqingxu@stanford.edu.") } diff --git a/README.md b/README.md index c0e141b..bbca0ab 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,6 @@ **Authors:** Yiqing Xu []; Licheng Liu [] -**How to Uses:** [Examples](http://yiqingxu.org/software/gsynth/gsynth_examples.html) +**How to Uses:** [Examples](https://yiqingxu.org/packages/gsynth/gsynth_examples.html) -**Reference:** Yiqing Xu. 2017. "Generalized Synthetic Control Method: Causal Inference with Interactive Fixed Effects Models." Political Analysis, Vol. 25, Iss. 1, January 2017, pp. 57-76. Available at: - -**Note on installation failure:** - -Rcpp, RcppArmadillo and MacOS "-lgfortran" and "-lquadmath" error, see: http://thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks-lgfortran-and-lquadmath-error/ - -Installation failure related to OpenMP on MacOS, see: -http://thecoatlessprofessor.com/programming/openmp-in-r-on-os-x/ - -To fix these problems, consider installing: -gfortran 6.1 from https://gcc.gnu.org/wiki/GFortranBinaries#MacOS -clang4 R Binaries from https://github.com/coatless/r-macos-clang +**Reference:** Yiqing Xu. 2017. "Generalized Synthetic Control Method: Causal Inference with Interactive Fixed Effects Models." Political Analysis, Vol. 25, Iss. 1, January 2017, pp. 57-76. \ No newline at end of file diff --git a/man/.Rhistory b/man/.Rhistory new file mode 100644 index 0000000..e69de29 diff --git a/man/plot.gsynth.Rd b/man/plot.gsynth.Rd index 90a89e6..067086e 100644 --- a/man/plot.gsynth.Rd +++ b/man/plot.gsynth.Rd @@ -5,7 +5,7 @@ \usage{\method{plot}{gsynth}(x, type = "gap", xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, legendOff = FALSE, raw = "none", main = NULL, nfactors = NULL, id = NULL, axis.adjust = FALSE, - theme.bw = FALSE, shade.post = NULL, \dots) + theme.bw = TRUE, shade.post = FALSE, \dots) } \arguments{ \item{x}{a \code{\link{gsynth}} object.}