Copy log file into word stata12/31/2023 The command “set more off” tells Stata not to pause or display the -more- message. The first, “clear”, is used to clear any previous dataset you may have been working on. These three commands are administrative commands that are quite useful to have at the beginning of a do-file. You may wonder about the commands “clear”, “set more off” and “set mem 15000” in the screenshot example. To run a whole do-file, do not highlight any part of it and click on the “Execute Selection (do)” icon. In order to execute a number of commands rather than the whole do-file, simply highlight the ones you want to execute, and click on the “Execute Selection (do)” icon on the top of your do-file editor, at the far right.Īs you become more proficient with programming in Stata, you won’t need to try out commands anymore, and you’ll discover the joy of writing a do-file and having it run without a glitch. One simple way to do that and still have discipline about writing do-files is to write your do-file in stages, writing only a few commands before executing them, correcting mistakes as you go. For example, if you are not so familiar with a command, you may prefer to try it first. In the preliminary stages of your work, you may feel that a do-file is more hindrance than it is useful. ![]() To start a do-file, click on the icon that looks like a notepad on the top-left corner of your Stata viewer. Working from do-files lets other people see what you did if you ever need advice, it makes your work reproducible and it allows you to correct small mistakes somewhat painlessly. This is a general advice that applies to any work you do on Stata. ![]() This way, if you make a mistake, you will not have ruined your entire dataset and you will not need to start again from scratch. You want to write the commands in a do-file, and then run it. Never clean a dataset by blindly entering commands (or worse, clicking buttons). Simply type “help” in the command window, followed by the name of the command you need help with and press the Enter key: Stata has a built in feature that allows you to access the user manual as well as help files on any given command. Whether this is your first time cleaning data or you are a seasoned “data monkey”, you might find some useful tips by reading more. Your first pass at a dataset may involve any or all of the following: Stata is a good tool for cleaning and manipulating data, regardless of the software you intend to use for analysis. It will very often be the first assignment of a research assistant and is the tedious part of any research project that makes us wish we HAD a research assistant. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |