楼主: constant
13699 7

请教:在stata中如何实现LAD? [推广有奖]

  • 0关注
  • 0粉丝

讲师

8%

还不是VIP/贵宾

-

威望
0
论坛币
3142 个
通用积分
97.0902
学术水平
5 点
热心指数
6 点
信用等级
2 点
经验
10317 点
帖子
469
精华
0
在线时间
334 小时
注册时间
2004-12-13
最后登录
2024-2-18

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

期待着您的解答。。。。

非常感谢!!!

二维码

扫码加我 拉你入群

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

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

关键词:Stata tata 如何实现 LAD 非常感谢 Stata LAD

沙发
蓝色 发表于 2005-4-17 10:45:00 |只看作者 |坛友微信交流群

什么是LAD?写清楚啊?

缩写多了

使用道具

藤椅
蓝色 发表于 2005-4-17 11:46:00 |只看作者 |坛友微信交流群

qreg

使用道具

板凳
constant 发表于 2005-4-17 13:09:00 |只看作者 |坛友微信交流群

不好意思,刚才没把问题说清楚。

LAD:是指least absolute deviations.(最小绝对值法)

在处理outliers时,而采用的一种方法:LAD,而不是OLS(普通最小二乘值法)。

LAD采用的是牛顿迭代法。

qreg 采用的是LAD,好象不是我所说的最小绝对值法。

其他软件是可以做最小绝对值法,当然STATA肯定可以做,但我目前不清楚,故请教高手!!

使用道具

报纸
蓝色 发表于 2005-4-17 14:09:00 |只看作者 |坛友微信交流群

http://www.stata.com/capabilities/qreg.html

Quantile regression

  • including median, minimization of sums of absolute deviations
  • Koenker and Bassett or bootstrapped standard errors

Stata's qreg command fits quantile (including median) regression models, also known as least-absolute value (LAV) models, minimum absolute deviation (MAD) models, and L1-norm models.

Median regression estimates the median of the dependent variable, conditional on the values of the independent variable. This is similar to least-squares regression, which estimates the mean of the dependent variable. Said differently, median regression finds the regression plane that minimizes the sum of the absolute residuals rather than the sum of the squared residuals.

 . qreg ln_wage edyrs exp exp_sq Iteration 1: sum of abs. weighted deviations = 18804.696 Iteration 2: sum of abs. weighted deviations = 18607.296 (output omitted) Iteration 25: sum of abs. weighted deviations = 18229.301 Median regression Number of obs = 29650 Raw sum of deviations 22631.6 (about 9.95228) Min sum of deviations 18229.3 Pseudo R2 = 0.1945 --------------------------------------------------------------------------- ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------+----------------------------------------------------------------- edyrs | .1282041 .0012835 99.883 0.000 .1256883 .1307199 exp | .0942597 .0010175 92.637 0.000 .0922653 .0962541 exp_sq | -.0015612 .0000231 -67.631 0.000 -.0016065 -.001516 _cons | 7.356049 .0182586 402.882 0.000 7.320262 7.391837 ---------------------------------------------------------------------------

This example uses 1991 CPS data for males aged 17 to 64. The syntax for all estimation commands is the same: after the command name, the name of the dependent variable is followed by the names of the independent variables. By default, qreg performs median regression — the estimates above were obtained by minimizing the sums of the absolute residuals.

By comparison, the results from least-squares regression are

 . regress ln_wage edyrs exp exp_sq Source | SS df MS Number of obs = 29650 ---------+------------------------------ F( 3, 29646) = 4742.53 Model | 11309.4187 3 3769.80624 Prob > F = 0.0000 Residual | 23565.4268 29646 .794893977 R-squared = 0.3243 ---------+------------------------------ Adj R-squared = 0.3242 Total | 34874.8456 29649 1.17625706 Root MSE = .89157 --------------------------------------------------------------------------- ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------+----------------------------------------------------------------- edyrs | .1334425 .0018387 72.576 0.000 .1298386 .1370463 exp | .111906 .0014589 76.705 0.000 .1090465 .1147655 exp_sq | -.0018887 .0000331 -57.081 0.000 -.0019536 -.0018239 _cons | 6.949451 .026166 265.591 0.000 6.898164 7.000737 ---------------------------------------------------------------------------

