[R] Equivalent to Stata egen

David Winsemius dwinsemius at comcast.net
Wed Apr 15 21:50:53 CEST 2009


Peter Kraglund Jacobsen <peter <at> kraglundjacobsen.dk> writes:

> 
> What are the R equivalents to the Stata command egen?
> 
> egen temp = anycount(t0vas t30vas t60vas t120vas t240vas t360vas),
> values(0,1,2,3,4,5,6,7,8,9,10)
> egen temp2 = rowtotal(t0vas t30vas t60vas t120vas t240vas t360vas)
> 

And people call R documentation cryptic! As far as I can tell the corresponding
function would be ave, but that is only a guess since there really is not much
help regarding egen's purpose from the voluminous Stat documentation.

-- 
David Winsemius
> ______________________________________________
> R-help <at> r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
>




More information about the R-help mailing list