Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying pysynthdid, obtaining homogeneous weights and no plot #4

Open
slavakung opened this issue Mar 11, 2023 · 0 comments
Open

Applying pysynthdid, obtaining homogeneous weights and no plot #4

slavakung opened this issue Mar 11, 2023 · 0 comments

Comments

@slavakung
Copy link

I am trying to apply the code to a time series dataset I am working with. I arranged it as in the example

When I run:

'sdid = SynthDID(df_int, pre_terem, post_terem, treatment )
sdid.fit(zeta_type="base")
hat_omega_simple = sdid.estimated_params(model="sc")
hat_omega_simple'

the sc_weight is the same for all the features, at 0.027

Then when I run:

'sdid.plot(model="sc")'

I get:


TypeError Traceback (most recent call last)
Input In [139], in <cell line: 1>()
----> 1 sdid.plot(model="sc")

File ~/anaconda3/lib/python3.9/site-packages/synthdid/plot.py:12, in Plot.plot(self, model, figsize)
10 result = pd.DataFrame({"actual_y": self.target_y()})
11 post_actural_treat = result.loc[self.post_term[0] :, "actual_y"].mean()
---> 12 post_point = np.mean(self.Y_post_c.index)
14 if model == "sdid":
15 result["sdid"] = self.sdid_trajectory()

File <array_function internals>:5, in mean(*args, **kwargs)

File ~/anaconda3/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3438, in mean(a, axis, dtype, out, keepdims, where)
3436 pass
3437 else:
-> 3438 return mean(axis=axis, dtype=dtype, out=out, **kwargs)
3440 return _methods._mean(a, axis=axis, dtype=dtype,
3441 out=out, **kwargs)

File ~/anaconda3/lib/python3.9/site-packages/pandas/core/indexes/extension.py:95, in _inherit_from_data..method(self, *args, **kwargs)
93 if "inplace" in kwargs:
94 raise ValueError(f"cannot use inplace with {type(self).name}")
---> 95 result = attr(self._data, *args, **kwargs)
96 if wrap:
97 if isinstance(result, type(self._data)):

TypeError: mean() got an unexpected keyword argument 'dtype'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant