how could convert stata command to r command

Can your provide a reproducible example?