# Install some packages
# you might have some issue installing the third package (honestdid) from
github. In that case, just don't select yes for update in case of the
honestdid package. Or you could install CRVXR package before running that
command .
library(devtools)
install_github("bcallaway11/BMisc", dependencies = TRUE)
install_github("bcallaway11/did", dependencies = TRUE)
install_github("asheshrambachan/HonestDiD", dependencies = TRUE)
#--------------------------------------------------------------------------
# Load packages
#--------------------------------------------------------------------------
# Libraries
# Load libraries
library(ggplot2)
library(here)
library(foreign)
library(tidyverse)
library(dplyr)
library(did)
library(HonestDiD)
After installing the package I'm using the data used as in the creator of
the package (https://github.com/pedrohcgs/CS_RR). You can call it easily
min_wage <- readRDS((here("data",'min_wage_CS.rds')))
# Formula for covariates
xformla <- ~ region + (medinc + pop ) + I(pop^2) + I(medinc^2) + white +
hs + pov
#---------------------------------------------------------------------------
# Using covariates and DR DiD with never-treated as comparison group
# Fix the reference time periods
CS_never_cond <- did::att_gt(yname="lemp",
tname="year",
idname="countyreal",
gname="first.treat",
#xformla=~1,
xformla = xformla,
control_group="nevertreated",
data = min_wage,
panel = TRUE,
base_period="universal",
bstrap = TRUE,
cband = TRUE)
Unfortunately, its returing me the error that : Error in did::att_gt(yname
= "lemp", tname = "year", idname = "countyreal",
:
unused argument (base_period = "universal")
since I've all the necessary packages and especially did package installed,
I shouldn't have the problem. Some suggestions will be highly appreciated.
[[alternative HTML version deleted]]
Communicate with the maintainer of that GitHub-distributed package... there is an "Issues" option in the GitHub repo. Also, read the Posting Guide linked below... formatted email interferes with us getting your message clearly, and this isn't a question about R... it is a question about that package. On February 25, 2022 2:14:05 PM PST, Tariq Khasiri <tariqkhasiri at gmail.com> wrote:># Install some packages ># you might have some issue installing the third package (honestdid) from >github. In that case, just don't select yes for update in case of the >honestdid package. Or you could install CRVXR package before running that >command . >library(devtools) >install_github("bcallaway11/BMisc", dependencies = TRUE) >install_github("bcallaway11/did", dependencies = TRUE) >install_github("asheshrambachan/HonestDiD", dependencies = TRUE) >#-------------------------------------------------------------------------- ># Load packages >#-------------------------------------------------------------------------- ># Libraries ># Load libraries >library(ggplot2) >library(here) >library(foreign) >library(tidyverse) >library(dplyr) >library(did) >library(HonestDiD) > >After installing the package I'm using the data used as in the creator of >the package (https://github.com/pedrohcgs/CS_RR). You can call it easily > >min_wage <- readRDS((here("data",'min_wage_CS.rds'))) > ># Formula for covariates >xformla <- ~ region + (medinc + pop ) + I(pop^2) + I(medinc^2) + white + >hs + pov >#--------------------------------------------------------------------------- ># Using covariates and DR DiD with never-treated as comparison group ># Fix the reference time periods >CS_never_cond <- did::att_gt(yname="lemp", > tname="year", > idname="countyreal", > gname="first.treat", > #xformla=~1, > xformla = xformla, > control_group="nevertreated", > data = min_wage, > panel = TRUE, > base_period="universal", > bstrap = TRUE, > cband = TRUE) > >Unfortunately, its returing me the error that : Error in did::att_gt(yname >= "lemp", tname = "year", idname = "countyreal", : > unused argument (base_period = "universal") > >since I've all the necessary packages and especially did package installed, >I shouldn't have the problem. Some suggestions will be highly appreciated. > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.-- Sent from my phone. Please excuse my brevity.
On Fri, 25 Feb 2022 16:14:05 -0600 Tariq Khasiri <tariqkhasiri at gmail.com> wrote:> CS_never_cond <- did::att_gt(yname="lemp", > tname="year", > idname="countyreal", > gname="first.treat", > #xformla=~1, > xformla = xformla, > control_group="nevertreated", > data = min_wage, > panel = TRUE, > base_period="universal", # <-- here > bstrap = TRUE, > cband = TRUE)> Error in did::att_gt(yname = "lemp", tname = "year", idname > "countyreal", : > unused argument (base_period = "universal")Does ?did::att_gt specify that the att_gt function accepts an argument named "base_period" (marked by me with "# <-- here")? If it does, it's a documentation error, contact maintainer('did') and tell them about it. If it doesn't, you need to adjust your call to did::att_gt to provide the correct arguments. -- Best regards, Ivan