Stata:数量经济学命令介绍—cnuse命令更新一览表--即将发布
一、数量经济学命令介绍—cnuse
在数据分析的过程中,我们经常需要加载不同格式的数据文件。
为了简化这一操作,并方便下载调用计量经济学服务中心/数量经济学微信公众号推文数据以及网络数据等,为大家推荐全新的“cnuse”命令,它可以方便地从本地或在线来源导入多种文件格式。
下面我们将详细介绍这个命令的使用方法和新功能。
1. 命令名称
cnuse
cnuse
命令部分源ado文件代码查看
2. 描述以及新功能
cnuse
是一个灵活的数据导入命令,支持从本地文件和在线 URL 导入多种格式的数据文件。
支持的格式包括 .dta
, .csv
, .xls
, .xlsx
, .txt
, .zip
, .shp
等,大大增强了数据文件的兼容性。特别适合需要快速从远程位置下载并加载数据、文件的用户。
New:
cnuse
支持导入.shp
数据支持 .dta
,.xls
,.xlsx
,.txt
,.csv
,.zip
,.shp
,.sav
.等类型文件的导入、下载将支持 .r
,.tex
,.html
,.log
,.py
,.md
,.py.
,.ipynb
文件的下载调用将支持 .ado
,.do
,.smcl
等Stata文件的下载、使用将支持 .pdf
,.doc
,.docx
,.ppt
,.pptx
,.wmf
,.emf
,.tif
,.png
等文件
cnuse
菜单版操作界面
3. 重要新功能更新
智能文件识别:根据文件的扩展名,自动选择正确的导入命令。
格式支持扩展:除了常见的
.csv
和.dta
文件,cnuse
还支持.xls/.xlsx
电子表格、.txt
文本文件、.shp
形状文件,以及.zip
压缩包等。自动解压缩:如果输入文件为
.zip
,该命令可以自动解压并加载其中的数据。全面兼容网络数据:当本地找不到指定文件时,
cnuse
会自动尝试从提供的 URL 下载文件。可以调用网络数据包括但不局限于Stata官网数据、 BC Economics Stata datasets
4. 案例应用
4.1 导入dta数据
4.2 导入Excel文件
4.3 导入csv文件
4.4 导入txt文件
4.5 导入shp文件
新功能添加以及修改ing,所以之前网络下载导入.shp
文件的版本忘记保存了,导致现版本导入.shp
文件仍有一些bug,继续测试中。
上述演示大概率为之前版本保存到本地后导入的,并非实际意义上网络导入的
4.6 导入zip压缩文件
4.7 网络数据下载调用
目前调用bcuse
数据集已经支持不用加url选项,支持cnuse
直接加上数据集名称
当然还是推荐使用官方命令Stata:获取《计量经济学导论》数据+教材答案
cnuse直接下载bcuse数据列表(后期更新后将支持不用加入逗号后面url选项),详见图片所示:
直接调用本地数据
直接网络下载调用
bcuse数据列表
来源:http://fmwww.bc.edu/ec-p/data/wooldridge/datasets.list.html
401k 401k-50 401ksubs 401ksubs-10 admnrev affairs airfare apple athlet1 athlet2 attend audit barium beveridge bwght bwght50 bwght2 campus card catholic cement ceosal1 ceosal2 consump corn cornwell cps78 cps91 crime1 crime2 crime3 crime4 discrim earns engin ezanders ezunem fair fertil1 fertil2 fertil3 fish fringe gpa1 gpa2 gpa2-20 gpa3 grogger hprice1 hprice2 hprice3 hseinv htv infmrt injury intdef intqrt inven jtrain jtrain2 jtrain3 jtrain98 keane kielmc labsup lawsch85 loanapp lowbrth mathpnl meap93 meap01 meap01 mlb1 mroz murder murders nbasal ncaa nls80 nls81 norway nyse openness patent pension phillips pntsprd prison prminwge q rdchem rdtelec recid rental return saving school93 sleep75 slp75 smoke traffic1 traffic2 twoyear volat vote1 vote2 wage1 wage2 wagepan wageprc wine
cnuse command.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse 401k.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse 401k-50.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse 401ksubs.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse 401ksubs-10.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse admnrev.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse affairs.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse airfare.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse apple.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse athlet1.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse athlet2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse attend.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse audit.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse barium.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse beveridge.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse bwght.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse bwght50.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse bwght2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse campus.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse card.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse catholic.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse cement.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse ceosal1.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse ceosal2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse consump.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse corn.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse cornwell.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse cps78.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse cps91.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse crime1.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse crime2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse crime3.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse crime4.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse discrim.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse earns.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse engin.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse ezanders.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse ezunem.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse fair.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse fertil1.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse fertil2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse fertil3.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse fish.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse fringe.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse gpa1.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse gpa2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse gpa2-20.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse gpa3.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse grogger.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse hprice1.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse hprice2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse hprice3.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse hseinv.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse htv.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse infmrt.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse injury.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse intdef.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse intqrt.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse inven.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse jtrain.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse jtrain2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse jtrain3.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse jtrain98.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse keane.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse kielmc.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse labsup.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse lawsch85.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse loanapp.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse lowbrth.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse mathpnl.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse meap93.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse meap01.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse meap01.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse mlb1.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse mroz.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse murder.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse murders.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse nbasal.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse ncaa.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse nls80.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse nls81.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse norway.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse nyse.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse openness.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse patent.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse pension.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse phillips.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse pntsprd.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse prison.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse prminwge.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse q.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse rdchem.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse rdtelec.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse recid.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse rental.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse return.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse saving.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse school93.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse sleep75.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse slp75.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse smoke.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse traffic1.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse traffic2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse twoyear.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse volat.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse vote1.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse vote2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse wage1.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse wage2.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse wagepan.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse wageprc.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)
cnuse wine.dta, url(http://fmwww.bc.edu/ec-p/data/wooldridge/)