I am trying to create a summary statistics table with Stargazer with some large variables (mean>1000) and some smaller ones (<1). The problem is that I don't want decimals on the larger numbers, only on the smaller ones. I tried using digits.extra, but it did not appear to work.
Problem:
test<-data.frame(a=c(0.3, 0.45),b=c(3320,2583))
stargazer(test, type='text', omit.summary.stat = c("p25", "p75"))
==========================================
Statistic N Mean St. Dev. Min Max
------------------------------------------
a 2 0.375 0.106 0.300 0.450
b 2 2,951.500 521.138 2,583 3,320
------------------------------------------
Code I hoped would work:
stargazer(test, type='text', omit.summary.stat = c("p25", "p75"), digits=0, digits.extra = 3)
======================================
Statistic N Mean St. Dev. Min Max
--------------------------------------
a 2 0 0 0 0
b 2 2,952 521 2,583 3,320
--------------------------------------
What I want:
==========================================
Statistic N Mean St. Dev. Min Max
------------------------------------------
a 2 0.375 0.106 0.300 0.450
b 2 2,952 521 2,583 3,320
------------------------------------------
Is there a way to make this happen?