Closed rssteel closed 1 year ago
The source code may check all columns, so load only those columns what you actual need. For example:
base.cols <- c(time.id,unit.id, treatment) concern.cols <- c(outcome.var, x.var) check.cols <-c(base.cols,concern.cols)
data <- data[,check.cols]
The error may come from your ['member'] or ['outlay~i '] column.
Hi @rssteel thanks for using the package! And sorry for the delay in getting back to you. I think I have figured out the problem.
The read_dta
function is loading the data as a tibble -- the package relies on data frames as input and we currently are not throwing a very helpful error. For what it's worth, the errors are basically being thrown because the package is expecting a vector after subsetting a column of the data to check the integer/consecutive requirements, but its getting a tibble. So, the errors are being thrown, but the message isn't helpful.
I was able to get the code to run just by adding house_ab <- as.data.frame(read_dta("faads_women_09.dta"))
We'll improve the error checking in a future update! thanks for finding this. Let us know if you have other questions.
When running the
DisplayTreatment()
function, I get the following error: "please convert time id to consecutive integers". I've converted the time id to integer class withas.integer(year)
, and I'm pretty sure they are consecutive---I've rununique(year)
and can see that there are no gaps---but the error persists.Similarly, when running the
PanelMatch()
function, I get this error: "please convert unit id column to integer or numeric". Again, I've tried converting the unit id to integer class, but the error persists.I'm attaching the data. Here is the code necessary to replicate the issue:
faads_women_09.dta.zip