You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package and method are great, thanks for implementing it to make it easy to use!
makeFrontier() will throw an error about the treatment not being 0/1 or TRUE/FALSE when dataset is a tibble, even if the treatment is in fact 0/1. If the dataset is converted to data.frame(), the error goes away, but it took a bit of experimenting to figure that out. Either automatic conversion of tbl to data.frame(), or a more informative warning message would be a big help.
library(tidyverse)
library(MatchingFrontier)
## Make data - t is 0/1
df_tst <- tibble(t = rbinom(100, c(0, 1), .5),
X1 = rnorm(100),
X2 = rnorm(100),
y = rnorm(100))
## Should error with:
## "Error: In makeFrontier(), the treatment must be either 0/1 (integers) or "TRUE"/"FALSE" (logical)."
makeFrontier(dataset = df_tst, treatment = "t", outcome = "y", match.on = c("X1", "X2"))
## Should run after converting to dataframe
makeFrontier(dataset = as.data.frame(df_tst), treatment = "t", outcome = "y", match.on = c("X1", "X2"))
The text was updated successfully, but these errors were encountered:
This package and method are great, thanks for implementing it to make it easy to use!
makeFrontier()
will throw an error about the treatment not being 0/1 or TRUE/FALSE whendataset
is a tibble, even if the treatment is in fact 0/1. If the dataset is converted todata.frame()
, the error goes away, but it took a bit of experimenting to figure that out. Either automatic conversion of tbl to data.frame(), or a more informative warning message would be a big help.The text was updated successfully, but these errors were encountered: