|
|
|
||||
|
|
|||||
Again, we will not be showing all of the options for any of the commands.
. list
describe
codebook
display
inspect
if exp qualifier
in range qualifier
. list
list female ses read science
The list command without any variable names displays values of all the variables for all the cases. list with variable names displays values only the variables following the command.
Note about --more--
Stata displays --more-- whenever it fills up the computer screen. Pressing the
'space bar' will display the next screen, and so on, until all of the information has been
displayed. To get out of --more--, you can click on the 'break' button, select
'Break" from the pull-down 'Tools' menu, or press the 'q' key.
. list female ses read science if science==.
list female ses read science if ses=="high"
list female ses read science if ses==3
The if exp qualifier allows you to list values for those cases for which the exp is "true." The first list displays all cases for which science is missing. Stata uses "." to indicate missing values. The if ses=="high" does not work because ses is a numeric variable. And that is why if ses==3 does work.
| ~ | not |
| == | equal |
| ~= | not equal |
| != | not equal |
| > | greater than |
| >= | greater than or equal |
| < | less than |
| <= | less than or equal |
| & | and |
| | | or |
list female ses read math in 50/60
list female ses read math in f/10
list female ses read math in -10/l
The in range qualifier allows you to list values for the subset of cases in the range. The range f/10 is the same as 1/10 and -10/l is the same as 191/200.
. describe
describe displays a summary of a Stata dataset, describing the variables and other information.
. codebook
codebook female ses race
codebook displays information about variables' names, labels and values.
. inspect female ses race
inspect displays information about the values of variables and is useful for checking data accuracy.
. summarize math
display 9.368^2
This use of display functions as a calculator. We found the standard deviation of math to be 9.368, and we use the display command to get the variance (the square of the standard deviation).
The if and in qualifiers work with almost all Stata commands. See how these commands from Unit 1 work with the qualifiers.
. summarize read write math if ses==3
correlate read write math in 50/150
graph read math if female==0
tabulate ses if read>50
tabulate ses female in 1/60
. list
list female ses read science
list female ses read science if science==.
list female ses read science if ses=="high"
list female ses read science if ses==3
list female ses read science in f/10
list female ses read science in -10/l
describe
codebook female ses race
display 27.8^3.2
display (57.5 - 52.23)/10.25294
The Stata Class Notes are available on the World Wide Web by visiting ...
http://www.ats.ucla.edu/stat/stata/notes/
Note: The dataset hsb2.dta is the same as hsb1.dta but without the missing data for science or the race values coded 5.
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services