STATA命令:list
list ,separator(3) //列表,每隔3行划线 // // +-----------------------------------------------------------------------------------------------------------------------+ // | make price mpg rep78 headroom trunk weight length turn displa~t gear_r~o foreign | // |-----------------------------------------------------------------------------------------------------------------------| // 1. | AMC Concord 4,099 22 3 2.5 11 2,930 186 40 121 3.58 Domestic | // 2. | AMC Pacer 4,749 17 3 3.0 11 3,350 173 40 258 2.53 Domestic | // 3. | AMC Spirit 3,799 22 . 3.0 12 2,640 168 35 121 3.08 Domestic | // |-----------------------------------------------------------------------------------------------------------------------| // 4. | Buick Century 4,816 20 3 4.5 16 3,250 196 40 196 2.93 Domestic | // 5. | Buick Electra 7,827 15 4 4.0 20 4,080 222 43 350 2.41 Domestic | // 6. | Buick LeSabre 5,788 18 3 4.0 21 3,670 218 43 231 2.73 Domestic | // |-----------------------------------------------------------------------------------------------------------------------| // 7. | Buick Opel 4,453 26 . 3.0 10 2,230 170 34 304 2.87 Domestic | // 8. | Buick Regal 5,189 20 3 2.0 16 3,280 200 42 196 2.93 Domestic | // 9. | Buick Riviera 10,372 16 3 3.5 17 3,880 207 43 231 2.93 Domestic | // |-----------------------------------------------------------------------------------------------------------------------| list ,sepby(trunk) //列表,当medage 变化时划线 最好是先根据变量名来排序 // +-----------------------------------------------------------------------------------------------------------------------+ // | make price mpg rep78 headroom trunk weight length turn displa~t gear_r~o foreign | // |-----------------------------------------------------------------------------------------------------------------------| // 1. | AMC Concord 4,099 22 3 2.5 11 2,930 186 40 121 3.58 Domestic | // 2. | AMC Pacer 4,749 17 3 3.0 11 3,350 173 40 258 2.53 Domestic | // |-----------------------------------------------------------------------------------------------------------------------| // 3. | AMC Spirit 3,799 22 . 3.0 12 2,640 168 35 121 3.08 Domestic | // |-----------------------------------------------------------------------------------------------------------------------| // 4. | Buick Century 4,816 20 3 4.5 16 3,250 196 40 196 2.93 Domestic | // |-----------------------------------------------------------------------------------------------------------------------| // 5. | Buick Electra 7,827 15 4 4.0 20 4,080 222 43 350 2.41 Domestic | // |-----------------------------------------------------------------------------------------------------------------------| list ,sum(mpg trunk) //列表,求和mpg trunk // +-------------------------------------------------------------------------------------------------------------------+ // | make price mpg rep78 headroom trunk weight length turn displa~t gear_r~o foreign | // |-------------------------------------------------------------------------------------------------------------------| // 1. | AMC Concord 4,099 22 3 2.5 11 2,930 186 40 121 3.58 Domestic | // 2. | AMC Pacer 4,749 17 3 3.0 11 3,350 173 40 258 2.53 Domestic | // 3. | AMC Spirit 3,799 22 . 3.0 12 2,640 168 35 121 3.08 Domestic | // 4. | Buick Century 4,816 20 3 4.5 16 3,250 196 40 196 2.93 Domestic | // 5. | Buick Electra 7,827 15 4 4.0 20 4,080 222 43 350 2.41 Domestic | // |-------------------------------------------------------------------------------------------------------------------| // 6. | Buick LeSabre 5,788 18 3 4.0 21 3,670 218 43 231 2.73 Domestic | // 7. | Buick Opel 4,453 26 . 3.0 10 2,230 170 34 304 2.87 Domestic | // 8. | Buick Regal 5,189 20 3 2.0 16 3,280 200 42 196 2.93 Domestic | // 9. | Buick Riviera 10,372 16 3 3.5 17 3,880 207 43 231 2.93 Domestic | // |-------------------------------------------------------------------------------------------------------------------| // Sum | 176 134 | // +-------------------------------------------------------------------------------------------------------------------+
. list make rep78 in 1/10 +-----------------------+ | make rep78 | |-----------------------| 1. | AMC Concord 3 | 2. | AMC Pacer 3 | 3. | AMC Spirit . | 4. | Buick Century 3 | 5. | Buick Electra 4 | |-----------------------| 6. | Buick LeSabre 3 | 7. | Buick Opel . | 8. | Buick Regal 3 | 9. | Buick Riviera 3 | 10. | Buick Skylark 3 | +-----------------------+ //选项noobs不显示行号 . list make rep78 in 1/10,noobs +-----------------------+ | make rep78 | |-----------------------| | AMC Concord 3 | | AMC Pacer 3 | | AMC Spirit . | | Buick Century 3 | | Buick Electra 4 | |-----------------------| | Buick LeSabre 3 | | Buick Opel . | | Buick Regal 3 | | Buick Riviera 3 | | Buick Skylark 3 | +-----------------------+