3

I have got a table like this. Could someone help me to align by the decimal? I also get advice from other answers that after the alignment, the table might be too wide so that I should use S column from siunitx instead of D column. I have checked related questions and tried but didn't work it out. I would appreciate it much if someone could help!

enter image description here

\documentclass{article}

\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{dcolumn}
\usepackage{siunitx}
\usepackage{multirow}

\begin{document}
    \begin{table}[htbp]\centering
        \small
        \renewcommand{\arraystretch}{0.6}
        \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
        \caption{Descriptive Statistics (Pooled Sample)}
        \begin{tabular*}{\hsize}{@{\hskip\tabcolsep\extracolsep\fill}l*{1}{ccccc}}
            \toprule
            &   Obs&       Mean&  Std. Dev.&        Min& Max      \\
            \midrule
            SR1 (pooled)       & 5887 & 30.605 & 30.777 & 0     & 100    \\
            SR1 (rural)        & 3115 & 31.253 & 31.832 & 0     & 100    \\
            SR1 (urban)        & 2772 & 29.876 & 29.535 & 0     & 100    \\
            SR1+ (pooled)      & 3671 & 49.079 & 24.743 & 0.024 & 100    \\
            SR1+ (rural)       & 1923 & 50.626 & 25.699 & 0.062 & 100    \\
            SR1+ (urban)       & 1748 & 47.377 & 23.536 & 0.024 & 100    \\
            SRdummy1 (pooled)  & 5887 & 0.624  & 0.485  & 0     & 1      \\
            SRdummy1 (rural)   & 3115 & 0.617  & 0.486  & 0     & 1      \\
            SRdummy1 (urban)   & 2772 & 0.631  & 0.483  & 0     & 1      \\
            SR2 (pooled)       & 5887 & 42.495 & 31.928 & 0     & 100    \\
            SR2 (rural)        & 3115 & 43.943 & 32.949 & 0     & 100    \\
            SR2 (urban)        & 2772 & 40.867 & 30.665 & 0     & 100    \\
            SR2+ (pooled)      & 3671 & 60.649 & 21.319 & 0.306 & 100    \\
            SR2+ (rural)       & 1923 & 62.674 & 21.794 & 1     & 100    \\
            SR2+ (urban)       & 1748 & 58.421 & 20.561 & 0.306 & 100    \\
            SRdummy2 (pooled)  & 5887 & 0.758  & 0.428  & 0     & 1      \\
            SRdummy2 (rural)   & 3115 & 0.754  & 0.431  & 0     & 1      \\
            SRdummy2 (urban)   & 2772 & 0.763  & 0.426  & 0     & 1      \\
            PropRisky (pooled) & 5884 & 6.204  & 19.588 & 0     & 100    \\
            PropRisky (rural)  & 3049 & 1.343  & 9.069  & 0     & 100    \\
            PropRisky (urban)  & 2835 & 11.432 & 25.598 & 0     & 100    \\
            ProbRisky (pooled) & 5884 & 0.124  & 0.330  & 0     & 1      \\
            ProbRisky (rural)  & 3049 & 0.033  & 0.179  & 0     & 1      \\
            ProbRisky (urban)  & 2835 & 0.223  & 0.416  & 0     & 1      \\
            LnInc (pooled)     & 5842 & 10.236 & 1.295  & 1.386 & 14.914 \\
            LnInc (rural)      & 3081 & 9.948  & 1.223  & 1.386 & 14.914 \\
            LnInc (urban)      & 2761 & 10.558 & 1.299  & 3.555 & 14.914 \\
            Age (pooled)       & 6089 & 44.370 & 8.882  & 25    & 59     \\
            Age (rural)        & 3191 & 45.180 & 8.627  & 25    & 59     \\
            Age (urban)        & 2898 & 43.478 & 9.072  & 25    & 59     \\
            Education (pooled) & 6042 & 3.645  & 1.648  & 1     & 9      \\
            Education (rural)  & 3176 & 2.776  & 0.974  & 1     & 7      \\
            Education (urban)  & 2866 & 4.609  & 1.706  & 1     & 9      \\
            Kid (pooled)       & 6089 & 0.664  & 0.779  & 0     & 9      \\
            Kid (rural)        & 3191 & 0.799  & 0.892  & 0     & 9      \\
            Kid (urban)        & 2898 & 0.516  & 0.599  & 0     & 3      \\
            Old (pooled)       & 6089 & 0.229  & 0.531  & 0     & 4      \\
            Old (rural)        & 3191 & 0.252  & 0.550  & 0     & 3      \\
            Old (urban)        & 2898 & 0.203  & 0.509  & 0     & 4      \\
            HHsize (pooled)    & 6089 & 3.634  & 1.401  & 1     & 18     \\
            HHsize (rural)     & 3191 & 4.042  & 1.495  & 1     & 18     \\
            HHsize (urban)     & 2898 & 3.185  & 1.131  & 1     & 10     \\
            Male (pooled)      & 6089 & 0.729  & 0.444  & 0     & 1      \\
            Male (rural)       & 3191 & 0.803  & 0.398  & 0     & 1      \\
            Male (urban)       & 2898 & 0.649  & 0.477  & 0     & 1      \\
            Married (pooled)   & 6037 & 0.914  & 0.280  & 0     & 1      \\
            Married (rural)    & 3173 & 0.939  & 0.240  & 0     & 1      \\
            Married (urban)    & 2864 & 0.887  & 0.317  & 0     & 1      \\
            Party (pooled)     & 5679 & 0.148  & 0.355  & 0     & 1      \\
            Party (rural)      & 2949 & 0.063  & 0.243  & 0     & 1      \\
            Party (urban)      & 2730 & 0.240  & 0.427  & 0     & 1      \\
            Job (pooled)       & 6089 & 0.809  & 0.393  & 0     & 1      \\
            Job (rural)        & 3191 & 0.913  & 0.282  & 0     & 1      \\
            Job (urban)        & 2898 & 0.695  & 0.460  & 0     & 1      \\
            House (pooled)     & 6088 & 0.912  & 0.283  & 0     & 1      \\
            House (rural)      & 3191 & 0.946  & 0.226  & 0     & 1      \\
            House (urban)      & 2897 & 0.875  & 0.331  & 0     & 1      \\
            \bottomrule
        \end{tabular*}
        \label{tab:sum}
    \end{table}

