def makeMicroRegressionTable(out_filename, micro_data):
    '''
    Make the micro regression or (cross section regression) table for the paper, saving
    it to a tex file in the tables folder.  Also makes two partial tables for the slides.

    Parameters
    ----------

    out_filename : str
        Name of the file in which to save output (in the tables directory).
        The suffix .tex is automatically added.
    micro_data : [np.array]
        A list of two np.array's each containing micro data array as returned by extractSampleMicroData

    Returns
    -------
    None
    '''
    coeffs = np.zeros((6,2)) + np.nan
    stdevs = np.zeros((6,2)) +np.nan
    r_sq = np.zeros((4,2)) +np.nan
    obs = np.zeros((4,2)) +np.nan
    for i in range(2):
        this_micro_data = micro_data[i]
        logc_diff = this_micro_data[:,0]
        log_trans_shk = this_micro_data[:,1]
        top_assets = this_micro_data[:,2]

        #Lagged consumption regression
        mod = sm.OLS(logc_diff[1:],sm.add_constant(np.transpose(np.vstack([logc_diff[0:-1]]))), missing='drop')
        res = mod.fit()
        coeffs[0,i] = res._results.params[1]
        stdevs[0,i] = res._results.HC0_se[1]
        r_sq[0,i] = res._results.rsquared_adj
        obs[0,i] = res.nobs

        #Expected income regression
        mod = sm.OLS(logc_diff[1:],sm.add_constant(np.transpose(np.vstack([-log_trans_shk[0:-1]]))), missing='drop')
        res = mod.fit()
        coeffs[1,i] = res._results.params[1]
        stdevs[1,i] = res._results.HC0_se[1]
        r_sq[1,i] = res._results.rsquared_adj
        obs[1,i] = res.nobs

        #Assets regression
        mod = sm.OLS(logc_diff[1:],sm.add_constant(np.transpose(np.vstack([top_assets[0:-1]]))), missing='drop')
        res = mod.fit()
        coeffs[2,i] = res._results.params[1]
        stdevs[2,i] = res._results.HC0_se[1]
        r_sq[2,i] = res._results.rsquared_adj
        obs[2,i] = res.nobs

        #Horeserace regression
        mod = sm.OLS(logc_diff[1:],sm.add_constant(np.transpose(np.vstack([logc_diff[0:-1],-log_trans_shk[0:-1],top_assets[0:-1]]))), missing='drop')
        res = mod.fit()
        coeffs[3,i] = res._results.params[1]
        stdevs[3,i] = res._results.HC0_se[1]
        coeffs[4,i] = res._results.params[2]
        stdevs[4,i] = res._results.HC0_se[2]
        coeffs[5,i] = res._results.params[3]
        stdevs[5,i] = res._results.HC0_se[3]
        r_sq[3,i] = res._results.rsquared_adj
        obs[3,i] = res.nobs

    paper_top = "\\begin{minipage}{\TableWidth}\n"
    paper_top += "  \\begin{table}\n"
    paper_top += "    \\caption{Micro Consumption Regression on Simulated Data} \\label{table:CGrowCross}\n"
    paper_top += "    \\begin{eqnarray} \n"
    paper_top += "\\CGrowCross    \\nonumber %\\\CGrowCrossBar \\nonumber \n"
    paper_top += "    \end{eqnarray}\n"

    slides_top = '\\begin{center} \n'

    header = "\\begin{tabular}{cd{4}d{4}d{5}ccc}  \n"
    header += "\\toprule  \n"
    header += "Model of     &                                &                                &                                 &                                       &                 \\\\  \n"
    header += "Expectations & \multicolumn{1}{c}{$ \chi $} & \multicolumn{1}{c}{$ \eta $} & \multicolumn{1}{c}{$ \\alpha $} & \multicolumn{1}{c}{$\\bar{R}^{2}$} &                   \n"

    F_panel = "\\\\ \\midrule \n \multicolumn{2}{l}{Frictionless}  \n"
    F_panel += "\\\\ &  {:.3f}".format(coeffs[0,0]) +"  &        &        & {:.3f}".format(r_sq[0,0]) +" &  "+ " %NotOnSlide   \n"
    F_panel += "\\\\ &  \multicolumn{1}{c}{(--)}  &        &        &  &  "+ " %NotOnSlide   \n"
    F_panel += "\\\\ &    &    {:.3f}".format(coeffs[1,0]) +"    &        & {:.3f}".format(r_sq[1,0])  +" &  "+" %NotOnSlide   \n"
    F_panel += "\\\\ &    &  \multicolumn{1}{c}{(--)}  &        &  &  "+ " %NotOnSlide   \n"
    F_panel += "\\\\ &    &        &     {:.3f}".format(coeffs[2,0]) +"   & {:.3f}".format(r_sq[2,0]) +" &  " +" %NotOnSlide   \n"
    F_panel += "\\\\ &    &       &  \multicolumn{1}{c}{(--)}  &  &  "+ " %NotOnSlide   \n"
    F_panel += "\\\\ &  {:.3f}".format(coeffs[3,0]) +"  &    {:.3f}".format(coeffs[4,0]) +"    &     {:.3f}".format(coeffs[5,0]) +"   & {:.3f}".format(r_sq[3,0]) +" &    \n"
    F_panel += "\\\\ & \multicolumn{1}{c}{(--)} &  \multicolumn{1}{c}{(--)} &  \multicolumn{1}{c}{(--)}  &  &  "+ " %NotOnSlide   \n"

    S_panel = "\\\\ \\midrule \n \multicolumn{2}{l}{Sticky}  \n"
    S_panel += "\\\\ &  {:.3f}".format(coeffs[0,1]) +"  &        &        & {:.3f}".format(r_sq[0,1]) +" &   %NotOnSlide   \n"
    S_panel += "\\\\ &  \multicolumn{1}{c}{(--)}  &        &        &  &  "+ " %NotOnSlide   \n"
    S_panel += "\\\\ &    &    {:.3f}".format(coeffs[1,1]) +"    &        & {:.3f}".format(r_sq[1,1]) +" &   %NotOnSlide   \n"
    S_panel += "\\\\ &    &  \multicolumn{1}{c}{(--)}  &        &  &  "+ " %NotOnSlide   \n"
    S_panel += "\\\\ &    &        &     {:.3f}".format(coeffs[2,1]) +"   & {:.3f}".format(r_sq[2,1]) +" &   %NotOnSlide   \n"
    S_panel += "\\\\ &    &       &  \multicolumn{1}{c}{(--)}  &  &  "+ " %NotOnSlide   \n"
    S_panel += "\\\\ &  {:.3f}".format(coeffs[3,1]) +"  &    {:.3f}".format(coeffs[4,1]) +"    &     {:.3f}".format(coeffs[5,1]) +"   & {:.3f}".format(r_sq[3,1]) +" &    \n"
    S_panel += "\\\\ & \multicolumn{1}{c}{(--)} &  \multicolumn{1}{c}{(--)} &  \multicolumn{1}{c}{(--)}  &  &  "+ " %NotOnSlide   \n"

    paper_bot = "  \\\\ \\bottomrule \\\\\n"
    paper_bot += "  \multicolumn{5}{p{0.9\\textwidth}}{\\footnotesize \\textbf{Notes}: $\\mathbb{E}_{t,i}$ is the expectation from the perspective of person $i$ in period $t$; $\\bar{a}$ is a dummy variable indicating that agent $i$ is in the top 99 percent of the normalized $a$ distribution.  Simulated sample size is large enough such that standard errors are effectively zero.  Sample is restricted to households with positive income in period $t$. The notation ``(---)'' indicates that standard errors are close to zero, given the very large simulated sample size.}\n"
    paper_bot += "\end{tabular}  \n"
    paper_bot += "\end{table}\n"
    paper_bot += "\end{minipage}\n"
    paper_bot += "\ifthenelse{\\boolean{StandAlone}}{\end{document}}{} \n"

    slides_bot = "\\\\ \\bottomrule  \n"
    slides_bot += "\end{tabular}  \n"
    slides_bot += '\\end{center} \n'

    # Make table for paper
    paper_output = paper_top + header + F_panel + S_panel + paper_bot
    with open(tables_dir + out_filename + '.tex','w') as f:
        f.write(paper_output)
        f.close()

    # Make tables for slides
    slidesF_output = slides_top + header + F_panel + slides_bot
    with open(tables_dir + out_filename + '_SlidesF.tex','w') as f:
        f.write(slidesF_output)
        f.close()

    slidesS_output = slides_top + header + S_panel + slides_bot
    with open(tables_dir + out_filename + '_SlidesS.tex','w') as f:
        f.write(slidesS_output)
        f.close()
Make the micro regression or (cross section regression) table for the paper, saving
    it to a tex file in the tables folder.  Also makes two partial tables for the slides.

    Parameters
    ----------

    out_filename : str
        Name of the file in which to save output (in the tables directory).
        The suffix .tex is automatically added.
    micro_data : [np.array]
        A list of two np.array's each containing micro data array as returned by extractSampleMicroData

    Returns
    -------
    None