Household and capital-asset variable and investment by asset. We compute investment jumps for each capital-asset definition individually. This file has all investments for each household and each kept capital-asset definition (three paper ivars) (Agr. vs biz vs joint) definitions.
Format
Household and investment (unique start and end) file
- id
Household ID
- ivars
Capital-asset variable for finding investment jumps
- hh_inv_asset_ctr
Unique household + capital-asset investment counter
- hh_inv_ctr
Unique household investment span counter across
ivars- mth_inv_start
Start time of investment span
- mth_inv_end
End time of investment span
- capital_prior
Capital-asset level prior to investment
- capital_end
Capital-asset level after investment
- capital_invest
Level of investment, difference of end and prior
- thres_inv_mgap
Month gap allowed to merge investment jump together as one investment
- thres_inv_dfds
Standard deviation threshold for counting investment jump
Source
Regenerated by
vignettes/ffv_invest_loan_bridge.qmd
via ffp_hfid_invest_loan_linked_abc_investloan_char_gateway()
(PrjThaiHFID-#32).
Set bl_replace_data_output <- TRUE in the vignette to overwrite data/*.rda.
MBF filters: investment months 14–144, fl_min_invest_size = 10000,
ar_st_vars_to_keep = c("agg_BS_1021", "agg_BS_1012", "agg_BS_1011").
Packaged inputs: tstm_loans_panel, tstm_asset_loan (see ?tstm_loans_panel).
Household IDs are anonymized tmid_hh (id or hhid_Num), aligned with tstm_asset_loan.
Three paper asset ivars only; hh_inv_ctr spans kept ivars (gateway early filter).
See also issue-1, step 3.
Downstream vignettes: ffv_invest_freq_sizes regenerates an analogous
investment file and tabulates investment frequency/sizes (issue
#9).
Examples
data(tstm_invest)
ffp_preview_dataset(tstm_invest)
#>
#> ── tstm_invest ─────────────────────────────────────────────────────────────────
#> Dimensions: 4694 rows × 11 columns(350.8 Kb)
#>
#> ── Column names (11) ──
#>
#> • 1. thres_inv_mgap
#> • 2. thres_inv_dfsd
#> • 3. id
#> • 4. ivars
#> • 5. hh_inv_asset_ctr
#> • 6. hh_inv_ctr
#> • 7. mth_inv_start
#> • 8. mth_inv_end
#> • 9. capital_prior
#> • 10. capital_end
#> • 11. capital_invest
#>
#> ── Summary statistics (all variables) ──
#>
#> thres_inv_mgap thres_inv_dfsd id ivars
#> Min. :2 Min. :2.326 Min. :1003 Length :4694
#> 1st Qu.:2 1st Qu.:2.326 1st Qu.:3148 N.unique : 3
#> Median :2 Median :2.326 Median :5569 N.blank : 0
#> Mean :2 Mean :2.326 Mean :5485 Min.nchar: 11
#> 3rd Qu.:2 3rd Qu.:2.326 3rd Qu.:7701 Max.nchar: 11
#> Max. :2 Max. :2.326 Max. :9996
#> hh_inv_asset_ctr hh_inv_ctr mth_inv_start mth_inv_end
#> Min. :1.000 Min. : 1.000 Min. : 1.00 Min. : 1.00
#> 1st Qu.:1.000 1st Qu.: 1.000 1st Qu.: 38.00 1st Qu.: 38.00
#> Median :2.000 Median : 3.000 Median : 72.00 Median : 72.00
#> Mean :2.084 Mean : 2.978 Mean : 74.09 Mean : 74.16
#> 3rd Qu.:3.000 3rd Qu.: 4.000 3rd Qu.:108.00 3rd Qu.:108.00
#> Max. :8.000 Max. :13.000 Max. :160.00 Max. :160.00
#> capital_prior capital_end capital_invest
#> Min. : 0 Min. : 40 Min. :3.750e+01
#> 1st Qu.: 16653 1st Qu.: 46136 1st Qu.:1.016e+04
#> Median : 149195 Median : 215813 Median :2.960e+04
#> Mean : 893024 Mean : 1004871 Mean :1.118e+05
#> 3rd Qu.: 684977 3rd Qu.: 802567 3rd Qu.:6.926e+04
#> Max. :141177726 Max. :141635206 Max. :1.156e+07
#> ── Sample rows (first 6) ──
#>
#> # A tibble: 6 × 11
#> thres_inv_mgap thres_inv_dfsd id ivars hh_inv_asset_ctr hh_inv_ctr
#> <dbl> <dbl> <int> <chr> <int> <int>
#> 1 2 2.33 1003 agg_BS_1011 1 1
#> 2 2 2.33 1003 agg_BS_1012 1 1
#> 3 2 2.33 1003 agg_BS_1021 1 1
#> 4 2 2.33 1031 agg_BS_1011 1 2
#> 5 2 2.33 1031 agg_BS_1011 2 3
#> 6 2 2.33 1031 agg_BS_1012 1 1
#> # ℹ 5 more variables: mth_inv_start <dbl>, mth_inv_end <dbl>,
#> # capital_prior <dbl>, capital_end <dbl>, capital_invest <dbl>