Skip to contents

Loan panel where each row is a loan repayment month.

Usage

tstm_loans_panel

Format

Loan panel dataframe with monthly repayment and loan attributes

hhid_Num

Anonymized household ID (tmid_hh from the crosswalk). Same entity as id in tstm_asset_loan. Not the raw composite province–village– household code.

loanBrrwID

Anonymized string loan ID: PP___VVV___HHH___NNN, i.e. anonymized province (2 digits) and village/household codes (3 digits each, never clamped so the ID stays unique per household) plus the original within-household loan number (3 digits); see data-raw/id_anonymize/fun_id_anonymize.R.

province

Anonymized province code (prov_anon in the crosswalk), not the raw survey province.

village

Anonymized village code (vil_anon in the crosswalk), not the raw survey village.

household

Anonymized within-village household code (hh_anon in the crosswalk), not the raw survey household.

number

Within-household loan number (unchanged; not anonymized).

surveymonth

Iterative month of survey (unchanged; not an ID).

bm6b

Survey question: what was the total amount you paid on this loan since last interview

bm6h

Survey question: how much of the total amount you repaid since last interview was principal

bm6i

Survey question: how much of the total amount you repaid since last interview was interest

bm6j

Survey question: has the loan/help been fully repaid.

principal_paid_cumu

Cumulative amount repaid on this loan by this month

principal_outstand_cumu

Loan principal that remains outstanding

hh_loan_id

An integer-based loan id variable

G_Location

Scope of geography where the loan originated

G_LenderType

10 category lender types

institutional

Whether the lender is institutional

forinfm3

Three category formal and informal categorization

forinfm4

Four category formal and informal categorization

formal

Formal and informal categorization

formalqf

Quasi formal categorization

bf5klm_total

Total value of loan cash and in-kind borrowed (at loan start month)

bf5klm_bm6h_joint

Replaces NA bf5klm_total by non-NA bm6h value for more complete loan amount data.

Source

Built in data-raw/tstm_loans_panel.R; anonymized in data-raw/id_anonymize/. PrjThaiHFID-issue-31

Details

