stata2r / stata2r.github.io

Stata -> R guide
https://stata2r.github.io
88 stars 19 forks source link

Feature/extra suggestions #23

Open statzhero opened 2 years ago

statzhero commented 2 years ago

Outstanding work! I fully transitioned to R many years ago, but sometimes I'm still haunted by the ease of some Stata commands. Your "Rosetta Stone" already covers my main workhorses.

Here's a brain dump of features that I wish R (or I) could do better – with the full understanding that this is not a request to add them but more of a list to consult if you're looking to expand the page.

p.s. tidytable for those who want to have the cake and eat it, although there's loss in many ways.

grantmcdermott commented 2 years ago

Thanks @statzhero. I think at least some of what you want is already in there. E.g. See the modelsummary and collapse suggestions in the "extras" page for tables. Some others I think are beyond scope despite obvious being useful (e.g. binsreg).

I'm not sure I quite follow the difficulties with programmatic variable creation or boostrapping. The former is easy to with base R tools IMO, but there's also fixest's macro facilities that we highlight at several points in the page. For the latter, is there something that sandwiich::vocBS or the boot package don't give? I do think data.table excels at bootstrapping simulations, but again that's maybe getting a bit to specific without a simple example.

Weight regression is a good idea. We should add that.

Log files I'm not keen on personally, since I don't think they make much sense for R (you can just recall / save different objects) or use Rmd for full literate programming. But we did talk at some point about adding a "miscellaneous" tips section where stuff like that could go in.

statzhero commented 2 years ago

Great – obviously my list is terse but if there are questions I can supply examples and use cases. But as I said, take what you like.

Re bootstrapping: it's my understanding that boot and other libraries don't integrate as well as bsample, e.g. when you use coefficient estimates in a second regression as variables or other multi-step simulations.

Re logs: I had a specific use case but more to the point, I was thinking of stuff they teach (or taught) in the Stata 101. Same idea with how to use the help files and vignettes.

One more question: I use modelsummary in a dubious cocktail of custom theme, knitr, and Latex hacks. Are you saying it's the best equivalent to tabout? (And I don't remember if or why it's different from estout.)