
Maximum-score estimator for a choice-based sample
Source:R/horowitz_native4.R
morie_choice_based_max_score.Rd\(S_{n,CB}(b) = (\pi_1/n_1)\sum_i Y_i 1\{X_i'b \ge 0\} - (\pi_0/n_0)\sum_i (1 - Y_i) 1\{X_i'b \ge 0\}\) (4.33), maximised subject to \(|b_1| = 1\); the smoothed form (4.35) replaces each indicator with \(K(X_i'b/h_n)\).
Usage
morie_choice_based_max_score(
x,
y,
sampling_weights,
smoothed = TRUE,
h = NULL,
n_restarts = 8L,
seed = 0L
)Arguments
- x
numeric matrix of covariates, one row per observation.
- y
binary 0/1 response.
- sampling_weights
population share pi1, or c(pi0, pi1).
- smoothed
use (4.35) rather than the discontinuous (4.33).
- h
bandwidth for the smoothed form;
n^(-1/5)when NULL.- n_restarts
restarts, since (4.33) is a step function.
- seed
RNG seed for the restarts.
Value
list: beta, score, pi1, pi0, n1, n0, smoothed, bandwidth, rate_exponent, standard_errors_valid, n, d, method.
Details
A choice-based sample is stratified ON Y: the fraction with
\(Y = 1\) is fixed by design and X is drawn conditional on Y.
Estimators built for random samples are INCONSISTENT here except in
special cases. The reweighting repairs that – the two terms are
divided by the realised counts and multiplied by the POPULATION
shares, assumed known from an external source such as a census.
Passing sample shares instead silently reproduces the uncorrected
estimator. Mirrors morie.fn.hrzcbsm.