Ols method pdf


















First, the approximation errors for our comparative statics are largest when the comparative- static changes in the multilateral price terms are largest. Using simulated data from our Monte Carlo analyses, we find that the largest comparative static changes in multilateral price terms are not necessarily among the smallest GDP- sized economies and consequently those with the largest trading partners.

Rather, multilateral price terms change the most for a given change in trade costs for small countries that are physically close. Second, as with any linear Taylor-series expansion, approximation errors increase the further away from the center is the change, cf.

Since a higher-order Taylor-series expansion can reduce these errors, we discuss — based upon a second-order Taylor expansion — the factors variances and covariances that likely explain the approximation errors. Then, using a fixed-point iterative matrix manipulation, we show how the approximation errors can be eliminated, where the key economic insight is an NxN matrix of GDP shares relative to bilateral distances. The remainder of the paper is as follows.

Section 2 discusses the gravity equation literature and A-vW analysis to motivate our paper. Section 3 uses a first-order log-linear Taylor-series expansion to motivate a simple OLS regression equation that can be used to estimate average effects and generate comparative statics. Section 5 examines the economic conditions under which our approach approximates the comparative statics of trade-cost changes well and under which it does not.

Section 6 concludes. Background: The Gravity Equation and Prices The gravity equation is now considered the empirical workhorse for studying interregional and international trade patterns, cf. In the McCallum Canada-U. In the remainder of this paper, boldfaced regular-case non-bold italicized variable names denote observed unobserved variables. Traditional specification 1 typically excludes price terms. In reality, the trade flow from i to j is surely influenced by the prices of products in the other N—2 regions in the world, which themselves are influenced by the bilateral distances and EIAs, etc.

Bergstrand provided early empirical evidence of this omitted variables bias, but was limited by crude price-index data. A-vW raised two important considerations.

First, A-vW showed theoretically that proper estimation of the coefficients of a theoretically-based gravity equation needs to account for the influence of endogenous price terms.

Second, estimation yields partial effects of a change in a bilateral trade cost on a bilateral trade flow, but not general- equilibrium effects. A-vW clarified that the comparative-static effects of a change in a trade cost were influenced by the full general-equilibrium framework. The A-vW Theoretical Model To understand the context, we initially describe a set of assumptions to derive a gravity equation; for analytical details, see A-vW First, assume a world endowment economy with N regions and N aggregate goods, each good differentiated by origin.

This system could be solved for a bilateral trade flow equation for Xij that is a function of the GDPs of i and j and their bilateral distance. Then pi is endogenous and excluded from the reduced-form bilateral trade flow gravity equation.

We can also set up the model in terms of a representative consumer with Mj consumers in each country, but the results are analytically identical.

Yi can feasibly be represented empirically by observable GDPi. However, the world is not so generous as to provide observable measures of bilateral trade costs tij. One could also include a language dummy, an adjacency dummy, etc. A-vW describe one customized nonlinear procedure for estimating equations 7 - 10 to generate unbiased estimates in a two-country world with 10 Canadian provinces, 30 U.

A-vW also estimate a multicounty model; discussion of that is treated later. This obviously requires a custom NLS program. However, the appealing characteristic of the gravity equation, that likely has contributed to its becoming the workhorse for the study of empirical trade patterns, is that it has been estimated for decades using OLS. Moreover, in some instances mentioned earlier and later, one might want to have exogenous measures of the MR terms motivated by theory.

A-vW and Feenstra both note that a ready alternative to estimating consistently the average border effect is to apply fixed effects. However, while fixed effects can determine gravity equation parameters consistently, estimation of country-specific border effects still requires construction of the structural system of price equations to distinguish MR terms with and without borders.

We demonstrate in this paper a simple technique that yields virtually identical estimates of the average effects and in many instances comparative statics surfaces by applying a Taylor-series expansion to the theory.

The key methodological insight is the use of a first-order Taylor-series expansion, not commonly used in international trade but the workhorse for modern dynamic macroeconomics.

In modern dynamic macroeconomics, the expansion is usually made around the steady-state value suggested by the underlying theoretical model. Substituting these expressions into equation 14 yields: 8 We find using a Monte Carlo robustness analysis that a first-order Taylor series works well for estimating gravity equation coefficients.

Higher-order terms are largely unnecessary for estimation. However, such terms are relevant for subsequent comparative statics; we address this more later. To understand the intuition behind equation 25 — analogous for 24 — we consider separately each of the two components of the RHS. The first component is a GDP-share-weighted geometric average of the gross trade costs facing country j across all regions.

The higher this average, the greater overall multilateral resistance in j. Now consider the second component on the RHS of equation The Taylor-series expansion here makes more transparent the influence of world resistance, which is identical for all countries.

In A-vW, this second component was also present, cf. World resistance lowers trade between every pair of countries. This term is constant in cross-section gravity estimation, embedded in and affecting only the intercept. We close this section noting that it is useful to exponentiate equation Equation 27 is a simple reduced-form equation capturing the 11 Moreover, in panel estimation, changes in world resistance over time — along with changes in world income — provide a rationale for including a time trend.

As noted, multilateral-and-world-trade costs are GDP-share weighted. The next two sections address these two questions in turn.

We show that A- vW, fixed effects, and our methods can yield similar gravity-equation coefficient estimates, even though both BV- OLS and fixed effects are computationally simpler. In section C, we discuss three contexts in which our method would be useful for estimating gravity-equation parameters instead of using fixed effects.

