statacompat - Reproduce Selected 'Stata' Expression and Missing-Value
Semantics
A lightweight compatibility layer for researchers
translating 'Stata' data-management code into R. Provides
vectorised helpers that reproduce selected 'Stata' expression
semantics where they differ from base R, most importantly
"Stata's" rule that numeric missing values are larger than
every number: relational comparisons, inlist(), inrange(),
cond(), missing(), and the 'egen' row functions rowtotal(),
rowmean(), rowmiss() and rownonmiss(). Only the ordinary
missing value is fully supported; "Stata's" extended missing
values are detected and rejected wherever they would change a
result.