knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(senseR)
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.
senser() FunctionThe 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" )
# Indonesian language support senser( data = df, proxy = c("ntl", "road_density"), target = "gdp", lang = "indonesia" )
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.
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.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.