The packaged object stores anonymized household and geography identifiers (column names are unchanged). Values in hhid_Num, province, village, household, and loanBrrwID come from tmid_hh and derived codes in data-raw/tm_key_id.rda via data-raw/id_anonymize/. True IDs are backed up in data-raw/id_anonymize/tstm_loans_panel_true_id.rda (see that folder's README to restore).

Pipeline. Raw input built in data-raw/ (issue #31). Consumed as a Group A gateway input by vignettes ffv_invest_loan_bridge and ffv_invest_return_bridge (issue #32).

Examples

data(tstm_loans_panel)
ffp_preview_dataset(tstm_loans_panel)
#> 
#> ── tstm_loans_panel ────────────────────────────────────────────────────────────
#> Dimensions: 288484 rows × 23 columns(44.5 Mb)
#> 
#> ── Column names (23) ──
#> 
#> • 1. hhid_Num
#> • 2. loanBrrwID
#> • 3. province
#> • 4. village
#> • 5. household
#> • 6. number
#> • 7. surveymonth
#> • 8. bm6b
#> • 9. bm6h
#> • 10. bm6i
#> • 11. bm6j
#> • 12. principal_paid_cumu
#> • 13. principal_outstand_cumu
#> • 14. hh_loan_id
#> • 15. G_Location
#> • 16. G_LenderType
#> • 17. institutional
#> • 18. forinfm3
#> • 19. forinfm4
#> • 20. formal
#> • 21. formalqf
#> • 22. bf5klm_total
#> • 23. bf5klm_bm6h_joint
#> 
#> ── Summary statistics (all variables) ──
#> 
#>     hhid_Num        loanBrrwID        province        village      
#>  Min.   :1003   Length   :288484   Min.   :1.000   Min.   : 1.000  
#>  1st Qu.:3137   N.unique : 20929   1st Qu.:2.000   1st Qu.: 5.000  
#>  Median :5379   N.blank  :     0   Median :3.000   Median : 9.000  
#>  Mean   :5458   Min.nchar:    20   Mean   :2.732   Mean   : 9.154  
#>  3rd Qu.:7681   Max.nchar:    20   3rd Qu.:4.000   3rd Qu.:13.000  
#>  Max.   :9996                      Max.   :4.000   Max.   :16.000  
#>                                                                    
#>    household         number        surveymonth          bm6b        
#>  Min.   :  3.0   Min.   :  1.00   Min.   :  0.00   Min.   :      0  
#>  1st Qu.:306.0   1st Qu.:  6.00   1st Qu.: 53.00   1st Qu.:      0  
#>  Median :476.0   Median : 15.00   Median : 87.00   Median :      0  
#>  Mean   :464.9   Mean   : 19.64   Mean   : 85.88   Mean   :   2000  
#>  3rd Qu.:639.0   3rd Qu.: 29.00   3rd Qu.:120.00   3rd Qu.:      0  
#>  Max.   :791.0   Max.   :131.00   Max.   :160.00   Max.   :2200000  
#>                  NAs    :27                                         
#>       bm6h              bm6i                 bm6j        principal_paid_cumu
#>  Min.   :      0   Min.   :     0.0   Length   :288484   Min.   :      0    
#>  1st Qu.:      0   1st Qu.:     0.0   N.unique :     2   1st Qu.:      0    
#>  Median :      0   Median :     0.0   N.blank  :     0   Median :      0    
#>  Mean   :   1703   Mean   :   174.3   Min.nchar:     2   Mean   :   8030    
#>  3rd Qu.:      0   3rd Qu.:     0.0   Max.nchar:     3   3rd Qu.:      0    
#>  Max.   :2000000   Max.   :300000.0   NAs      :244802   Max.   :2000000    
#>                                                                             
#>  principal_outstand_cumu   hh_loan_id         G_Location        G_LenderType   
#>  Min.   :-798208         Min.   :  1.00   Length   :288484   Length   :288484  
#>  1st Qu.:   3350         1st Qu.:  6.00   N.unique :     3   N.unique :    10  
#>  Median :  11000         Median : 15.00   N.blank  :     0   N.blank  :     0  
#>  Mean   :  33385         Mean   : 19.63   Min.nchar:     7   Min.nchar:     3  
#>  3rd Qu.:  25000         3rd Qu.: 29.00   Max.nchar:    16   Max.nchar:    33  
#>  Max.   :7000000         Max.   :131.00                                        
#>  NAs    :319                                                                   
#>    institutional         forinfm3           forinfm4        formal       
#>  Length   :288484   Length   :288484   Length   :288484   Mode :logical  
#>  N.unique :     2   N.unique :     3   N.unique :     4   FALSE:106514   
#>  N.blank  :     0   N.blank  :     0   N.blank  :     0   TRUE :181970   
#>  Min.nchar:     6   Min.nchar:     6   Min.nchar:     8                  
#>  Max.nchar:    11   Max.nchar:    12   Max.nchar:    15                  
#>                                                                          
#>                                                                          
#>   formalqf        bf5klm_total     bf5klm_bm6h_joint
#>  Mode :logical   Min.   :     63   Min.   :     63  
#>  FALSE:95698     1st Qu.:   5000   1st Qu.:   5000  
#>  TRUE :192786    Median :  15000   Median :  15000  
#>                  Mean   :  41420   Mean   :  41417  
#>                  3rd Qu.:  30000   3rd Qu.:  30000  
#>                  Max.   :7000000   Max.   :7000000  
#>                  NAs    :319       NAs    :255      
#> ── Sample rows (first 6) ──
#> 
#> # A tibble: 6 × 23
#>   hhid_Num loanBrrwID  province village household number surveymonth  bm6b  bm6h
#>      <int> <chr>          <int>   <int>     <int>  <dbl>       <dbl> <dbl> <dbl>
#> 1     2709 01___003__…        1       3         3      1          12     0     0
#> 2     2709 01___003__…        1       3         3      1          13  5000  5000
#> 3     2709 01___003__…        1       3         3      1          14 15300 15000
#> 4     2709 01___003__…        1       3         3      2          15 23000 23000
#> 5     2709 01___003__…        1       3         3      3          39     0     0
#> 6     2709 01___003__…        1       3         3      3          40     0     0
#> # ℹ 14 more variables: bm6i <dbl>, bm6j <chr>, principal_paid_cumu <dbl>,
#> #   principal_outstand_cumu <dbl>, hh_loan_id <int>, G_Location <chr>,
#> #   G_LenderType <chr>, institutional <chr>, forinfm3 <chr>, forinfm4 <chr>,
#> #   formal <lgl>, formalqf <lgl>, bf5klm_total <dbl>, bf5klm_bm6h_joint <dbl>