The last, and perhaps oddest, case involves data that is split up over multiple lines. As long as the space between the columns is whitespace (such as tabs or spaces) you do not need to create a dictionary file.ģ. This will tell Stata that the first variable is a string (nonnumeric group) of a maximum of ten letters, that should be called "state" and that this variable is followed by three more numeric variables named prod, satis, and rank respectively. Instead, you can simply type infile str10 state prod satis rank using columns.raw Since the above example uses tabs to break the columns, no dictionary file is actually necessary. It is set up in columns and might look like this: Arkansas 10 34 3 Texas 12 31 2 Minnesota 11 29 2 Washington 15 33 1 The second way raw data might be organized is a way that makes a lot more sense to the human eye, but, somewhat ironically, a lot less sense to the program. This will take the form of dictionary using. However, there will be a number of things you need to know in order to tell Stata "what's what." The first line in a dictionary file will tell Stata where to find the data. dct extension so that Stata knows it's a dictionary file. You can write it in any text editor (e.g., TextEdit) and then save the file with a. A dictionary file is basically a template or set of instructions that tells Stata how to read your data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |