R Programming/Index

Category:Book:R Programming#Index%20

This page provides tables which make it easy to find functions for usual tasks in statistics in R, SAS and Stata. Other software may also be included in the future such as SPSS.

Data management

FunctionRStataSAS
Mergemerge()merge / mmerge-
Reshapereshape()reshape-
Expand a datasetexpand() (epicalc)expand-

Descriptive Statistics

FunctionRStataSAS
Meanmean()meanproc means
Histogramhist()hist-
Frequency tabletable()taproc freq

Regression models

FunctionRStataSAS
Least Squarelm()regproc reg
GLMglm()glmproc glm
Probit modelsglm(, family = binomial(link="probit"))probit-
Logit modelsglm(, family = binomial(link="logit"))logit-
Linear fixed effects modelplm( , model = "within") (plm)xtreg , fe-
Linear random effects modelplm( , model = "random") (plm)xtreg , re-
Linear quantile regressionrq() (quantreg)qreg-
Ordinal logistic regressionpolr() (MASS)ologit-
Linear IV (2sls)ivreg() (AER)ivregproc syslin (2sls) -

Programming

FunctionRStataSAS
Check some conditionstopifnot()assert-
Category:Book:R Programming