\end{document}
5
  • 1
    The S columns from siunitx works just fine with this MWE. But you need to configure it, don't just use S. S[table-format=2.3] fits column 3 for example. Remember to protect the header, aka use {Header}, not Header
    – daleif
    Jul 18, 2017 at 9:48
  • ... so for you: use instead\begin{tabular}{cS[table-format=4.0]S[table-format=3.2]S[table-format=3.2]S[table-format=3.2]S[table-format=3.2]} \toprule & {Obs}& {Mean}& {Std. Dev.}& {Min}& {Max} \\
    – Bobyandbob
    Jul 18, 2017 at 10:03
  • @Bobyandbob, so I changed the code, but I just got errors like "Package array Error: Illegal pream-token (�): `c' used. ...able-format=3.2]‌​S[table-format=3.2]}". Sorry I am not very familiar with siunitx package. Could you have a look at that? Jul 18, 2017 at 11:02
  • Does Micos solution solved your problem? I think yes. - I just wrote \begin{tabular}{cS[table-format=4.0]S[table-format=3.‌​2]S[table-format=3.2‌​]S[table-format=3.2]‌​S[table-format=3.2]} \toprule & {Obs}& {Mean}& {Std. Dev.}& {Min}& {Max}\\ instead of ` \begin{tabular*}{\hsize}{@{\hskip\tabcolsep\extracolsep\fill}l*{1}{ccccc}} \toprule & Obs& Mean& Std. Dev.& Min& Max\\ and it works. I cant't reproduce your error message. Sorry. Instead of c` you can better use l.
    – Bobyandbob
    Jul 18, 2017 at 11:48
  • @Bobyandbob I just didn't work it out but still appreciate your help a lot! Jul 18, 2017 at 13:24

2 Answers 2

3

