I just ran a statisitical model and i want it to display the results of the model as a table using stargazer. However, the large numbers are displayed in full.
fit2<-lm(A~B,data=C)
stargazer(fit2,type="text")
With this table as result
===================================================
Dependent variable:
-------------------------------
A
---------------------------------------------------
B -0.599
(1.698)
32,126,391.000
(24,004,268.000)
---------------------------------------------------
Observations 5
R2 0.040
Adjusted R2 -0.280
Residual Std. Error 31,217,258.000 (df = 3e+00)
F Statistic 0.124 (df = 1e+00; 3e+00)
===================================================
Note: *p<1e-01; **p<5e-02; ***p<1e-02
How do I get the large numbers displayed as scientific i.e: 3.12e+07, please? I have tried:
options("scipen"=-20,"digit"=2)
fit1<-format(lm(A~B,data=C),scientific=T)
This however causes the summary of the model to be distortrd and displayed as a single row. What are the best ways to format the numbers and retain the table structure, please?
CO NO2 SM
Dec 2004 2.750000e+18 1.985136e+15 0.2187433
Jan 2005 2.980000e+18 2.144211e+15 0.1855678
Feb 2005 2.810000e+18 1.586491e+15 0.1764805
Dec 2005 3.010000e+18 1.755409e+15 0.2307153
Jan 2006 3.370000e+18 2.205888e+15 0.2046671
Feb 2006 3.140000e+18 2.084682e+15 0.1834232
Dec 2006 2.940000e+18 1.824735e+15 0.1837391
Jan 2007 3.200000e+18 2.075785e+15 0.1350665
Feb 2007 3.060000e+18 1.786481e+15 0.1179924
Dec 2007 2.750000e+18 1.645800e+15 0.2037340
Jan 2008 3.030000e+18 1.973517e+15 0.1515871
Feb 2008 3.040000e+18 1.753803e+15 0.1289968
Dec 2008 2.800000e+18 1.649315e+15 0.1968024
Jan 2009 3.090000e+18 1.856762e+15 0.1630173
Feb 2009 2.880000e+18 1.610011e+15 0.1446938
Dec 2009 2.660000e+18 1.562971e+15 0.1986012
Jan 2010 2.864333e+18 1.733843e+15 0.1559205
Feb 2010 2.881474e+18 1.469982e+15 0.1397536
Dec 2010 2.730000e+18 1.652751e+15 0.2129476
Jan 2011 3.030000e+18 1.862774e+15 0.1681295
Feb 2011 2.850000e+18 1.658988e+15 0.1531579