- library(foreign) - Allows you to load Stata and Excel files, among others.
- foo <- read.dta("location") - Loads a Stata *.dta file.
- names(foo) - Lists the names of the variables in dataset foo.
- fit <- lm(y~x,data="foo") - Linear regression of Y on X using data in foo.
- fit <- glm(y~x,family=binomial(link="probit"),data="foo") - Probit regression of Y on X using data in foo.
- summary(fit) - The stuff you want in model fit.
Wednesday, December 17, 2008
Helpful commands for R
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment