title: Fama-Macbeth in Python
body: <p>First of all, I am very new to Python, so I am not as technically gifted in programming. However, I am running a <code>Fama-Macbeth</code> regression to estimate risk premia of different macroeconomic variables. Similarly to this <a href="https://stackoverflow.com/questions/24074481/fama-macbeth-regression-in-python-pandas-or-statsmodels">case</a>.</p>
  
  <p>My problem is that <code>fama_macbeth</code> seems to have depreciated in <code>pandas</code>, and moved to statsmodels which I find more confusing. </p>
  
  <p>My data:
  I have time series of <em>S&amp;P index returns</em>, as well as different variables i.e. industry production, <em>gdp, cpi</em> etc. (Monthly data for approx. 20 years)</p>
  
  <p>What I wish to do is:
  Regress the index returns on all the variables i.e. y= bx(1) + bx(2) + bx(3), and save the coefficients for each variables as a new time series, which I can regress the index return on in the second part of the analysis. </p>
  
  <p>Anyone have an idea of how to use the <code>fama_macbeth</code> in <code>statsmodels</code> in my case, or any other approaches to my problem. If anyone has a source where a similar project has been shared it would be greatly appreciated. I can't seem to find previous examples of this approach in <em>Python</em> anywhere.</p>