I have often missed a tool to help me to quickly get a feel for individual cases in a data set. I want to see the values of a number of variables for one single case (e.g. in household survey data). This is a small example (on state level, not household level, in this case):
. sysuse census, clear
. list state pop popurban marriage if state=="Idaho"
+---------------------------------------+
| state pop popurban marriage |
|---------------------------------------|
12. | Idaho 943,935 509,702 13,428 |
+---------------------------------------+
displays the values of (three) selected variables of interest for the case "Idaho". However, if the variable names are not as telling as "pop", "popurban", and "marriage" are (but are something cryptic such as V4, V9, and V12), and if many more variables (rather than just the three V4, V9, and V12) are of interest, so that one cannot easliy memorize the meanings of all variables, then the list output is not really helpful.
one could use
. table pop if state=="Idaho", stubwidth(40)
-----------------------------------------------------
Population | Freq.
-----------------------------------------+-----------
943,935 | 1
-----------------------------------------------------
. table popurban if state=="Idaho", stubwidth(40)
-----------------------------------------------------
Urban population | Freq.
-----------------------------------------+-----------
509,702 | 1
-----------------------------------------------------
. table marriage if state=="Idaho", stubwidth(40)
-----------------------------------------------------
Number of marriages | Freq.
-----------------------------------------+-----------
13,428 | 1
-----------------------------------------------------
which displays the variable labels (Population, Urban population, and Number of marriages) together with the figures of interest (943,935, etc.) but this requires much code and the output takes up so much space that it does not fit in one screen or page if, e.g. 20 variables are of interest (rather than three in the example).
Is there any way to produce output, e.g something such as
-----------------------------------------------------
state=="Idaho"
-----------------------------------------------------
Population | 943,935
Urban population | 509,702
Number of marriages | 13,428
-----------------------------------------------------
I found it difficult search FAQs etc. for a solution possibly due to a lack of a good idea how to label this probelm...
could you help?
Stephan
. sysuse census, clear
. list state pop popurban marriage if state=="Idaho"
+---------------------------------------+
| state pop popurban marriage |
|---------------------------------------|
12. | Idaho 943,935 509,702 13,428 |
+---------------------------------------+
displays the values of (three) selected variables of interest for the case "Idaho". However, if the variable names are not as telling as "pop", "popurban", and "marriage" are (but are something cryptic such as V4, V9, and V12), and if many more variables (rather than just the three V4, V9, and V12) are of interest, so that one cannot easliy memorize the meanings of all variables, then the list output is not really helpful.
one could use
. table pop if state=="Idaho", stubwidth(40)
-----------------------------------------------------
Population | Freq.
-----------------------------------------+-----------
943,935 | 1
-----------------------------------------------------
. table popurban if state=="Idaho", stubwidth(40)
-----------------------------------------------------
Urban population | Freq.
-----------------------------------------+-----------
509,702 | 1
-----------------------------------------------------
. table marriage if state=="Idaho", stubwidth(40)
-----------------------------------------------------
Number of marriages | Freq.
-----------------------------------------+-----------
13,428 | 1
-----------------------------------------------------
which displays the variable labels (Population, Urban population, and Number of marriages) together with the figures of interest (943,935, etc.) but this requires much code and the output takes up so much space that it does not fit in one screen or page if, e.g. 20 variables are of interest (rather than three in the example).
Is there any way to produce output, e.g something such as
-----------------------------------------------------
state=="Idaho"
-----------------------------------------------------
Population | 943,935
Urban population | 509,702
Number of marriages | 13,428
-----------------------------------------------------
I found it difficult search FAQs etc. for a solution possibly due to a lack of a good idea how to label this probelm...
could you help?
Stephan
Comment