Converting from Stata to R

We need a reproducible example (reprex)