Statsmodel giving error - Axis must be specified when shapes of a and weights differ.
Closed this issue · 5 comments
The error comes from numpy. Statsmodel is trying to calculate an average with weights and the shapes of the variable and the weights are not consistent. Can you check the shape of the variables in your regressions?
does ols.summary() also generate an error? If not, the problem is one of the variables in the second regression.
ols.summary() also generates the same error.
using this formula, i check for shape,
merged3['Spending'].shape
merged3['v2x_regime'].shape
both of the times, the shape is same, (277,)
can you send me part of your dataframe? Then I can see whether I can replicate this error.
For sending the part, I am encountering another issue. Till now I have been working by uploading the dataset on my google drive since a link for it is not available, and it is larger than 25mb, so i can't upload it on github. Is there any other way I can upload it and use for Jupyterlab?
if you cannot upload the data on github, include a link in your notebook to your google drive or to wetransfer. Then we can replicate what you have done.