楼主: cj1007
1480 0

Econometrics in R [推广有奖]

  • 0关注
  • 0粉丝

本科生

69%

还不是VIP/贵宾

-

威望
0
论坛币
537 个
通用积分
0.1800
学术水平
0 点
热心指数
1 点
信用等级
1 点
经验
197 点
帖子
54
精华
0
在线时间
126 小时
注册时间
2009-12-8
最后登录
2021-9-29

楼主
cj1007 在职认证  发表于 2009-12-8 14:44:18 |只看作者 |坛友微信交流群|倒序 |AI写论文
相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
Econometrics in R
Grant V. Farnsworth
October 26, 2008
This paper was originally written as part of a teaching assistantship and has subsequently become a personal reference.
I learned most of this stu by trial and error, so it may contain ineciencies, inaccuracies, or incomplete explanations. If
you nd something here suboptimal or have suggestions, please let me know. Until at least 2009 I can be contacted at
g-farnsworth@kellogg.northwestern.edu.
Contents
1 Introductory Comments 3
1.1 What is R? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 How is R Better Than Other Packages? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Obtaining R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Using R Interactively and Writing Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Working with Data 6
2.1 Basic Data Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Caveat: Math Operations and the Recycling Rule . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Important Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.1 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.2 Arrays, Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.3 Dataframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.4 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.5 S3 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.6 S4 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4 Working with Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5 Merging Dataframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.6 Opening a Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.7 Working With Very Large Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.7.1 Reading elds of data using scan() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.7.2 Utilizing Unix Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.7.3 Using Disk instead of RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.7.4 Using RSQLite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.8 Issuing System Commands|Directory Listing . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.9 Reading Data From the Clipboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.10 Editing Data Directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Cross Sectional Regression 14
3.1 Ordinary Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Extracting Statistics from the Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Heteroskedasticity and Friends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3.1 Breusch-Pagan Test for Heteroskedasticity . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3.2 Heteroskedasticity (Autocorrelation) Robust Covariance Matrix . . . . . . . . . . . . . 16
3.4 Linear Hypothesis Testing (Wald and F) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 Weighted and Generalized Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.6 Models With Factors/Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 Special Regressions 18
4.1 Fixed/Random E ects Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.1.1 Fixed E ects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.1.2 Random E ects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2 Qualitative Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2.1 Logit/Probit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2.2 Multinomial Logit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2.3 Ordered Logit/Probit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3 Tobit and Censored Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.4 Quantile Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.5 Robust Regression - M Estimators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.6 Nonlinear Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.7 Two Stage Least Squares on a Single Structural Equation . . . . . . . . . . . . . . . . . . . . 21
4.8 Systems of Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2
4.8.1 Seemingly Unrelated Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.8.2 Two Stage Least Squares on a System . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5 Time Series Regression 22
5.1 Di erences and Lags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.2 Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:econometrics Econometric metrics Metric econom econometrics

R软件 Farnsworth-EconometricsIn R.pdf

296.47 KB

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-28 17:37