I'm trying to run a panel regression on pandas Dataframes:
Currently I have two dataframes each containing 52 rows(dates)*99 columns(99stocks) :Markdown file with data representation
When running:
est=sm.OLS(Stockslist,averages).fit()
est.summary()
I get the ValueError: shapes (52,99) and (52,99) not aligned: 99 (dim 1) != 52 (dim 0)
Can somebody point me out what I am doing wrong? The model is simply y(i,t)=x(i,t)+error term so no intercept. However I would like to add time effects in the future.
Kind regards, Jeroen
stack
might do it pandas.pydata.org/pandas-docs/stable/… In numpy I would just useravel
or reshape with order='F' for stacking by columns. – Calipee