Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use 2SLS for ivreg2 estimation and its Test

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about how to use 2SLS for ivreg2 estimation and its test, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

As the OLS regression does not conform to the assumption, it also includes that the explanatory variable is not related to the random disturbance term. If there is a problem that violates this hypothesis, it is necessary to find a variable that is highly related to the explanatory variable and not related to the random disturbance term, and regression as a tool variable. Tool variables are usually regressed by two-stage least square method (2SLS). When random perturbations have heteroscedasticity or autocorrelation problems, 2SLS is not efficient and needs to be estimated by GMM and other methods. in addition, it also needs to test the weak instrumentality and endogenesis of tool variables.

1. Data and requirements

Take the auto.dta data that comes with stata as an example. Enter the following command in stata to get:

Sysuse auto

The data are shown as follows:

The data is the automobile data of the United States in 1978, including variables such as origin, vehicle name, mileage, weight and so on.

two。 Construction of structural equation and 2SLS estimation

Construct the following structural equations of tool variables:

The endogenous variable in the equation is turn, and the tool variables are weight, length and headroom.

First, use ivreg2 to estimate the 2SLS:

Ivreg2 mpg gear_ratio (turn=weight length headroom)

Get:

The results show that the estimated coefficient of turn variable is-1.246426 and the p value is 0.000, less than 0.05.It shows that turn coefficient is significant and has a negative correlation with mpg.

Underidentification test, the unrecognizable test of the equation, obtained that the LM statistical value is 26.822, p = 0.000, less than 0.05.It strongly rejects the original hypothesis of "unrecognizable".

The over-recognition test of Hansen J statistic shows that the chi-square statistical value is 0.548 and the p value is 0.7601, which indicates that it accepts the original hypothesis of "over-fitting".

The Weak identification test weak tool variable test shows that the Wald-F statistical value is 30.303 and the KP Wald-F statistical value is 42.063, which is greater than all the critical values, indicating that the original hypothesis of "weak tool variables" is rejected, that is, there are no weak tool variables in the equation.

3. Excessive endogenous test

The other equation is tested for excessive endogenesis:

Ivreg2 mpg gear_ratio (turn=weight length headroom) estimates store ivregress mpg gear_ratio turn weight length headroomestimates store olshausman iv ols, constant sigmamore

Hausman test shows that the statistical value is-0.97. the original hypothesis that "all explanatory variables are exogenous" can not be rejected, indicating that the equation is endogenous.

The above is how to use 2SLS to estimate ivreg2 and test it. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report