I would use longtable and siunitx too. Note using the S column type for the last two columns is questionable, as most entries do not have a decimal part (but maybe the real entries have?). Here are some improvements.

First, since rows can be grouped by three, you can add an extra vertical space every three rows,to make the groups more visible by the reader.

A second variant, visually more attractive, splits the first column in two, since the second part of cells contents is always the same series pooled, rural, urban. So I highlight the first row of each series with some colour, and boldface the first part (not repeated in the other rows of the series).

\documentclass{article}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.3pt}
\usepackage{ltablex}
\usepackage{caption, booktabs}
\usepackage{siunitx}
\usepackage{multirow, bigstrut}
\usepackage[table, svgnames]{xcolor}

\begin{document}

\renewcommand{\arraystretch}{0.9}\small
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{longtable}{lS[table-format =4.0]*{3}{S[table-format =2.3]}S[table-format =3.3]}
  \captionsetup{skip = 6pt}
  \caption{Descriptive Statistics (Pooled Sample)} \label{tab:sum} \\
  \toprule
                     & {Obs} & {Mean} & {Std. Dev.} & {Min} & {Max} \\
  \midrule
  \endfirsthead
  \toprule
                     & {Obs} & {Mean} & {Std. Dev.} & {Min} & {Max} \\
  \midrule
  \endhead
  \\
  \bottomrule
  \endlastfoot
  SR1 (pooled) & 5887 & 30.605 & 30.777 & 0 & 100 \\
  SR1 (rural) & 3115 & 31.253 & 31.832 & 0 & 100 \\
  SR1 (urban) & 2772 & 29.876 & 29.535 & 0 & 100 \\
  \addlinespace
  SR1+ (pooled) & 3671 & 49.079 & 24.743 & 0.024 & 100 \\
  SR1+ (rural) & 1923 & 50.626 & 25.699 & 0.062 & 100 \\
  SR1+ (urban) & 1748 & 47.377 & 23.536 & 0.024 & 100 \\
  \addlinespace
  SRdummy1 (pooled) & 5887 & 0.624 & 0.485 & 0 & 1 \\
  SRdummy1 (rural) & 3115 & 0.617 & 0.486 & 0 & 1 \\
  SRdummy1 (urban) & 2772 & 0.631 & 0.483 & 0 & 1 \\
  \addlinespace
  SR2 (pooled) & 5887 & 42.495 & 31.928 & 0 & 100 \\
  SR2 (rural) & 3115 & 43.943 & 32.949 & 0 & 100 \\
  SR2 (urban) & 2772 & 40.867 & 30.665 & 0 & 100 \\
  \addlinespace
  SR2+ (pooled) & 3671 & 60.649 & 21.319 & 0.306 & 100 \\
  SR2+ (rural) & 1923 & 62.674 & 21.794 & 1 & 100 \\
  SR2+ (urban) & 1748 & 58.421 & 20.561 & 0.306 & 100 \\
  \addlinespace
  SRdummy2 (pooled) & 5887 & 0.758 & 0.428 & 0 & 1 \\
  SRdummy2 (rural) & 3115 & 0.754 & 0.431 & 0 & 1 \\
  SRdummy2 (urban) & 2772 & 0.763 & 0.426 & 0 & 1 \\
  \addlinespace
  PropRisky (pooled) & 5884 & 6.204 & 19.588 & 0 & 100 \\
  PropRisky (rural) & 3049 & 1.343 & 9.069 & 0 & 100 \\
  PropRisky (urban) & 2835 & 11.432 & 25.598 & 0 & 100 \\
  \addlinespace
  ProbRisky (pooled) & 5884 & 0.124 & 0.330 & 0 & 1 \\
  ProbRisky (rural) & 3049 & 0.033 & 0.179 & 0 & 1 \\
  ProbRisky (urban) & 2835 & 0.223 & 0.416 & 0 & 1 \\
  \addlinespace
  LnInc (pooled) & 5842 & 10.236 & 1.295 & 1.386 & 14.914 \\
  LnInc (rural) & 3081 & 9.948 & 1.223 & 1.386 & 14.914 \\
  LnInc (urban) & 2761 & 10.558 & 1.299 & 3.555 & 14.914 \\
  \addlinespace
  Age (pooled) & 6089 & 44.370 & 8.882 & 25 & 59 \\
  Age (rural) & 3191 & 45.180 & 8.627 & 25 & 59 \\
  Age (urban) & 2898 & 43.478 & 9.072 & 25 & 59 \\
  \addlinespace
  Education (pooled) & 6042 & 3.645 & 1.648 & 1 & 9 \\
  Education (rural) & 3176 & 2.776 & 0.974 & 1 & 7 \\
  Education (urban) & 2866 & 4.609 & 1.706 & 1 & 9 \\
  \addlinespace
  Kid (pooled) & 6089 & 0.664 & 0.779 & 0 & 9 \\
  Kid (rural) & 3191 & 0.799 & 0.892 & 0 & 9 \\
  Kid (urban) & 2898 & 0.516 & 0.599 & 0 & 3 \\
  \addlinespace
  Old (pooled) & 6089 & 0.229 & 0.531 & 0 & 4 \\
  Old (rural) & 3191 & 0.252 & 0.550 & 0 & 3 \\
  Old (urban) & 2898 & 0.203 & 0.509 & 0 & 4 \\
  \addlinespace
  HHsize (pooled) & 6089 & 3.634 & 1.401 & 1 & 18 \\
  HHsize (rural) & 3191 & 4.042 & 1.495 & 1 & 18 \\
  HHsize (urban) & 2898 & 3.185 & 1.131 & 1 & 10 \\
  \addlinespace
  Male (pooled) & 6089 & 0.729 & 0.444 & 0 & 1 \\
  Male (rural) & 3191 & 0.803 & 0.398 & 0 & 1 \\
  Male (urban) & 2898 & 0.649 & 0.477 & 0 & 1 \\
  \addlinespace
  Married (pooled) & 6037 & 0.914 & 0.280 & 0 & 1 \\
  Married (rural) & 3173 & 0.939 & 0.240 & 0 & 1 \\
  Married (urban) & 2864 & 0.887 & 0.317 & 0 & 1 \\
  \addlinespace
  Party (pooled) & 5679 & 0.148 & 0.355 & 0 & 1 \\
  Party (rural) & 2949 & 0.063 & 0.243 & 0 & 1 \\
  Party (urban) & 2730 & 0.240 & 0.427 & 0 & 1 \\
  \addlinespace
  Job (pooled) & 6089 & 0.809 & 0.393 & 0 & 1 \\
  Job (rural) & 3191 & 0.913 & 0.282 & 0 & 1 \\
  Job (urban) & 2898 & 0.695 & 0.460 & 0 & 1 \\
  \addlinespace
  House (pooled) & 6088 & 0.912 & 0.283 & 0 & 1 \\
  House (rural) & 3191 & 0.946 & 0.226 & 0 & 1 \\
  House (urban) & 2897 & 0.875 & 0.331 & 0 & 1
