SETUP

library( foreign )
library( memisc )
library( knitr )
library( dplyr )
library( xtable )
library( stargazer )
library( broom)
library( pander )

LOAD DATA

dat <- readRDS( "./Data/CompleteHazardSpells.rds" )

# lapply( dat, class )
                  
# head( dat, 25 ) %>% pander

DESCRIPTIVE STATISTICS

Table of Spells

# num of times each org occurs in dataset

table( table( dat$ein)) %>% pander()
1 2 3 4 5 6
1535 2384 1450 1010 857 508

Organizations by Year

table( dat$fisyr )  %>% pander
1998 1999 2000 2001 2002 2003
2986 4489 4176 3910 3342 3123

when do orgs professionalize

table( dat$fisyr, dat$prof ) %>% pander
  0 1
1998 2986 0
1999 3873 616
2000 3494 682
2001 3411 499
2002 2990 352
2003 2815 308
round( prop.table( table( dat$fisyr, dat$prof ), margin=1 ), 3 ) %>% pander
  0 1
1998 1 0
1999 0.863 0.137
2000 0.837 0.163
2001 0.872 0.128
2002 0.895 0.105
2003 0.901 0.099

STARGAZER DESCRIPTIVES

# results='asis'

# "max" maximum
# "mean" mean
# "median" median
# "min" minimum
# "n" number of observations
# "p25" 25th percentile
# "p75" 75th percentile
# "sd" standard deviation

dd <- dat[ , c("prof","Accrual","GovtMoneyRat","UNAgrand","FixedCostRat",
               "SurplusRat_ndrop_w892","EqRat_w_K","ProfFundFeeYes",
               "FS_Totrev_adj","HHI") ]


stargazer( dd, digits=4,
           type = "html", out="./Results/DescriptiveStatistics.doc", 
           title="Descriptive Statistics",
           summary.stat = c( "min", "median", "mean", "max", "sd" ) )
Descriptive Statistics
Statistic Min Median Mean Max St. Dev.
prof 0 0 0.1115 1 0.3148
Accrual 0 0 0.2162 1 0.4116
GovtMoneyRat 0.0000 0.0000 0.0421 1.0000 0.1699
UNAgrand -4,631 0 18.3223 21,027 199.7073
FixedCostRat 0 0 0.0356 1 0.1126
SurplusRat_ndrop_w892 -6.7684 -0.2498 -2.1275 0.3798 2.9796
EqRat_w_K 0.0000 4.1733 29.6149 2,605.1730 91.1213
ProfFundFeeYes 0 0 0.0253 1 0.1570
FS_Totrev_adj 0.0000 34,730.8800 58,447.4900 45,324,067.0000 392,621.0000
HHI 0.0000 0.8477 0.6760 1.0000 0.3774