Skip to content

Commit

Permalink
v.1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyiqing committed Aug 6, 2021
1 parent e6cf33d commit e4525ad
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 23 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 <yiqingxu@stanford.edu>
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) <doi:10.1017/pan.2016.2>.
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.
Expand Down
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2021
COPYRIGHT HOLDER: Yiqing Xu
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions R/zzz.r
Original file line number Diff line number Diff line change
@@ -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.")
}
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@

**Authors:** Yiqing Xu [<yiqingxu@ucsd.edu>]; Licheng Liu [<liulch.16@sem.tsinghua.edu.cn>]

**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: <http://dx.doi.org/10.1017/pan.2016.2>

**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.
Empty file added man/.Rhistory
Empty file.
2 changes: 1 addition & 1 deletion man/plot.gsynth.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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.}
Expand Down

0 comments on commit e4525ad

Please sign in to comment.