- Questo topic ha 5 risposte, 3 partecipanti ed è stato aggiornato l'ultima volta 17 anni, 8 mesi fa da
lorenzo.pantieri.
-
CreatoreTopic
-
7 Dicembre 2008 alle 19:20 #29284::
Salve a tutti,
sono alle prese con la creazione di alcune tabelle. Il mio problema è qello di riuscire ad inserire due righe nella stessa “cella”.
Sto creando una tabella con i risultati di una regressione lineare, ed in ogni cella, oltre al valore del coefficiente stimato, vorrei inserire subito sotto, nella stessa cella in parentesi, il valore della statistica-t.Vi ringrazio anticipatamente,
Alessandro
-
CreatoreTopic
-
AutoreRisposte
-
-
7 Dicembre 2008 alle 19:59 #29285::
Salve a tutti,
sono alle prese con la creazione di alcune tabelle. Il mio problema è qello di riuscire ad inserire due righe nella stessa “cella”.
Sto creando una tabella con i risultati di una regressione lineare, ed in ogni cella, oltre al valore del coefficiente stimato, vorrei inserire subito sotto, nella stessa cella in parentesi, il valore della statistica-t.Il modo più semplice è di definirsi un comando apposito:
`\newcommand{\valore}[2]{\begin{tabular}{@{}c@{}}#1\\(#2)\end{tabular}}`
Inserirai \valore{235}{42} nella cella.Nulla vieta tabular dentro tabular. 🙂
Ciao
Enrico
-
8 Dicembre 2008 alle 23:40 #29286::
Ho messo tabular dentro tabular, ma ho grossi problemi con il dimensionamento della tabella\documentclass[12pt,a4paper]{report}
\linespread{1.5}
\usepackage[italian]{babel}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}\linespread{1}
\footnotesize
\begin{tabular}{lccccccc}
\textbf{Regressori} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} \\ \hline\begin{tabular}{l}Costante\\\\\end{tabular} & \begin{tabular}{c}-1.250\\(-0.808)\end{tabular} & \begin{tabular}{c}14.913\\(7.205)\end{tabular} & \begin{tabular}{c}0.853\\(0.427)\end{tabular} & \begin{tabular}{c}7.034\\(2.469)\end{tabular} & \begin{tabular}{c}9.539\\(3.850)\end{tabular} & \begin{tabular}{c}9.875\\(3.966)\end{tabular} & \begin{tabular}{c}9.865\\(2.452)\end{tabular} \\
\begin{tabular}{l}Log naturale del Pil procapite nel 1970\\\\\end{tabular} & \begin{tabular}{c}0.365\\(1.799)\end{tabular} & \begin{tabular}{c}-1.368\\(-5.643)\end{tabular} & \begin{tabular}{c}-0.022\\(-0.080)\end{tabular} & \begin{tabular}{c}-1.013\\(-2.588)\end{tabular} & \begin{tabular}{c}-1.269\\(-3.765)\end{tabular} & \begin{tabular}{c}-1.395\\(4.151)\end{tabular} & \begin{tabular}{c}-1.369\\(-4.122)\end{tabular} \\
\begin{tabular}{l}Dummy per il livello di apertura economica\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}2.450\\(5.403)\end{tabular} & \begin{tabular}{c}2.208\\(4.795)\end{tabular} & \begin{tabular}{c}2.203\\(4.721)\end{tabular} \\
\begin{tabular}{l}Dummy per il livello di repressione politica\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}-0,882\\(1.986)\end{tabular} & \begin{tabular}{c}-0.882\\(1.972)\end{tabular} \\
\begin{tabular}{l}Tasso di iscrizione alla scuola secondaria\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}3.731\\(1.729)\end{tabular} & \begin{tabular}{c}2.568\\(1.385)\end{tabular} & \begin{tabular}{c}2.795\\(1.536)\end{tabular} & \begin{tabular}{c}2.756\\(1.464)\end{tabular} \\
\begin{tabular}{l}Tasso di iscrizione alla scuola primaria\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}0.324\\(0.302)\end{tabular} & \begin{tabular}{c}0.308\\(0.335)\end{tabular} & \begin{tabular}{c}0.126\\(0.139)\end{tabular} & \begin{tabular}{c}0.145\\(0.155)\end{tabular} \\
\begin{tabular}{l}Quota di spesa pubblica sul Pil al netto delle spese militari e in istruzione\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}-5.816\\(-1.574)\end{tabular} & \begin{tabular}{c}-6.107\\(-1.906)\end{tabular} & \begin{tabular}{c}-6.713\\(-2.130)\end{tabular} & \begin{tabular}{c}-6.669\\(-2.079)\end{tabular} \\
\begin{tabular}{l}Numero di rivoluzioni, colpi di stato per anno\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}-3.358\\(-0.405)\end{tabular} & \begin{tabular}{c}-0.090\\(-0.119)\end{tabular} & \begin{tabular}{c}0.592\\(0.726)\end{tabular} & \begin{tabular}{c}0.601\\(0.727)\end{tabular} \\
\begin{tabular}{l}Numero medio di omicidi rispetto alla popolazione\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}-1.932\\(-1.212)\end{tabular} & \begin{tabular}{c}-1.699\\(-1.251)\end{tabular} & \begin{tabular}{c}-1.421\\(-1.063)\end{tabular} & \begin{tabular}{c}-1.424\\(-1.056)\end{tabular} \\
\begin{tabular}{l}Prezzo relativo dei beni di investimento\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}-0.993\\(-2.240)\end{tabular} & \begin{tabular}{c}-1.020\\(-2.656)\end{tabular} & \begin{tabular}{c}-0.965\\(-2.556)\end{tabular} & \begin{tabular}{c}-0.964\\(-2.537)\end{tabular} \\
\begin{tabular}{l}Quota di investimento lordo reale rispetto al Pil\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}11.953\\(3.314)\end{tabular} & \begin{tabular}{c}5.662\\(1.708)\end{tabular} & \begin{tabular}{c}6.252\\(1.918)\end{tabular} & \begin{tabular}{c}6.302\\(1.896)\end{tabular} \\
\begin{tabular}{l}Densità della popolazione nel 1960\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}\\\\\\\end{tabular} & \begin{tabular}{c}0.008\\(0.097)\end{tabular} \\
$R^{2}$ & 0.019 & 0.491 & -0.013 & 0.364 & 0.538 & 0.557 & 0.550 \\
N & 117 & 33 & 78 & 81 & 79 & 79 & 79 \\ \hline
\end{tabular}\end{document}
-
9 Dicembre 2008 alle 0:57 #29287::
Ho messo tabular dentro tabular, ma ho grossi problemi con il dimensionamento della tabella
Mi dispiace che tu non abbia capito e abbia scritto quella cosa terrificante! L’idea era di usare la macro \valore; per esempio la prima riga (dopo l’intestazione) diventa
`Costante & \valore{-1.250}{-0.808} & \valore{14.913}{7.205} &
\valore{0.853}{0.427} & \valore{7.034}{2.469} &
\valore{9.539}{3.850} & \valore{9.875}{3.966} &
\valore{9.865}{2.452} \\`
Visto che si tratta di numeri anche negativi, la definizione di \valore deve essere modificata (va data prima di \begin{document}):
`\newcommand{\valore}[2]{%
\begin{tabular}{@{}c@{}}$#1$\\($#2$)\end{tabular}}`
Per il problema della dimensione, è evidente che se nella prima colonna vuoi farci stare tutto intero
`Quota di investimento lordo reale rispetto al Pil`
i problemi li avrai. Guarda su una guida di base; probabilmente la prima colonna andrà specificata con p{3cm} o qualcosa di simile:
`\begin{tabular}{p{3cm}*{7}{c}}
\toprule
\textbf{Regressori} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} \\
\midrule
Costante & \valore{-1.250}{-0.808} & \valore{14.913}{7.205} &
\valore{0.853}{0.427} & \valore{7.034}{2.469} &
\valore{9.539}{3.850} & \valore{9.875}{3.966} &
\valore{9.865}{2.452} \\
… \\
\bottomrule
\end{tabular}`
Come vedi è possibile specificare un certo numero di colonne con lo stesso tipo di specifica usando un’abbreviazione.I comandi \toprule, \midrule e \bottomrule sono forniti dal pacchetto booktabs che ti consiglio di usare.
Ciao
Enrico
-
28 Dicembre 2008 alle 17:03 #29288::
Chiedo perdono per la petulaza….
Alla fine ho messo i risultati della mia analisi empirica in questa tabella:\documentclass[12pt,a4paper,twoside,openright]{report}
\linespread{1.5}
\usepackage[italian]{babel}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\begin{document}\linespread{1}
\begin{table}
\centering
\caption{Regressione ad effetti fissi per l’intero campione di 61 Paesi in via di sviluppo}
\label{intero campione}
\resizebox{1.10\textwidth}{!}{
\begin{tabular}{ccccccccc}\\
&\multicolumn{8}{c}{\textbf{Variabile dipendente:}} \\
&\multicolumn{8}{c}{Tasso di crescita del Pil procapite} \\
\\
\begin{tabular}{l}\textbf{Regressore}\\\\\end{tabular} & \begin{tabular}{c}1\\Periodo\\1965-2003\end{tabular} & \begin{tabular}{c}2\\Periodo\\1965-2003\end{tabular} & \begin{tabular}{c}3\\Periodo\\1965-2003\end{tabular} & \begin{tabular}{c}4\\Periodo\\1965-2003\end{tabular} & \begin{tabular}{c}5\\Periodo\\1965-1985\end{tabular}& \begin{tabular}{c}6\\Periodo\\1965-1985\end{tabular} & \begin{tabular}{c}7\\Periodo\\1986-2003\end{tabular}& \begin{tabular}{c}8\\Periodo\\1986-2003\end{tabular}\\\hline
\\
$Coefficiente$ & 0,017108 & 0,011156 & 0,010705 & 0,012159 & 0,012088 & 0,008667 & 0,020734 & 0,007986\\
& (5,379404) &(3,181793) & (3,019976) & (3,470961) & (1,779027) & (1,253838) & 5,676746 &(1,599740)\\
\\
$\Delta lnKI(-1)$ & 0,019647 &0,019086 & 0,019130 & 0,019269 & 0,024580 & 0,023875 & 0,008931 &0,007671\\
& (3,775479) &(3,677960) & (3,685211) & (3,725555) & (3,563509) & (3,466267) & (1,108636) & (0,957255)\\
\\
$\Delta lnOPENK$ & -0,173955 & -0,176645 & -0,177279 & -0,177112 & -0,183449 & -0,183816 & -0,165676 & -0,167274\\
& (-18,97257) &(-19,27474) & (-19,27900) & (-19,38886) & (-13,12709) &(-13,18213) & (-13,63941)&(-13,74617)\\
\\
$\Delta lnPOP$ & -0,079958 &-0,012862 & -0,013320 & -0,059127 & 0,067408 & 0,066469 & -0,216870 & -0,161940\\
&(-0,635620) & (-0,101658) & (-0,105241) & (-0,466979) & (0,266330) &(0,253326) & (-1,444364) & (-1,079937)\\
\\
$LIB$ & &0,011519 & 0,011948 & 0,014746 & & 0,023686 & &0,017592\\
& &(3,975434) & (4,063086) & (4,923371) & &(2,538177) & &(3,719289)\\
\\
$\Delta lnPI$ & 0,016326 & 0,016502 & 0,015848 & 0,014857 & 0,019805 & 0,019841 & 0,017448&0,017790\\
&(2,763986) & (0,016502) &(2,669225) & (2,525585) & (2,124025) &(2,132694) &(2,307024)&(2,366610)\\
\\
$\Delta lnKG(-1)$ & 0,027230 & 0,028536 & 0,028507 & 0,028079 & 0,068254 & 0,069127 &-0,014293& -0,015836\\
&(2,313401) & (2,431143) & (2,427936) & (2,400085) & (3,949370) & (4,008028) &(-0,875139)&(-0,975299)\\
\\
$FIRSTSHOCK$ & & & 0,003434 & & & & & \\
& & & (0,637405) & & & & & \\
\\
$SECONDSHOCK$ & & & 0,004834 & & & & & \\
& & & (0,647858) & & & & & \\
\\
$WTC$ & & & & -0,022453 & & & \\
& & & & (-4,062948) & & & & \\
\\
$R^{2}$ & 0,192194 & 0,197679 & 0,197949 & 0,203369 & 0,207946 & 0,212127 & 0,239748 & 0,249813\\\\
$N. paesi$ & 61 & 61 & 61 & 61 & 61 & 61 & 61 & 61\\
\\
\hline
\end{tabular}}
\\
\footnotesize
I numeri in parentesi sono i valori della t-stat;\\
I coefficienti sono statisticamente significativi al livello ***10\%, **5\%, ***1\%.
\\
\end{table}\end{document}
Ho messo \centering per centrare la tabella; tuttavia vorrei che le note in fondo alla tabella non venissero centrate.
In generale come potrei migliorarne l’aspetto?Grazie anticipatamente,
Alessandro[/quote]
-
28 Dicembre 2008 alle 17:11 #29289
-
-
AutoreRisposte
- Devi essere connesso per rispondere a questo topic.