[R] Creating Better Table in R

bobo blezaic2 at gmail.com
Mon Apr 9 10:55:39 CEST 2012


Could anyone please direct me on how to make a nicer table in R? THANKS FOR
ALL THE HELP!

I would like to make a table with the following in it: estimate, t value,
significance, beta, standard errors, adjusted r squared, and residual
standard error (3 decimal points if possible, but I can do it by hand). Also
I'd love to include the source of my information on the bottom of the table
if possible.

file :  http://r.789695.n4.nabble.com/file/n4542349/datpat.csv datpat.csv 

this is the code I am using

mod.1<-lm(Patents~FHouse, data=datpat)
summary(mod.1)
xtable(summary(mod.1))

*table I'm creating*
http://r.789695.n4.nabble.com/file/n4542349/chart.jpg 




*Detailed code*

*Summary Stats:*

Residuals:
    Min      1Q  Median      3Q     Max 
-1.7540 -0.8833 -0.5123  0.1183 11.9858 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  2.61776    0.52866   4.952 1.34e-06 ***
FHouse      -0.18792    0.08489  -2.214   0.0277 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 1.77 on 254 degrees of freedom
Multiple R-squared: 0.01893,	Adjusted R-squared: 0.01507 
F-statistic: 4.901 on 1 and 254 DF,  p-value: 0.02773 

*X Table Code:*
\begin{table}[ht]
\begin{center}
\begin{tabular}{rrrrr}
  \hline
 & Estimate & Std. Error & t value & Pr($>$$|$t$|$) \\ 
  \hline
(Intercept) & 2.6178 & 0.5287 & 4.95 & 0.0000 \\ 
  FHouse & -0.1879 & 0.0849 & -2.21 & 0.0277 \\ 
   \hline
\end{tabular}
\end{center}
\end{table}

--
View this message in context: http://r.789695.n4.nabble.com/Creating-Better-Table-in-R-tp4542349p4542349.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list