|
cd
|
Change Working Directory
|
cd "path/location/here"
|
|
browse
|
Open Spreadsheet of Data (browse only)
|
browse
|
|
edit
|
Open Spreadsheet of Data (browse + edit)
|
edit
|
|
list
|
Print data to Stata Console
|
list variable_1 variable_2 variable_3
|
|
help
|
Open Help page for commands
|
help command_name
|
|
in
|
Selecting by Observation Number
|
list variable_1 in 1/5
|
|
if
|
Selecting Observation by condition
|
list var1 if var2<50
|
|
+
|
Add (Numbers) Combine (Strings)
|
|
-
|
Subtraction
|
|
*
|
Multiplication
|
|
/
|
Divide
|
|
^
|
Raise to a power
|
|
&
|
and Operator |
|
|
|
or Operator |
|
! or ~
|
not Operator |
|
=
|
Assigns a value to a variable
|
|
==
|
Compare whether two thing is equal
|
|
!=
|
Not Equal
|
|
<
|
Less Than
|
|
<=
|
Less than or equal to
|
|
>
|
Greater than
|
|
>=
|
Greater than or equal
|
|
use
|
load Stata dataset
|
use "data/file/location"
|
|
sysuse
|
Open System Data files
|
"sysuse data_name"
|
|
import excel
|
Import Excel Data, using my seet1 and first row as variable name
|
import excel using "path/to/file", sheet(“mysheet") firstrow
|
|
import delimited
|
Import tab or comma delimited Data, using my seet1 and first row as variable.
|
import delimited using "C:\path\myfile.csv", clear
|
|
import spss
|
Import SPSS Data
|
import spss "yourSPSSfile.sav"
|
|
clear
|
clear dataset from memory
|
sysuse auto, clear
|
|
save
|
save Stata dataset
|
save auto, replace
|
|
replace
|
overwrite an existing file with the same name
|
save auto, replace
|
|
codebook
|
inspect variable values
|
codebook variable1 variable2
|
|
summarize
|
summarize distribution
|
summarize variable1 variable2
|
|
tabulate
|
tabulate frequencies
|
tabulate variable1 variable2
|
|
histogram
|
Creates Histogram
|
histogram variable1
|
|
graph box
|
Creates Boxplots
|
graph variable1 variable2
|
|
scatter
|
Creates Scatter plot
|
scatter variable1 variable2
|
|
graph bar
|
Creates Bar Plot
|
graph bar (count), over(variable)
|
|
twoway
|
Create multi-layered plots
|
twoway (scatter var1 var2) (lowess var1 var2)
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.