latextableII.m
Creates LaTeX tables of probit thresholds (Table II in Abbring and Campbell's ``Last-In First-Out Oligopoly Dynamics'').
At its conclusion, the string tablestra has the table of estimated thresholds, while tablestrb has the table of implied profits per consumer.
Contents
Acquire thresholds and transform them.
If probitThresholds or PiRatio do not exist, run experimentII.m to create them.
newrun=~(exist('probitThresholds','var') && exist('PiRatio','var')); if newrun; newrunHOLD=1; experimentII; end
Create the LaTeX table
The LaTeX table's first panel reports the estimated probit thresholds, and its second panel reports the implied ratios of producer's surplus per consumeer. We place these into separate tabular environments.
% Create strings with LaTeX tabular overhead headerstr1 = ['\begin{tabular}{*{' num2str(size(probitThresholds,2)+1) '}{c}}']; headerstrDoubleRule='\hline\hline\\'; %This is the double rule required by Econometrica. headerstr2a = [' & \multicolumn{' num2str(size(probitThresholds,2)) '}{c}{Implied Static Entry Thresholds} \\']; headerstr2b = [' & \multicolumn{' num2str(size(probitThresholds,2)) '}{c}{Implied $\pi(N)/\pi(1)$ for $N=$} \\']; headerstr3a = ['$\sigma $' num2str(1:1:size(probitThresholds,2),' & $C^{\\star}_{%1.0f}$') ' \\ \hline']; headerstr3b= ['$\sigma $' num2str(1:1:size(probitThresholds,2),' & %1.0f') ' \\ \hline']; closestr = '\end{tabular}'; % Contents contentstra = ' '; contentstrb = ' '; for iter=1:nPoints; addThis= num2str(sigmaG(iter),'%2.2f '); for jiter=1:size(probitThresholds,2) if ~isnan(probitThresholds(iter,jiter)) addThis = [addThis num2str(probitThresholds(iter,jiter),'& \\makebox[24pt]{%2.2f}')]; else addThis = [addThis ' & \makebox[24pt]{ }']; end end addThis = [addThis '\\ ']; contentstra = strvcat(contentstra,addThis); addThis = num2str(sigmaG(iter),'%2.2f '); for jiter=1:size(PiRatio,2) if ~isnan(PiRatio(iter,jiter)) addThis = [addThis num2str(PiRatio(iter,jiter),'& \\makebox[24pt]{%2.2f}')]; else addThis = [addThis ' & \makebox[24pt]{ }']; end end addThis = [addThis '\\ ']; contentstrb = strvcat(contentstrb,addThis); end
Assemble the final output.
tablestra=strvcat(headerstr1,headerstrDoubleRule,headerstr2a,headerstr3a,contentstra,closestr); tablestrb=strvcat(headerstr1,headerstr2b,headerstr3b,contentstrb,closestr);
Display output if this is a test run.
if exist('newrunHOLD','var') disp(probitThresholds); disp(tablestra); disp(PiRatio); disp(tablestrb); clear newrunHOLD end
Columns 1 through 7 0.4466 0.8812 1.3596 1.8544 2.3821 2.8094 3.3981 0.4274 0.8693 1.3198 1.7823 2.2387 2.6993 3.1333 0.3929 0.8331 1.2857 1.7454 2.1964 2.6208 NaN 0.3421 0.8080 1.2578 1.6986 2.0542 NaN NaN Column 8 3.8794 NaN NaN NaN \begin{tabular}{*{9}{c}} \hline\hline\\ & \multicolumn{8}{c}{Implied Static Entry Thresholds} \\ $\sigma $& $C^{\star}_{1}$ & $C^{\star}_{2}$ & $C^{\star}_{3}$ & $C^{\star}_{4}$ & $C^{\star}_{5}$ & $C^{\star}_{6}$ & $C^{\star}_{7}$ & $C^{\star}_{8}$ \\ \hline 0.00& \makebox[24pt]{0.45}& \makebox[24pt]{0.88}& \makebox[24pt]{1.36}& \makebox[24pt]{1.85}& \makebox[24pt]{2.38}& \makebox[24pt]{2.81}& \makebox[24pt]{3.40}& \makebox[24pt]{3.88}\\ 0.05& \makebox[24pt]{0.43}& \makebox[24pt]{0.87}& \makebox[24pt]{1.32}& \makebox[24pt]{1.78}& \makebox[24pt]{2.24}& \makebox[24pt]{2.70}& \makebox[24pt]{3.13} & \makebox[24pt]{ }\\ 0.10& \makebox[24pt]{0.39}& \makebox[24pt]{0.83}& \makebox[24pt]{1.29}& \makebox[24pt]{1.75}& \makebox[24pt]{2.20}& \makebox[24pt]{2.62} & \makebox[24pt]{ } & \makebox[24pt]{ }\\ 0.15& \makebox[24pt]{0.34}& \makebox[24pt]{0.81}& \makebox[24pt]{1.26}& \makebox[24pt]{1.70}& \makebox[24pt]{2.05} & \makebox[24pt]{ } & \makebox[24pt]{ } & \makebox[24pt]{ }\\ \end{tabular} Columns 1 through 7 1.0000 1.0136 0.9854 0.9634 0.9374 0.9538 0.9200 1.0000 0.9834 0.9715 0.9592 0.9546 0.9501 0.9549 1.0000 0.9433 0.9168 0.9005 0.8945 0.8996 NaN 1.0000 0.8469 0.8160 0.8057 0.8328 NaN NaN Column 8 0.9210 NaN NaN NaN \begin{tabular}{*{9}{c}} & \multicolumn{8}{c}{Implied $\pi(N)/\pi(1)$ for $N=$} \\ $\sigma $& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \hline 0.00& \makebox[24pt]{1.00}& \makebox[24pt]{1.01}& \makebox[24pt]{0.99}& \makebox[24pt]{0.96}& \makebox[24pt]{0.94}& \makebox[24pt]{0.95}& \makebox[24pt]{0.92}& \makebox[24pt]{0.92}\\ 0.05& \makebox[24pt]{1.00}& \makebox[24pt]{0.98}& \makebox[24pt]{0.97}& \makebox[24pt]{0.96}& \makebox[24pt]{0.95}& \makebox[24pt]{0.95}& \makebox[24pt]{0.95} & \makebox[24pt]{ }\\ 0.10& \makebox[24pt]{1.00}& \makebox[24pt]{0.94}& \makebox[24pt]{0.92}& \makebox[24pt]{0.90}& \makebox[24pt]{0.89}& \makebox[24pt]{0.90} & \makebox[24pt]{ } & \makebox[24pt]{ }\\ 0.15& \makebox[24pt]{1.00}& \makebox[24pt]{0.85}& \makebox[24pt]{0.82}& \makebox[24pt]{0.81}& \makebox[24pt]{0.83} & \makebox[24pt]{ } & \makebox[24pt]{ } & \makebox[24pt]{ }\\ \end{tabular} Experiment took 87.82 seconds