\end{longtable}

\newpage \renewcommand{\arraystretch}{1}\small
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{longtable}{ >{\bfseries}llS[table-format =4.0]*{3}{S[table-format =2.3]}S[table-format =3.3]}
  \captionsetup{skip = 6pt}
  \caption{Descriptive Statistics (Pooled Sample)}
  \label{tab:Sum} \\
  \toprule
            & {Obs} & {Mean} & {Std. Dev.} & {Min} & {Max} \\
  \midrule\noalign{\vspace*{-\belowrulesep}}
  \endfirsthead
  \toprule
            & {Obs} & {Mean} & {Std. Dev.} & {Min} & {Max} \\
  \midrule
  \endhead
  \\
  \bottomrule
  \endlastfoot
  \rowcolor{Gainsboro}\bigstrut[t]
  SR1 & (pooled) & 5887 & 30.605 & 30.777 & 0 & 100 \\
            & (rural) & 3115 & 31.253 & 31.832 & 0 & 100 \\
            & (urban) & 2772 & 29.876 & 29.535 & 0 & 100 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  SR1 + & (pooled) & 3671 & 49.079 & 24.743 & 0.024 & 100 \\
            & (rural) & 1923 & 50.626 & 25.699 & 0.062 & 100 \\
            & (urban) & 1748 & 47.377 & 23.536 & 0.024 & 100 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  SRdummy1 & (pooled) & 5887 & 0.624 & 0.485 & 0 & 1 \\
            & (rural) & 3115 & 0.617 & 0.486 & 0 & 1 \\
            & (urban) & 2772 & 0.631 & 0.483 & 0 & 1 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  SR2 & (pooled) & 5887 & 42.495 & 31.928 & 0 & 100 \\
            & (rural) & 3115 & 43.943 & 32.949 & 0 & 100 \\
            & (urban) & 2772 & 40.867 & 30.665 & 0 & 100 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  SR2+ & (pooled) & 3671 & 60.649 & 21.319 & 0.306 & 100 \\
            & (rural) & 1923 & 62.674 & 21.794 & 1 & 100 \\
            & (urban) & 1748 & 58.421 & 20.561 & 0.306 & 100 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  SRdummy2 & (pooled) & 5887 & 0.758 & 0.428 & 0 & 1 \\
            & (rural) & 3115 & 0.754 & 0.431 & 0 & 1 \\
            & (urban) & 2772 & 0.763 & 0.426 & 0 & 1 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  PropRisky & (pooled) & 5884 & 6.204 & 19.588 & 0 & 100 \\
            & (rural) & 3049 & 1.343 & 9.069 & 0 & 100 \\
            & (urban) & 2835 & 11.432 & 25.598 & 0 & 100 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  ProbRisky & (pooled) & 5884 & 0.124 & 0.330 & 0 & 1 \\
            & (rural) & 3049 & 0.033 & 0.179 & 0 & 1 \\
            & (urban) & 2835 & 0.223 & 0.416 & 0 & 1 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  LnInc & (pooled) & 5842 & 10.236 & 1.295 & 1.386 & 14.914 \\
            & (rural) & 3081 & 9.948 & 1.223 & 1.386 & 14.914 \\
            & (urban) & 2761 & 10.558 & 1.299 & 3.555 & 14.914 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  Age & (pooled) & 6089 & 44.370 & 8.882 & 25 & 59 \\
            & (rural) & 3191 & 45.180 & 8.627 & 25 & 59 \\
            & (urban) & 2898 & 43.478 & 9.072 & 25 & 59 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  Education & (pooled) & 6042 & 3.645 & 1.648 & 1 & 9 \\
            & (rural) & 3176 & 2.776 & 0.974 & 1 & 7 \\
            & (urban) & 2866 & 4.609 & 1.706 & 1 & 9 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  Kid & (pooled) & 6089 & 0.664 & 0.779 & 0 & 9 \\
            & (rural) & 3191 & 0.799 & 0.892 & 0 & 9 \\
            & (urban) & 2898 & 0.516 & 0.599 & 0 & 3 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  Old & (pooled) & 6089 & 0.229 & 0.531 & 0 & 4 \\
            & (rural) & 3191 & 0.252 & 0.550 & 0 & 3 \\
            & (urban) & 2898 & 0.203 & 0.509 & 0 & 4 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  HHsize & (pooled) & 6089 & 3.634 & 1.401 & 1 & 18 \\
            & (rural) & 3191 & 4.042 & 1.495 & 1 & 18 \\
            & (urban) & 2898 & 3.185 & 1.131 & 1 & 10 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  Male & (pooled) & 6089 & 0.729 & 0.444 & 0 & 1 \\
            & (rural) & 3191 & 0.803 & 0.398 & 0 & 1 \\
            & (urban) & 2898 & 0.649 & 0.477 & 0 & 1 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  Married & (pooled) & 6037 & 0.914 & 0.280 & 0 & 1 \\
            & (rural) & 3173 & 0.939 & 0.240 & 0 & 1 \\
            & (urban) & 2864 & 0.887 & 0.317 & 0 & 1 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  Party & (pooled) & 5679 & 0.148 & 0.355 & 0 & 1 \\
            & (rural) & 2949 & 0.063 & 0.243 & 0 & 1 \\
            & (urban) & 2730 & 0.240 & 0.427 & 0 & 1 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  Job & (pooled) & 6089 & 0.809 & 0.393 & 0 & 1 \\
            & (rural) & 3191 & 0.913 & 0.282 & 0 & 1 \\
            & (urban) & 2898 & 0.695 & 0.460 & 0 & 1 \\
  \rowcolor{Gainsboro}\bigstrut[t]
  House & (pooled) & 6088 & 0.912 & 0.283 & 0 & 1 \\
            & (rural) & 3191 & 0.946 & 0.226 & 0 & 1 \\
            & (urban) & 2897 & 0.875 & 0.331 & 0 & 1 
