Professional Documents
Culture Documents
Do-File Cheat Sheet: Who Wrote It What Assignment This Is Class and Section When It Was Written
Do-File Cheat Sheet: Who Wrote It What Assignment This Is Class and Section When It Was Written
Do-File Cheat Sheet: Who Wrote It What Assignment This Is Class and Section When It Was Written
*** Initial Commands – Always use these commands when beginning a do-file ***
* Who wrote it *
* What assignment this is *
* Class and Section *
* When it was written *
clear
*Clears out the dataset that is currently in memory
cd “m:\your_directory\your_subdirectory”
*Changes the working directory to the specified drive and directory
use filename
*Loads a data set called "filename" into Stata
describe
*Lists each variable in Stata's memory
summarize
*Lists number of observations, mean, standard dev., min & max for a variable
tab
*Gives frequencies (counts), and is most useful with categorical variables
drop var1
*Removes var1 from your dataset
*can be combined with an “if” statement
log close
*Closes and saves the current log file