senseR-introduction

library(senseR)

Introduction

senseR is a statistical diagnostic tool designed to evaluate whether proxy indicators can reliably represent an underlying construct that cannot be directly observed or measured. It is intended for analytical diagnostics and policy-oriented assessment. Note that it does not perform causal inference.

The senser() Function

The main function is senser(). It computes a diagnostic score for each proxy based on five components: Monotonicity – Spearman rank correlation between proxy and target. Information content – Proportion of variance explained (R-squared). Stability – Sensitivity of regression coefficients across subsamples. Distributional alignment – Similarity of standardized distributions via Kolmogorov–Smirnov test. Bias risk – Penalization for strong nonlinearity indicating potential proxy distortion.

The overall score is the average of these five components, ranging from 0 to 1: Suitable proxy: score >= 0.70 Conditionally suitable: 0.40 <= score < 0.70 Not suitable proxy: score < 0.40 Interpretation is automatically generated in English or Indonesian.

# example
set.seed(123)

# Simulated dataset
df <- data.frame(
  gdp = rnorm(100, 10, 2),
  ntl = rnorm(100, 50, 10),
  road_density = rnorm(100, 3, 0.5),
  mobile_signal = rnorm(100, 70, 15)
)

# Run senser in English
senser(
  data = df,
  proxy = c("ntl", "road_density", "mobile_signal"),
  target = "gdp",
  lang = "english"
)
#> 
#> ====================================================
#>  senseR STRICT - Proxy Indicator Diagnostic
#> ====================================================
#> Target construct : gdp 
#> 
#> ----------------------------------------------------
#> Proxy : ntl 
#> ----------------------------------------------------
#> 1. Monotonicity (Spearman)        : 0.0039 
#> 2. Information Content (R2)       : 0.0025 
#> 3. Elasticity (Responsiveness)    : 0.0495 | Score: 0.3 | Penalized if < 0.1 
#> 4. Coefficient of Variation (CV)  : 0.1976 | Score: 1 | Penalized if < 0.02 
#> 5. Average Absolute Change        : 11.2733 | Score: 1 | Penalized if < 0.01 
#> 6. Ceiling Effect Ratio           : 0.5937 | Score: 1 | Penalized if > 0.95 
#> 7. Stability (Beta Consistency)   : 0 
#> Hard Failure Triggered            : FALSE 
#> ----------------------------------------------------
#> Final Proxy Score (Median Rule)   : 0.3 
#> ----------------------------------------------------
#> Proxy : ntl 
#> Score : 0.3 
#> Status: Not suitable proxy 
#> Interpretation:
#>  The proxy fails to provide reliable and informative representation. 
#> 
#> ----------------------------------------------------
#> Proxy : road_density 
#> ----------------------------------------------------
#> 1. Monotonicity (Spearman)        : 0.1223 
#> 2. Information Content (R2)       : 0.0167 
#> 3. Elasticity (Responsiveness)    : 0.1292 | Score: 1 | Penalized if < 0.1 
#> 4. Coefficient of Variation (CV)  : 0.1552 | Score: 1 | Penalized if < 0.02 
#> 5. Average Absolute Change        : 0.5082 | Score: 1 | Penalized if < 0.01 
#> 6. Ceiling Effect Ratio           : 0.738 | Score: 1 | Penalized if > 0.95 
#> 7. Stability (Beta Consistency)   : 0.3952 
#> Hard Failure Triggered            : FALSE 
#> ----------------------------------------------------
#> Final Proxy Score (Median Rule)   : 1 
#> ----------------------------------------------------
#> Proxy : road_density 
#> Score : 1 
#> Status: Suitable proxy 
#> Interpretation:
#>  This proxy demonstrates adequate variability, responsiveness, and stability. 
#> 
#> ----------------------------------------------------
#> Proxy : mobile_signal 
#> ----------------------------------------------------
#> 1. Monotonicity (Spearman)        : 0.0987 
#> 2. Information Content (R2)       : 0.0019 
#> 3. Elasticity (Responsiveness)    : 0.0441 | Score: 0.3 | Penalized if < 0.1 
#> 4. Coefficient of Variation (CV)  : 0.2243 | Score: 1 | Penalized if < 0.02 
#> 5. Average Absolute Change        : 18.5466 | Score: 1 | Penalized if < 0.01 
#> 6. Ceiling Effect Ratio           : 0.6397 | Score: 1 | Penalized if > 0.95 
#> 7. Stability (Beta Consistency)   : 0.7629 
#> Hard Failure Triggered            : FALSE 
#> ----------------------------------------------------
#> Final Proxy Score (Median Rule)   : 0.7629 
#> ----------------------------------------------------
#> Proxy : mobile_signal 
#> Score : 0.763 
#> Status: Suitable proxy 
#> Interpretation:
#>  This proxy demonstrates adequate variability, responsiveness, and stability. 
#> 
#> ====================================================
#> Scientific References:
#> 
#> [1] Spearman, C. (1904). The proof and measurement of association between two things.
#>                         American Journal of Psychology, 15(1), 72-101.
#> 
#> [2] Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences.
#> 
#> [3] Wooldridge, J. M. (2013). Introductory Econometrics: A Modern Approach.
#> 
#> [4] OECD (2008). Handbook on Constructing Composite Indicators:
#>                Methodology and User Guide.
#> 
#> [5] Hamilton, J. D. (1994). Time Series Analysis.
#> 
#> [6] Chow, G. C. (1960). Tests of equality between sets of coefficients
#>                        in two linear regressions. Econometrica.
# Indonesian language support
senser(
  data = df,
  proxy = c("ntl", "road_density"),
  target = "gdp",
  lang = "indonesia"
)
#> 
#> ====================================================
#>  senseR STRICT - Proxy Indicator Diagnostic
#> ====================================================
#> Konstruk target  : gdp 
#> 
#> ----------------------------------------------------
#> Proxy : ntl 
#> ----------------------------------------------------
#> 1. Monotonisitas (Spearman)       : 0.0039 
#> 2. Kandungan Informasi (R2)       : 0.0025 
#> 3. Elastisitas (Responsivitas)    : 0.0495 | Skor: 0.3 | Penalti jika < 0.1 
#> 4. Koefisien Variasi (KV)         : 0.1976 | Skor: 1 | Penalti jika < 0.02 
#> 5. Rata-rata Perubahan Absolut    : 11.2733 | Skor: 1 | Penalti jika < 0.01 
#> 6. Rasio Efek Ceiling             : 0.5937 | Skor: 1 | Penalti jika > 0.95 
#> 7. Stabilitas (Konsistensi Beta)  : 0 
#> Kegagalan Struktural Terdeteksi   : FALSE 
#> ----------------------------------------------------
#> Skor Akhir Proxy (Aturan Median)  : 0.3 
#> ----------------------------------------------------
#> Proxy : ntl 
#> Score : 0.3 
#> Status: Proxy tidak layak 
#> Interpretation:
#>  Proxy gagal merepresentasikan konstruk secara informatif dan andal. 
#> 
#> ----------------------------------------------------
#> Proxy : road_density 
#> ----------------------------------------------------
#> 1. Monotonisitas (Spearman)       : 0.1223 
#> 2. Kandungan Informasi (R2)       : 0.0167 
#> 3. Elastisitas (Responsivitas)    : 0.1292 | Skor: 1 | Penalti jika < 0.1 
#> 4. Koefisien Variasi (KV)         : 0.1552 | Skor: 1 | Penalti jika < 0.02 
#> 5. Rata-rata Perubahan Absolut    : 0.5082 | Skor: 1 | Penalti jika < 0.01 
#> 6. Rasio Efek Ceiling             : 0.738 | Skor: 1 | Penalti jika > 0.95 
#> 7. Stabilitas (Konsistensi Beta)  : 0.3952 
#> Kegagalan Struktural Terdeteksi   : FALSE 
#> ----------------------------------------------------
#> Skor Akhir Proxy (Aturan Median)  : 1 
#> ----------------------------------------------------
#> Proxy : road_density 
#> Score : 1 
#> Status: Proxy layak 
#> Interpretation:
#>  Proxy memiliki variabilitas, sensitivitas, dan stabilitas yang memadai. 
#> 
#> ====================================================
#> Referensi Ilmiah:
#> 
#> [1] Spearman, C. (1904). The proof and measurement of association between two things.
#>     American Journal of Psychology, 15(1), 72-101.
#> 
#> [2] Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences.
#> 
#> [3] Wooldridge, J. M. (2013). Introductory Econometrics: A Modern Approach.
#> 
#> [4] OECD (2008). Handbook on Constructing Composite Indicators:
#>     Methodology and User Guide.
#> 
#> [5] Hamilton, J. D. (1994). Time Series Analysis.
#> 
#> [6] Chow, G. C. (1960). Tests of equality between sets of coefficients
#>     in two linear regressions. Econometrica.

Notes

Output is printed to the console; the function does not return a value invisibly. Designed for applied diagnostics and policy assessment. Always compare multiple proxies to select the most reliable indicators.

References

Elbers, C., Lanjouw, J. O., & Lanjouw, P. (2003). Micro-level estimation of poverty and inequality. Econometrica. Henderson, J. V., Storeygard, A., & Weil, D. N. (2012). Measuring economic growth from outer space. American Economic Review.