stata 17学习笔记1
1.安装时选择StataMP
2.选择 use each user's document folder
3.复制 粘贴 覆盖 补丁
4.第一次运行:选择“禁止自动更新检查”,取消“在检查更新之前始终提示”
5.改变当前目录:
文件--更改工作目录,指定想要改成的文件夹
cd "d:\statashu"
连接网络下载地址:
net from http://www.stata-press.com/data/dmus
显示:
http://www.stata-press.com/data/dmus/
Files associated with Data Management Using Stata: A Practical Handbook by Micha
> el Mitchell
--------------------------------------------------------------------------------
PACKAGES you could -net describe-:
dmus1 Data Files for DMUS (part 1)
dmus2 Data Files for DMUS (part 2)
表示有两个数据包
net get dmus1下载第一个数据包
checking dmus1 consistency and verifying not already installed...
copying into current directory...
copying br_clarence.dta
copying br_isaac.dta
copying br_sally.dta
copying wws2lab.dta
copying wws_dups.dta
ancillary files successfully copied.
use wws使用数据(wws.dta)
list idcode age hours wage in 1/5
显示wws中idcode age hours wage 前五个记录
list idcode married marriedyrs nevermarried in 1/5,abb(20),noobs
显示前5条记录,abb(20)表示所有的变量都不能被缩写到小于20个字符
noobs:禁止显示序号,避免出现自动换行的情况
list idcode ccity hours uniondues married marriedyrs nevermarried in 1/3
显示指定字段的前三个记录
list ,sep(0) 不显示分隔线
list,sepby(kidid)根据kidid分组,每组有一分隔线
+--------------------------------------------+
| kidid dt female wt tv vac |
|--------------------------------------------|
1. | 1 07jan2002 1 53 1 1 |
2. | 1 08jan2002 1 55 3 1 |
|--------------------------------------------|
3. | 2 16jan2002 1 58 8 1 |
|--------------------------------------------|
4. | 3 18jan2002 0 60 2 0 |
5. | 3 19jan2002 0 63 5 1 |
6. | 3 21jan2002 0 66 1 1 |
7. | 3 22jan2002 0 64 6 0 |
|--------------------------------------------|
8. | 4 10jan2002 1 62 7 0 |
9. | 4 11jan2002 1 58 1 0 |
10. | 4 13jan2002 1 55 4 0 |
+--------------------------------------------+