Panel of household total new loan amounts in each survey month, with separate
variables for all lenders, formal lenders, and informal lenders. Built by
aggregating positive S_Init_Amount from tstm_loans with the formal/informal
lender classification used in legacy data-raw/tstm_loans_amount.R.
Format
Household-month loan flow file.
- hhid_Num
Anonymized household ID (
tmid_hh). Matchesidintstm_asset_loanandhhid_Numintstm_loans_panel.- surveymonth
Survey month (unchanged; not an ID).
- amt_all_lenders
Total new loan amount from all lenders in the month.
- amt_formal
Total new loan amount from formal lenders in the month.
- amt_informal
Total new loan amount from informal lenders in the month.
Source
Regenerated by
vignettes/ffv_gen_asset_loan.qmd
(Section 0; consolidates legacy
data-raw/tstm_loans_amount.R;
PrjThaiHFID-#5).
Upstream input: data/tstm_loans.rda (loan-level file with anonymized IDs).
Set bl_replace_data_output <- TRUE in the vignette to overwrite
data/tstm_loans_amount.rda; FALSE writes to gitignored data-temp/ for
validation. The vignette also writes local-only CSV/DTA copies to
inst/extdata/tstm_loans_amount.{csv,dta}; that folder is git-ignored and
excluded from the build (.Rbuildignore), so it is not shipped — installed
users load the canonical data via data(tstm_loans_amount).
Examples
data(tstm_loans_amount)
ffp_preview_dataset(tstm_loans_amount)
#>
#> ── tstm_loans_amount ───────────────────────────────────────────────────────────
#> Dimensions: 15999 rows × 5 columns(563.8 Kb)
#>
#> ── Column names (5) ──
#>
#> • 1. hhid_Num
#> • 2. surveymonth
#> • 3. amt_all_lenders
#> • 4. amt_informal
#> • 5. amt_formal
#>
#> ── Summary statistics (all variables) ──
#>
#> hhid_Num surveymonth amt_all_lenders amt_informal
#> Min. :1003 Min. : 0.00 Min. : 63 Min. : 63
#> 1st Qu.:3043 1st Qu.: 45.00 1st Qu.: 5000 1st Qu.: 2160
#> Median :5338 Median : 77.00 Median : 16500 Median : 5000
#> Mean :5394 Mean : 78.48 Mean : 37544 Mean : 21741
#> 3rd Qu.:7641 3rd Qu.:113.00 3rd Qu.: 35000 3rd Qu.: 17000
#> Max. :9996 Max. :160.00 Max. :7000000 Max. :1130000
#> NAs :9022
#> amt_formal
#> Min. : 312
#> 1st Qu.: 10000
#> Median : 20000
#> Mean : 42209
#> 3rd Qu.: 40000
#> Max. :7000000
#> NAs :5362
#> ── Sample rows (first 6) ──
#>
#> # A tibble: 6 × 5
#> hhid_Num surveymonth amt_all_lenders amt_informal amt_formal
#> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 1003 0 11500 11500 NA
#> 2 1003 1 4500 4500 NA
#> 3 1003 2 3000 3000 NA
#> 4 1003 3 10000 10000 NA
#> 5 1003 9 3000 3000 NA
#> 6 1003 10 3500 3500 NA