qreg can also estimate the regression plane for quantiles other than the 0.5 (median). For instance, the following model describes the 90th percentile (.9 quantile) of ln_wage:

 . qreg ln_wage edyrs exp exp_sq, quantile(.90) Iteration 1: sum of abs. weighted deviations = 9141.9044 Iteration 2: sum of abs. weighted deviations = 8500.0497 (output omitted) Iteration 22: sum of abs. weighted deviations = 6417.128 .9 Quantile regression Number of obs = 29650 Raw sum of deviations 8027.156 (about 10.8198) Min sum of deviations 6417.128 Pseudo R2 = 0.2006 --------------------------------------------------------------------------- ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------+----------------------------------------------------------------- edyrs | .1126145 .0020545 54.814 0.000 .1085877 .1166414 exp | .064232 .0013707 46.861 0.000 .0615454 .0669186 exp_sq | -.0009451 .0000335 -28.192 0.000 -.0010108 -.0008793 _cons | 8.475585 .027091 312.856 0.000 8.422485 8.528685 ---------------------------------------------------------------------------

The following regression describes the 10th percentile (.1 quantile):

 . qreg ln_wage edyrs exp exp_sq, quantile(.10) Iteration 1: sum of abs. weighted deviations = 12445.284 Iteration 2: sum of abs. weighted deviations = 11883.493 (output omitted) Iteration 14: sum of abs. weighted deviations = 11440.085 .1 Quantile regression Number of obs = 29650 Raw sum of deviations 14503.39 (about 8.3894) Min sum of deviations 11440.09 Pseudo R2 = 0.2112 ---------------------------------------------------------------------------- ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------+----------------------------------------------------------------- edyrs | .1621845 .0055457 29.245 0.000 .1513147 .1730543 exp | .1754884 .0044497 39.438 0.000 .1667668 .18421 exp_sq | -.0033157 .0000956 -34.700 0.000 -.003503 -.0031284 _cons | 5.049422 .0864032 58.440 0.000 4.880068 5.218776 ----------------------------------------------------------------------------

Interpreting the results, ln_wage is the log of wage-and-salary earnings, edyrs is the years of schooling completed, and exp is potential labor-force experience, defined as age minus schooling minus 6. exp_sq is the square of exp.

The regressions indicate that the effect of schooling is more pronounced at the first decile of earnings than at the ninth decile. In models of this kind, the coefficient on edyrs can be thought of as the "return on additional schooling". At the ninth decile, the return is 11%, while at the first, it is 16%. Economy-wide increases in schooling, therefore, would decrease the gap between the first and ninth deciles in log earnings.

References

Gould, W. 1992.
sg11.1: Quantile regression with bootstrapped standard errors. Stata Technical Bulletin 9: 19–21. Reprinted in Stata Technical Bulletin Reprints, vol. 2, pp. 137–150.
Gould, W. and W. H. Rogers. 1994.
Quantile regression as an alternative to robust regression. Proceedings of the Statistical Computing Section. Alexandria, VA: American Statistical Association.
Rogers, W. H. 1992.
sg11: Quantile regression standard errors. Stata Technical Bulletin 9: 16–19. Reprinted in Stata Technical Bulletin Reprints, vol. 2, pp. 133–137.
------. 1993.
sg11.2: Calculation of quantile regression standard errors. Stata Technical Bulletin 13: 18–19. Reprinted in Stata Technical Bulletin, vol. 3, pp. 77–78.

使用道具

蓝色说的 没错。
谢谢。
感兴趣领域——宏观经济、区域经济与技术经济

使用道具

7
shen999 发表于 2017-8-13 08:09:50 |只看作者 |坛友微信交流群
楼主,你好,请问你会在stata中操作LAD了吗

使用道具

8
观存姐 发表于 2018-5-19 19:41:41 |只看作者 |坛友微信交流群
qreg y x

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

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

GMT+8, 2024-4-27 10:06