|
. sysuse auto,clear
(1978 Automobile Data)
. drop if rep78==.
(5 observations deleted)
. tostring rep78,gen(rep)
rep generated as str1
.
. *只能输出5个选项
. table foreign,c(count price mean price max price min price sd price) row by( rep) missing
---------------------------------------------------------------------------
Repair |
Record |
1978 and |
Car type | N(price) mean(price) max(price) min(price) sd(price)
----------+----------------------------------------------------------------
1 |
Domestic | 2 4,564.5 4,934 4,195 522.5519
Foreign | . . . . .
|
Total | 2 4,564.5 4,934 4,195 522.5519
----------+----------------------------------------------------------------
2 |
Domestic | 8 5,967.6 14,500 3,667 3579.357
Foreign | . . . . .
|
Total | 8 5,967.6 14,500 3,667 3579.357
----------+----------------------------------------------------------------
3 |
Domestic | 27 6,607.1 15,906 3,291 3661.267
Foreign | 3 4,828.7 6,295 3,895 1285.613
|
Total | 30 6,429.2 15,906 3,291 3525.14
----------+----------------------------------------------------------------
4 |
Domestic | 9 5,881.6 8,814 3,829 1592.019
Foreign | 9 6,261.4 9,735 3,995 1896.092
|
Total | 18 6,071.5 9,735 3,829 1709.608
----------+----------------------------------------------------------------
5 |
Domestic | 2 4,204.5 4,425 3,984 311.8341
Foreign | 9 6,292.7 11,995 3,748 2765.629
|
Total | 11 5,913 11,995 3,748 2615.763
---------------------------------------------------------------------------
.
. *没有total项
. collapse (count) n=price (mean) mean=price (median) med=price (max) max=price (min) min=price (sd) sd=
> price,by( rep foreign)
. list
+--------------------------------------------------------------------+
| rep foreign n mean med max min sd |
|--------------------------------------------------------------------|
1. | 1 Domestic 2 4,564.5 4,564.5 4,934 4,195 522.552 |
2. | 2 Domestic 8 5,967.6 4,638 14,500 3,667 3,579.4 |
3. | 3 Domestic 27 6,607.1 4,749 15,906 3,291 3,661.3 |
4. | 3 Foreign 3 4,828.7 4,296 6,295 3,895 1,285.6 |
5. | 4 Domestic 9 5,881.6 5,705 8,814 3,829 1,592 |
|--------------------------------------------------------------------|
6. | 4 Foreign 9 6,261.4 6,229 9,735 3,995 1,896.1 |
7. | 5 Domestic 2 4,204.5 4,204.5 4,425 3,984 311.834 |
8. | 5 Foreign 9 6,292.7 5,719 11,995 3,748 2,765.6 |
+--------------------------------------------------------------------+
|