Skip to contents

Applies every get_*() ratio function in the fiscal package to a data frame in a single call. The data frame is sanitized once up front using sanitize_financials(), then each function is called with sanitize = FALSE to avoid redundant imputation passes.

Usage

compute_all(
  df,
  metrics = c("ratio", "w", "z", "p"),
  append_to_df = TRUE,
  winsorize = 0.98,
  verbose = TRUE
)

Arguments

df

A data.frame containing IRS 990 efile financial fields.

metrics

Character vector of metric variants to return. Any combination of "ratio", "w", "z", "p". Defaults to all four.

append_to_df

Logical. If TRUE (default), returns the original df with metric columns appended. If FALSE, returns only .IDVARS identifier columns plus the selected metric columns.

winsorize

Winsorization proportion (default 0.98).

verbose

Logical. If TRUE (default), prints progress messages.

Value

A data.frame.

Examples

library( fiscal )
data( dat10k )
d <- compute_all( dat10k )
#> Sanitizing financial fields ...
#> 
#> }} Computing get_current_ratio ...
#>    :: Current liabilities equal to zero :: 168 case(s) replaced with NaN
#> 
#> }} Computing get_quick_ratio ...
#>    :: Current liabilities equal to zero :: 168 case(s) replaced with NaN
#> 
#> }} Computing get_cash_liquidity_ratio ...
#>    :: Current liabilities equal to zero :: 168 case(s) replaced with NaN
#> 
#> }} Computing get_cash_assets_ratio ...
#>    :: Total assets equal to zero :: 274 case(s) replaced with NaN
#> 
#> }} Computing get_cash_on_hand ...
#> 
#> }} Computing get_cash_burn_ratio ...
#> 
#> }} Computing get_days_cash_operations ...
#>    :: Daily operating expenses equal to zero :: 86 case(s) replaced with NaN
#> 
#> }} Computing get_days_cash_investments ...
#>    :: Daily operating expenses equal to zero :: 86 case(s) replaced with NaN
#> 
#> }} Computing get_months_cash_operations ...
#>    :: Monthly operating expenses equal to zero :: 86 case(s) replaced with NaN
#> 
#> }} Computing get_liquid_assets_months ...
#>    :: Total expenses equal to zero :: 77 case(s) replaced with NaN
#> 
#> }} Computing get_debt_assets_ratio ...
#>    :: Assets equal to zero :: 274 case(s) replaced with NaN
#> 
#> }} Computing get_debt_equity_ratio ...
#>    :: Equity equal to zero :: 329 case(s) replaced with NaN
#> 
#> }} Computing get_debt_netassets_ratio ...
#>    :: Net assets equal to zero :: 329 case(s) replaced with NaN
#> 
#> }} Computing get_debt_shortterm_ratio ...
#>    :: Net assets equal to zero :: 709 case(s) replaced with NaN
#> 
#> }} Computing get_debt_secured_ratio ...
#>    :: Total liabilities equal to zero :: 2,928 case(s) replaced with NaN
#> 
#> }} Computing get_debt_unsecured_ratio ...
#> Warning: get_debt_unsecured_ratio() skipped: None of the specified columns were found in the data: F9_10_LIAB_NOTE_UNSEC_EOY
#> 
#> }} Computing get_self_sufficiency_ratio ...
#>    :: Total expenses equal to zero :: 143 case(s) replaced with NaN
#> 
#> }} Computing get_earned_income_ratio ...
#>    :: Total revenue equal to zero :: 74 case(s) replaced with NaN
#> 
#> }} Computing get_grants_govt_ratio ...
#>    :: Total revenue equal to zero :: 74 case(s) replaced with NaN
#> 
#> }} Computing get_donations_revenue_ratio ...
#>    :: Total revenue equal to zero :: 74 case(s) replaced with NaN
#> 
#> }} Computing get_investment_income_ratio ...
#>    :: Total revenue equal to zero :: 74 case(s) replaced with NaN
#> 
#> }} Computing get_assets_revenue_ratio ...
#>    :: Total revenue equal to zero :: 200 case(s) replaced with NaN
#> 
#> }} Computing get_revenue_fedcampaign_ratio ...
#> Warning: get_revenue_fedcampaign_ratio() skipped: None of the specified columns were found in the data: F9_08_REV_CONTR_FED_CAMP
#> 
#> }} Computing get_revenue_membdues_ratio ...
#>    :: Total revenue equal to zero :: 74 case(s) replaced with NaN
#> 
#> }} Computing get_revenue_fundevents_ratio ...
#> Warning: get_revenue_fundevents_ratio() skipped: None of the specified columns were found in the data: F9_08_REV_CONTR_FUNDR_EVNT
#> 
#> }} Computing get_revenue_reltdorgs_ratio ...
#> Warning: get_revenue_reltdorgs_ratio() skipped: None of the specified columns were found in the data: F9_08_REV_CONTR_RLTD_ORG
#> 
#> }} Computing get_revenue_programs_ratio ...
#>    :: Total revenue equal to zero :: 74 case(s) replaced with NaN
#> 
#> }} Computing get_program_expenses_ratio ...
#>    :: Total expenses equal to zero :: 143 case(s) replaced with NaN
#> 
#> }} Computing get_expenses_admin_ratio ...
#>    :: Total expenses equal to zero :: 77 case(s) replaced with NaN
#> 
#> }} Computing get_overhead_ratio ...
#>    :: Total expenses equal to zero :: 77 case(s) replaced with NaN
#> 
#> }} Computing get_fundraising_efficiency_ratio ...
#>    :: Total contributions equal to zero :: 244 case(s) replaced with NaN
#> 
#> }} Computing get_profit_margin_postdepr ...
#>    :: Revenue equal to zero :: 74 case(s) replaced with NaN
#> 
#> }} Computing get_profit_margin_predepr ...
#>    :: Revenue equal to zero :: 74 case(s) replaced with NaN
#> 
#> }} Computing get_expenses_grants_ratio ...
#> Warning: get_expenses_grants_ratio() skipped: None of the specified columns were found in the data: F9_09_EXP_GRANT_US_ORG_TOT
#> 
#> }} Computing get_expenses_membbenefits_ratio ...
#> Warning: get_expenses_membbenefits_ratio() skipped: None of the specified columns were found in the data: F9_09_EXP_BEN_PAID_MEMB_TOT
#> 
#> }} Computing get_expenses_compensation_ratio ...
#> Warning: get_expenses_compensation_ratio() skipped: None of the specified columns were found in the data: F9_09_EXP_COMP_DTK_TOT
#> 
#> }} Computing get_expenses_feesforservice_ratio ...
#> Warning: get_expenses_feesforservice_ratio() skipped: None of the specified columns were found in the data: F9_09_EXP_FEE_SVC_MGMT_TOT
#> 
#> }} Computing get_expenses_affiliates_ratio ...
#> Warning: get_expenses_affiliates_ratio() skipped: None of the specified columns were found in the data: F9_09_EXP_PAY_AFFIL_TOT
#> 
#> }} Computing get_equity_ratio ...
#>    :: Total assets equal to zero :: 274 case(s) replaced with NaN
#> 
#> }} Computing get_netassets_composition_ratio ...
#>    :: Total net assets equal to zero :: 709 case(s) replaced with NaN
#> 
#> }} Computing get_operating_reserve_ratio ...
#>    :: Total expenses equal to zero :: 77 case(s) replaced with NaN
#> 
#> }} Computing get_land_assets_gross_ratio ...
#>    :: Total assets equal to zero :: 274 case(s) replaced with NaN
#> 
#> }} Computing get_land_assets_net_ratio ...
#>    :: Total assets equal to zero :: 274 case(s) replaced with NaN
#> 
#> }} Computing get_investments_assets_ratio ...
#> Warning: get_investments_assets_ratio() skipped: None of the specified columns were found in the data: F9_10_ASSET_INVEST_SEC_EOY
#> 
#> }} Computing get_netassets_growth_ratio ...
#>    :: Beginning net assets equal to zero :: 930 case(s) replaced with NaN
#> 
#> }} Computing get_surplus_margin_ratio ...
#>    :: Total revenue equal to zero :: 200 case(s) replaced with NaN
#> 
#> }} Computing get_return_assets_ratio ...
#>    :: Total assets equal to zero :: 274 case(s) replaced with NaN
#> 
#> }} Computing get_return_netassets_ratio ...
#>    :: Beginning net assets equal to zero :: 930 case(s) replaced with NaN
#> Done. 152 metric column(s) produced.
dim( d )
#> [1] 10000   245