evanjflack / bacondecomp

Bacon-Goodman decomposition for differences-in-differences with variation in treatment timing.
Other
46 stars 16 forks source link

Change data doesn't work #77

Closed meichen1129 closed 3 years ago

meichen1129 commented 3 years ago

When I change another dataset (fake_data), and replace the variables and run, always noted that "Error: 'fake_data' is not an exported object from 'namespace:bacondecomp'", I don't know how to deal with it.

EdJeeOnGitHub commented 3 years ago

Hi,

Could you share an example of your code so we can investigate?

A reproducible example (reprex) can be easily created following the instructions here: https://reprex.tidyverse.org/.

Thanks!

kylebutts commented 3 years ago

I assume @meichen1129 that you are copying and changing from the README:

df_bacon <- bacon(incearn_ln ~ reform_math,
                  data = bacondecomp::fake_data,
                  id_var = "state",
                  time_var = "class")

The bacondecomp::math_reform is a dataset that is stored in the bacondecomp package. You don't need the bacondecomp:: part:

df_bacon <- bacon(incearn_ln ~ reform_math,
                  data = fake_data,
                  id_var = "state",
                  time_var = "class")