\end{longtable}

\end{document} 

enter image description here enter image description here enter image description here

3
  • Many thanks! Just wonder if I'd leave the last two in the original style, what should I change in the code? Jul 18, 2017 at 13:21
  • In the table preamble, replace *{3}{S[table-format =2.3]}S[table-format =3.3]with a simple *{2}{S[table-format =2.3]}cc
    – Bernard
    Jul 18, 2017 at 13:28
  • 1
    @Mico: I didn't feel like modifying that too, but you' re perfectly right. I've fixed the code.
    – Bernard
    Jul 18, 2017 at 16:41
2

Rather than attempt to squeeze the entire table into a single page -- by using the \small directive and resetting \arraystretch to a number much smaller than 1 -- you should use a longtable environment, which can handle page breaks.

enter image description here

\documentclass{article}
\usepackage{booktabs,siunitx,longtable}
% longtable: see https://ctan.org/pkg/longtable for more information

\begin{document}
    \begin{longtable}{@{} lc *{3}{S[table-format=2.3]} S[table-format=3.3] @{}}
    \caption{Descriptive Statistics (Pooled Sample)}
    \label{tab:sum}\\

    %% Headers and footers of longtable   
    \toprule
    &   Obs.& {Mean} &  {St.\ Dev.}& {Min} & {Max} \\
    \midrule
    \endfirsthead

    \multicolumn{6}{@{}l}{\small Table \ref{tab:sum}, cont'd from preceding page}\\
    \addlinespace
    \toprule
    &   Obs.& {Mean} &  {St.\ Dev.}& {Min} & {Max} \\
    \midrule
    \endhead

    \bottomrule
    \addlinespace
    \multicolumn{6}{r@{}}{\small (continued)}\\
    \endfoot

    \bottomrule
    \endlastfoot

    %% Body of table
    SR1 (pooled)       & 5887 & 30.605 & 30.777 & 0     & 100    \\
    SR1 (rural)        & 3115 & 31.253 & 31.832 & 0     & 100    \\
    SR1 (urban)        & 2772 & 29.876 & 29.535 & 0     & 100    \\
    SR1+ (pooled)      & 3671 & 49.079 & 24.743 & 0.024 & 100    \\
    SR1+ (rural)       & 1923 & 50.626 & 25.699 & 0.062 & 100    \\
    SR1+ (urban)       & 1748 & 47.377 & 23.536 & 0.024 & 100    \\
    SRdummy1 (pooled)  & 5887 & 0.624  & 0.485  & 0     & 1      \\
    SRdummy1 (rural)   & 3115 & 0.617  & 0.486  & 0     & 1      \\
    SRdummy1 (urban)   & 2772 & 0.631  & 0.483  & 0     & 1      \\
    SR2 (pooled)       & 5887 & 42.495 & 31.928 & 0     & 100    \\
    SR2 (rural)        & 3115 & 43.943 & 32.949 & 0     & 100    \\
    SR2 (urban)        & 2772 & 40.867 & 30.665 & 0     & 100    \\
    SR2+ (pooled)      & 3671 & 60.649 & 21.319 & 0.306 & 100    \\
    SR2+ (rural)       & 1923 & 62.674 & 21.794 & 1     & 100    \\
    SR2+ (urban)       & 1748 & 58.421 & 20.561 & 0.306 & 100    \\
    SRdummy2 (pooled)  & 5887 & 0.758  & 0.428  & 0     & 1      \\
    SRdummy2 (rural)   & 3115 & 0.754  & 0.431  & 0     & 1      \\
    SRdummy2 (urban)   & 2772 & 0.763  & 0.426  & 0     & 1      \\
    PropRisky (pooled) & 5884 & 6.204  & 19.588 & 0     & 100    \\
    PropRisky (rural)  & 3049 & 1.343  & 9.069  & 0     & 100    \\
    PropRisky (urban)  & 2835 & 11.432 & 25.598 & 0     & 100    \\
    ProbRisky (pooled) & 5884 & 0.124  & 0.330  & 0     & 1      \\
    ProbRisky (rural)  & 3049 & 0.033  & 0.179  & 0     & 1      \\
    ProbRisky (urban)  & 2835 & 0.223  & 0.416  & 0     & 1      \\
    LnInc (pooled)     & 5842 & 10.236 & 1.295  & 1.386 & 14.914 \\
    LnInc (rural)      & 3081 & 9.948  & 1.223  & 1.386 & 14.914 \\
    LnInc (urban)      & 2761 & 10.558 & 1.299  & 3.555 & 14.914 \\
    Age (pooled)       & 6089 & 44.370 & 8.882  & 25    & 59     \\
    Age (rural)        & 3191 & 45.180 & 8.627  & 25    & 59     \\
    Age (urban)        & 2898 & 43.478 & 9.072  & 25    & 59     \\
    Education (pooled) & 6042 & 3.645  & 1.648  & 1     & 9      \\
    Education (rural)  & 3176 & 2.776  & 0.974  & 1     & 7      \\
    Education (urban)  & 2866 & 4.609  & 1.706  & 1     & 9      \\
    Kid (pooled)       & 6089 & 0.664  & 0.779  & 0     & 9      \\
    Kid (rural)        & 3191 & 0.799  & 0.892  & 0     & 9      \\
    Kid (urban)        & 2898 & 0.516  & 0.599  & 0     & 3      \\
    Old (pooled)       & 6089 & 0.229  & 0.531  & 0     & 4      \\
    Old (rural)        & 3191 & 0.252  & 0.550  & 0     & 3      \\
    Old (urban)        & 2898 & 0.203  & 0.509  & 0     & 4      \\
    HHsize (pooled)    & 6089 & 3.634  & 1.401  & 1     & 18     \\
    HHsize (rural)     & 3191 & 4.042  & 1.495  & 1     & 18     \\
    HHsize (urban)     & 2898 & 3.185  & 1.131  & 1     & 10     \\
    Male (pooled)      & 6089 & 0.729  & 0.444  & 0     & 1      \\
    Male (rural)       & 3191 & 0.803  & 0.398  & 0     & 1      \\
    Male (urban)       & 2898 & 0.649  & 0.477  & 0     & 1      \\
    Married (pooled)   & 6037 & 0.914  & 0.280  & 0     & 1      \\
    Married (rural)    & 3173 & 0.939  & 0.240  & 0     & 1      \\
    Married (urban)    & 2864 & 0.887  & 0.317  & 0     & 1      \\
    Party (pooled)     & 5679 & 0.148  & 0.355  & 0     & 1      \\
    Party (rural)      & 2949 & 0.063  & 0.243  & 0     & 1      \\
    Party (urban)      & 2730 & 0.240  & 0.427  & 0     & 1      \\
    Job (pooled)       & 6089 & 0.809  & 0.393  & 0     & 1      \\
    Job (rural)        & 3191 & 0.913  & 0.282  & 0     & 1      \\
    Job (urban)        & 2898 & 0.695  & 0.460  & 0     & 1      \\
    House (pooled)     & 6088 & 0.912  & 0.283  & 0     & 1      \\
    House (rural)      & 3191 & 0.946  & 0.226  & 0     & 1      \\
    House (urban)      & 2897 & 0.875  & 0.331  & 0     & 1      \\

    \end{longtable}
\end{document}
2
  • Many thanks for help! I also take some code from yours but I can only set to accept one answer. So sorry about this! Jul 18, 2017 at 16:10
  • @JustinJunfeiZhu - No worries. Glad to know you found my answer useful.
    – Mico
    Jul 18, 2017 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .