solinic.blogg.se

Xlist command in stata
Xlist command in stata





| state | region | pop | poplt5 | pop5_17 | pop18p |

xlist command in stata

| pop65p | popurban | medage | death | marriage | divorce | Since the states are in alphabetical order in the dataset, I can use the logical statement _n < 11 to get the first ten. _n represents the row number of each observation. If I add the condition if _n < 11, I can see data for only the first ten states. Marriage long %12.0gc Number of marriages Variable name type format label variable label

xlist command in stata

A better place to start with a well-formatted data file is to use the describe command. | state | region | pop | poplt5 | pop5_17 | | pop18p | pop65p | popurban | medage | death | marriage |

xlist command in stata

We can use the list command to take a look at the data. We’ll go over for other commands for importing more complex data files later. To open a Stata file, use the use command. This will make collaboration much easier. Don’t place a cd command in your *.do file. Changing the working directory just once makes it much easier to exchange *.do files across computers. Your files will be in a different location on your computer. The above directory is where I keep the class files, hence the cd command doesn’t really do anything.

xlist command in stata

NB: The exception to this rule would be (1) when you double-click your *.do file and have Stata configured to open automatically and (2) your *.do file is set to work in the directory in which it is currently located (i.e., all the relative links are correctly specified). With some very rare exceptions, you should always use the cd command to set the working directory. To locate a data file, you first have to tell Stata where to look on your computer. Today we’ll be using the census.dta file which contains information on characteristics of the 50 states from the 1980 census. All Stata data files are saved in the *.dta format.







Xlist command in stata