Before implementing equation 26 econometrically, three issues need to be addressed. Second, even if one wanted to generate the econometric specification suggested strictly by theory, another econometric issue arises. As in A-vW, in the estimation trade flows were scaled by the product of GDPs to impose unitary income elasticities and also to avoid an endogeneity bias running from trade flows to GDPs. Including GDP-share-weighted multilateral trade costs could create an endogeneity bias. Such issues have been dealt with by various means; see, for example, Felbermayr and Kohler Following the literature, equation 10 earlier suggests two typical observable variables likely influencing unobservable tij — bilateral distance DISij and a dummy representing the presence of absence of an economic integration agreement EIAij.

As readily apparent, equation 28 can be estimated using OLS, once data on trade flows, GDPs, bilateral distances, and borders are provided. However, there are two important differences here. First, our additional the last two terms are motivated by theory; moreover, we make explicit the role of world 13 Monte Carlo analyses confirm that estimates are marginally less biased using the simple averages of RHS variables, rather than the GDP-weighted averages. However, GDP-share-weighted MR terms will generate less biased predicted values of comparative statics.

These results are confirmed in Bergstrand, Egger, and Larch The model is isomorphic to being recast in a monopolistically-competitive framework. Trade Flows We follow the A-vW procedure for the two-country model of estimating the gravity equation for trade flows among 10 Canadian provinces, 30 U. As in A-vW, we do not include trade flows internal to a state or province. We calculate the distance between the aggregate U.

Hence, there are 41 regions. Some trade flows are zero and, as in A-vW, these are omitted. As in A-vW and Feenstra , we have observations for trade flows from year Table 1 provides the results.

Columns 2 and 3 provide the model estimated using NLS as in A-vW for the two-country and multi-country cases, respectively. Column 4 provides the results from estimating equation This specification can be compared with Feenstra , Table 5. The coefficient estimates from our OLS specification 28 are reported in column 4 of Table 1. While our coefficient estimates differ from the NLS estimates in columns 2 and 3 , they match closely the coefficient estimates using fixed effects in column 5.

Recall that — as both A-vW and Feenstra note — fixed effects should provide unbiased coefficient estimates of the bilateral distance and bilateral border effects, accounting fully for multilateral-resistance influences in estimation. Our column 5 estimates match exactly those in A-vW and Feenstra However, they were generously provided by Eric van Wincoop in e-mail correspondence, along with the other coefficient estimates associated with their Table 6.

While Feenstra omitted addressing this difference, A-vW did address it in their sensitivity analysis , part V, Table 6. As A-vW , p. The main reason is the interaction of the distance and border-dummy variables using NLS. Fixed-effects estimates, of course, do not depend on internal distance measures. Our OLS estimation procedure avoids the potential bias introduced by measurement error and potential specification error better than the nonlinear estimation procedure.

First, our OLS estimates are insensitive to measures of internal distance. As A-vW note p. Examine equation 29 closely. Since MWRDIS is linear in logs of distance, a doubling of internal distance simply alters the intercept of equation OLS and fixed effects avoid this specification error. Monte Carlo Analyses The previous section addressed the question: Does OLS estimation with exogenous MR terms work empirically as an approximation to A-vW allowing for measurement and specification error?

Notably, our OLS spec. Is there a way to compare the estimation results of A- vW and our approach excluding the measurement and potential specification errors? To do this, in section 4. Using Canadian-U. We then assume that there exists a log-normally distributed error term for each trade flow equation. We make 5, draws for each trade equation and run various regression specifications 5, times.

In section 4. Monte Carlo Analysis 1: Canada-U. We consider five specifications. Specification 1 is the basic gravity model ignoring multilateral resistance terms, as used by McCallum. The specification is analogous to equation 11 excluding the MR terms. In the context of the theory, we should get biased estimates of the true parameters since we intentionally omit the true multilateral price terms or fixed effects. Due to space limitations, we do not address these issues.

In the context of the theory, we should get biased estimates of the true parameters since we are using atheoretical measures of remoteness. This specification also ignores other multilateral trade costs. We then estimate the regression 11 using the true values of the multilateral resistance terms. In the presence of the true MR terms, we expect the coefficient estimates to be virtually identical to the true parameters.

Specification 4 uses region-specific fixed effects. As discussed earlier, region-specific fixed effects should also generate unbiased estimates of the coefficients.

Specification 5 is our OLS equation If our hypothesis is correct, the parameter estimates should be virtually identical to those estimated using Specifications 3 and 4. In both cases, we report three statistics.

First, we report the average coefficient estimates for a1 and a2 from the 5, regressions for each specification. Then fit method is called on this object for fitting the regression line to the data.

The summary method is used to obtain a table which gives an extensive description about the regression results Syntax : statsmodels. OLS y, x Parameters : y : the variable which is dependent on x x : the independent variable Code:.

OLS y, x. Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics. Next Linear Regression Python Implementation. Recommended Articles. Replace missing white spaces in a string with the least frequent character using Pandas.

Article Contributed By :. Easy Normal Medium Hard Expert. Before we apply OLS in R, we need a sample. The standard function for regression analysis in R is lm. But since we just have one explanatory variable, we just use x after the tilde. Next, we have to specify, which data R should use. After that, we can estimate the model, save its results in object ols , and print the results in the console.

As you can see, the estimated coefficients are quite close to their true values. The inclusion of such a term is so usual that R adds it to every equation by default unless specified otherwise. However, the output of lm might not be enough for a researcher who is interested in test statistics to decide whether to keep a variable in a model or not.

In order to get further information like this, we use the summary function, which provides a series of test statistics when printed in the console:. Please, refer to an econometrics textbook for a precise explanation of the information shown by the summary function for the output of lm. A more in-depth treatment of it would be beyond the scope of this introduction. Finally, we can also draw the line, which results from the estimation of our model, into the graph from above.

You just estimated a regression model. If you wanted to estimate the above model without an intercept term, you have to add the term -1 or 0 to the formula:.



0コメント

  • 1000 / 1000