R Programming/Index

Data management

Function R Stata SAS
Merge merge() merge / mmerge -
Reshape reshape() reshape -
Expand a dataset expand() (epicalc) expand -
↑Jump back a section

Descriptive Statistics

Function R Stata SAS
Mean mean() mean proc means
Histogram hist() hist -
Frequency table table() ta proc freq
↑Jump back a section

Regression models

Function R Stata SAS
Least Square lm() reg proc reg
GLM glm() glm proc glm
Probit models glm(, family = binomial(link="probit")) probit -
Probit models glm(, family = binomial(link="logit")) logit -
Linear fixed effects model plm( , model = "within") (plm) xtreg , fe -
Linear random effects model plm( , model = "random") (plm) xtreg , re -
Linear quantile regression rq() (quantreg) qreg -
Ordinal logistic regression polr() (MASS) ologit -
Linear IV (2sls) ivreg() (AER) ivreg proc syslin (2sls) -
↑Jump back a section

Programming

Function R Stata SAS
Check some condition stopifnot() assert -
↑Jump back a section
Last modified on 21 June 2011, at 12:20