Hello! I am trying to run the following using the interflex package:
interflex(estimator = "raw", Y = "has_chapter", D = "share_sc_ten", X = "share_white", data = df_1890v2, treat.type="continuous", Ylabel = "Outcome", Dlabel = "Treatment", Xlabel="Moderator", theme.bw = TRUE, show.grid = FALSE, na.rm=TRUE)
And every time I run this I get the following error message. I have been very stuck on what to do here because these columns do exist in my data...? Thank you so much in advance.
Error: Can't subset columns that don't exist.
x Location 2 doesn't exist. There are only 1 column.
Welcome to the community.
I am not familiar with interflex package. Two things you can check
Make sure df_1890v2 is a dataframe (using command class(df_1890v2)) and it has at least 3 columns, "has_chapter", "share_sc_ten", "share_white" (usng command names(df_1890v2))
For estimator, you use the option "raw". But, the package manual says, it can be one of the following: "linear", "binning", "kernel" or "gam"
You may consider presenting reproducible example by following FAQ: How to do a minimal reproducible example ( reprex ) for beginners . It will help people to think and solve the probelm efficiently.