Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dictionary.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
The following table provides some quick translations of Stata commands into R. Since R supports multiple data sets, we need to specify a specific data set to manipulate when using data accessing/modifying commands. We use mydata as the default data set to target.

See also: https://github.com/EconometricsBySimulation/RStata/wiki/Dictionary:-Stata-to-R

Stata | R | Description
------------------------------|--------------------------------------------|------------------------------
cls | cat("\014") | Clears the screen
clear all | rm(list=ls()) | Clears data. Set fresh workspace
insheet using "foo.csv", comma| mydata <- read.csv("foo.csv") | Read csv file
cd "mydirectory" | setwd("mydirectory") | Change working directories
reg y x1 x2 | summary(lm(y~x1+x2, data=mydata)) | Ordinary least squares with constant
Expand Down