kinkyreg: Instrument-free inference for linear regression models with endogenous regressors

In models with endogenous regressors, a standard regression approach is to exploit just-identifying or overidentifying orthogonality conditions by using instrumental variables. In just-identified models, the identifying orthogonality assumptions cannot be tested without the imposition of other nontestable assumptions. While formal testing of overidentifying restrictions is possible, its interpretation still hinges on the validity of an initial set of untestable just-identifying orthogonality conditions. We present the kinkyreg command for kinky least-squares inference, which adopts an alternative approach to identification. By exploiting nonorthogonality conditions in the form of bounds on the admissible degree of endogeneity, feasible test procedures can be constructed that do not require instrumental variables. The kinky least-squares confidence bands can be more informative than confidence intervals obtained from instrumental-variables estimation, especially when the instruments are weak. Moreover, the approach facilitates a sensitivity analysis for standard instrumental-variables inference. In particular, it allows the user to assess the validity of previously untestable just-identifying exclusion restrictions. Further instrument-free tests include linear hypotheses, functional form, heteroskedasticity, and serial correlation tests.


Introduction
The empirical literature on causal inference in linear regression models with endogenous regressors is dominated by estimation methods based on instrumental variables (IVs). For valid inference under conventional asymptotic theory, instruments must be relevant and exogenous. The former condition requires that the instruments are sufficiently strongly correlated with the endogenous regressors. If this correlation is weak, coefficient estimates can be severely biased, finite-sample distributions are poorly approximated with conventional asymptotic theory, and statistical tests using conventional standarderror estimates can exhibit large size distortions. To address these concerns, an extensive literature emerged on detecting instrument weakness and conducting robust statistical inference under the presence of weak instruments. The latter methods, however, usually lead to wide confidence intervals that may not be very informative. 1 In Stata, tests for weak instruments and methods for weak-instruments robust inference are implemented in the community-contributed packages ivreg2 (Baum, Schaffer, andStillman 2003, 2007), condivreg (Moreira and Poi 2003;Mikusheva and Poi 2006), weakiv as an extension of rivtest (Finlay and Magnusson 2009), weakivtest (Pflueger and Wang 2015), twostepweakiv (Sun 2018), and boottest (Roodman et al. 2019).
A noteworthy complication of the quest for good instruments is that the same features that make an instrument relevant can also be a source of a violation of the exogeneity condition (Hall, Rudebusch, and Wilcox 1996). To be exogenous, an IV needs to be uncorrelated with the regression error term. This necessitates that the instrument is validly excluded from the structural model, that is, that the instrument only has an indirect effect on the dependent variable via the instrumented endogenous regressors. If the model is just-identified, that is, there are as many excluded instruments as endogenous regressors, then the exclusion restriction is untestable in the standard IV framework. Intuitively, we cannot use the same instrument to identify the effect of an endogenous regressor and its own direct effect on the dependent variable. For identification of the former, IV-based estimators assume that the latter is known to be 0. Even in overidentified models, the validity of all instruments cannot be jointly tested. Routinely used overidentification tests still rely on the maintained (and untested) assumption that at least as many instruments are validly excluded from the model as there are endogenous regressors, and even then they may not be informative about the instruments' ability to identify the parameters of interest (Parente and Santos Silva 2012).
In this article, we discuss an identification strategy that does not rely on such exclusion restrictions but instead imposes assumptions on the degree of regressor endogeneity, which is left unrestricted in an IV world. The kinky least-squares (KLS) approach developed by Kiviet (2013Kiviet ( , 2020a achieves set identification of the regression coefficients by confining the admissible correlation of the regressors with the error term within plausible bounds. No excluded instruments are needed. Instead, the bias of the ordinary leastsquares (OLS) estimator is analytically corrected for all values on a grid of endogeneity correlations. This provides a set of consistent coefficient estimates in accordance with the postulated endogeneity range. Asymptotically conservative confidence intervals can be obtained as the union of the confidence intervals over the considered grid.
For a reasonably narrow range of postulated endogeneity correlations, these KLS confidence intervals are-as a general rule-narrower than those from IV/two-stage leastsquares (2SLS) estimations, particularly if the instruments are relatively weak. Thus, KLS inference is often more informative, and it avoids the problems associated with the search for strong and valid instruments. On top of that, the KLS approach enables testing of any potential exclusion restrictions. Because IVs are not needed for identification, their direct effect is (set) identifiable by adding them to the KLS regression (Kiviet 2020a,b).
Similar approaches with the aim to bound a causal effect of a single endogenous regressor in the absence of suitable instruments have been recently proposed by Krauth (2016) and Oster (2019) and implemented in their packages rcr and psacalc, respectively. Instead of an interval assumption about the correlation of the endogenous variable with the structural error term, they impose nontrivial restrictions on the magnitude of this correlation relative to the correlation of the endogenous regressor with other control variables. 2 In practice, bounding this sensitivity parameter may be a less intuitive task than placing bounds directly on the endogeneity correlation itself. When the model includes relevant control variables, the KLS estimator can be replicated with the relative correlation restriction (RCR) estimator of Krauth (2016) and the similar estimator of Oster (2019) by matching the respective sensitivity parameters. Yet, unlike the KLS estimator, the RCR estimator does not support models without control variables and is not immediately applicable to models with multiple endogenous regressors.
Undeniably, instrument-free inference is not a panacea to the problems of instrumentbased methods. It replaces one set of possibly strong though speculative assumptions with another set of hopefully less restrictive conjectural assumptions. In many applications, it might be easier to specify a credible range for the correlation of an endogenous regressor with the error term than to convincingly present strong and valid instruments. For example, theoretical considerations might plausibly inform us about the sign of the endogeneity. Yet, if the chosen endogeneity range is too narrow, it may not include the true correlation value, potentially leading to serious bias. If it is too wide, the resulting confidence intervals could be less informative than those from a 2SLS estimation with strong and valid instruments.
Assuming that we have reasonable prior information about the range of endogeneity correlations, KLS confidence intervals and test procedures can provide reliable inference even in the absence of valid and strong IVs. If instruments are available, the KLS inference can facilitate sensitivity checks for IV-based procedures. Because the different methods have different strengths and weaknesses, it is often reasonable to consider the instrument-free approach as a complement rather than a substitute to instrument-based procedures, possibly in addition to other methods that relax some of the assumptions underlying the traditional instrument-based inference. For instance, Conley, Hansen, and Rossi (2012) propose the construction of conservative confidence intervals that allow for a mild violation of the exclusion restrictions, assuming a plausible range of direct effects for the instruments. Nevo and Rosen (2012) derive bounds for the effect size in the presence of imperfect instruments, making assumptions about the sign and the maximum strength of the correlation of the instruments with the error term. These two procedures can be applied with the community-contributed commands plausexog and imperfectiv by Clarke and Matta (2018), respectively.
The KLS approach to statistical inference under confined regressor endogeneity is implemented in the new kinkyreg package. We review the methodology in section 2. After introducing the syntax of kinkyreg and its postestimation commands in sections 3 and 4, we illustrate the approach with an empirical example in section 5. The main output is graphical. KLS point estimates and confidence intervals are plotted for selected variables over a user-specified range of endogeneity correlations. The results are compared with the traditional 2SLS estimates if the user specifies any IVs. The exclusion restrictions can then be tested with a postestimation command that plots the p-values of the test over the endogeneity range. Similarly, instrument-free tests for linear hypotheses, correct functional-form specification, heteroskedasticity, and serial correlation are implemented as postestimation commands as well. Another postestimation command calculates the RCR sensitivity parameters that can be used to replicate the KLS results with the estimators of Krauth (2016) and Oster (2019).

Coefficient estimates and confidence intervals
Consider the linear regression model with i = 1, 2, . . . , N observations, an endogenous regressor x 1i , and a column vector of exogenous (or predetermined) variables x 2i : All variables are transformed into deviations from their means. 3 The restriction to a single endogenous regressor is mainly for expositional purposes. The methodology can be applied to any number of endogenous variables.
The standard approach to fitting models with endogenous regressors is by using IV techniques. However, instruments-based inference can be unreliable if the IVs z i are only weakly correlated with the endogenous regressor x 1i or if they are potentially endogenous themselves. To obtain consistent estimates, this approach exploits orthogonality conditions for the instruments: E(z i ε i ) = 0. Kiviet (2020a,b) suggests an alternative instrument-free approach that uses a nonorthogonality condition for the endogenous regressor in (1): E(x 1i ε i ) = ρ σ 1 σ ε , where ρ denotes the correlation coefficient between x 1i and ε i , and σ 1 and σ ε are the standard deviations (SD) of x 1i and ε i . 4 Clearly, this approach is infeasible unless ρ, σ 1 , and σ ε are known or can be estimated consistently. For the moment, assume that ρ is indeed known. σ 1 can be easily estimated from the observed data as the square root of As shown by Kiviet (2020a,b), σ ε can be consistently estimated as the square root of 3. In other words, the intercept is partialed out from this model. This is done automatically by the kinkyreg command. 4. In the case of multiple endogenous variables, E(x 1i ε i ) = σεdg(Σ 1 )ρ, where dg(Σ 1 ) is a diagonal matrix of SD and ρ is a column vector of endogeneity correlations. The subsequent formulas need to be adjusted accordingly; see Kiviet (2020a,b) for the general case.
where σ 2 ε,OLS = N −1 N i=1 ε 2 i,OLS is the familiar variance estimate from OLS residuals ε i,OLS . Because OLS is inconsistent when ρ = 0, we need to adjust this estimate. The adjustment term requires the covariance estimates x 2i x 2i that are readily obtained from the observed data. The KLS estimator then corrects the inconsistency of the OLS estimator as follows: Notice that the KLS estimator is point-symmetric around ρ = 0, and β 1 (ρ) is a monotonically decreasing function in ρ. 5 β 2 (ρ) can be monotonically increasing or decreasing, depending on the covariance terms, and β 2 (ρ) = β 2,OLS if ρ = 0 or if the exogenous regressors x 2i are uncorrelated with the endogenous regressor x 1i , that is, σ 12 = 0.
For inference on the coefficients β = (β 1 , β 2 ) , we need to calculate confidence bands that rely on consistent estimates of the estimator's variance. Kiviet (2020a,b) shows that the KLS estimator (3) is asymptotically normally distributed with variance-covariance matrix σ 2 ε V(ρ, κ x , κ ε ), where κ x is the kurtosis of the regressors x 1i and x 2i , and κ ε is the kurtosis of the error term ε i . 6 To arrive at an analytical expression for V(ρ, κ x , κ ε ), Kiviet (2020a) assumes that κ x is identical for all regressors. Usually, this will not be the case, but a conservative variance estimate is obtained by taking for κ x the largest kurtosis estimate across all regressors. 7 For a given regressor, say, x 1i , the kurtosis can be estimated as κ However, the correlation coefficient ρ is unknown, and without imposing additional restrictions, a consistent estimate of ρ is unattainable. Instead of tying oneself to a particular value ρ = r, we can assume that the true value is contained within a set ρ ∈ [r l , r u ]. Often, there might be prior information about the magnitude or the sign of the endogeneity that allows us to pin down reasonable boundaries for this interval. We can then obtain the KLS estimator β(r) for a range of values r ∈ [r l , r u ]. Corresponding confidence intervals can be constructed with variance estimates σ 2 ε (r)V{r, κ x , κ ε (r)}. For a significance level α, the union of these confidence intervals over the range r ∈ [r l , r u ] has asymptotic coverage of at least 1 − α.
As a more illuminating approach, we can also plot the coefficient estimates with corresponding confidence intervals over the chosen range of endogeneity correlations. This shows immediately for which values of ρ we can reject (or not reject) the null hypothesis that a coefficient of interest equals a certain value, most prominently whether the coefficient is statistically significantly different from 0. Such graphs are the main output of the new kinkyreg command, and examples can be seen in section 5.
The choice of r l and r u is restricted by certain feasibility bounds. To rule out a negative estimate of σ 2 ε (r), it follows from (2) that r must satisfy Thus, unless the endogenous regressor is uncorrelated (in the sample) with the exogenous regressors, that is, σ 12 = 0, the interval [r l , r u ] cannot be expanded arbitrarily close to −1 or 1. The closer we get to these feasibility bounds, the wider the confidence intervals become. For informative inference, we need to use some initial information or prior belief to restrict the admissible endogeneity to a reasonably narrow range.

Specification tests
or alternatively the corresponding F statistic if small-sample statistics are desired. It is then straightforward to test the valid exclusion of a set of variables x 3i from (1) by testing for joint statistical insignificance, H 0 : β 3 = 0, in the auxiliary KLS regression The results inform us which values of r ∈ [r l , r u ] are compatible with the valid exclusion of x 3i .
Testing exclusion restrictions is particularly useful in the context of IV/2SLS estimation. Instead of fitting (1) by KLS, we might choose x 3i as external IVs for the endogenous regressor x 1i , assuming that those instruments are indeed validly excluded from the model and that they are sufficiently correlated with x 1i . The predictive power of the instruments for the endogenous regressor can be assessed with conventional firststage diagnostics. If the model is overidentified, that is, if x 3i contains more than one excluded variable, we can use overidentifying-restrictions tests to assess the validity of the instruments, maintaining the assumption that at least one of the variables in x 3i (or a linear combination of them) is valid. 8 However, the joint validity of all instruments under unconstrained endogeneity of x 1i is untestable in this context, and the maintained assumption of valid exclusion for a subset of the instruments requires expert justification. This is where KLS comes into play. By constraining the endogeneity of x 1i , we can test the valid exclusion of x 3i . This does not come for free but requires expert judgment on the admissible degree of endogeneity. Yet it may often be easier to argue that the correlation of the endogenous regressor with the error term falls into a certain interval than to justify that there is no direct effect of (some of) the instruments. Such KLS exclusion restrictions tests can be performed with the postestimation command estat exclusion.
The KLS approach can also be applied to other specification tests. Closely related to the exclusion restrictions test is the Ramsey (1969) regression equation specification error test (RESET). By testing the valid exclusion of polynomials in the fitted values or right-hand-side variables, insights are provided about whether we used the correct functional form. However, the presence of the endogenous regressor x 1i will cause the fitted values, y i (r) = β 1 (r)x 1i + x 2i β 2 (r), to be endogenous as well. To circumvent this problem, we can apply an endogeneity correction. Following Kiviet (2020a), we can decompose the endogenous regressor into an exogenous and an endogenous part, x 1i = ξ 1i + ρ σ 1 ε i /σ ε . The exogenous part ξ 1i is unobserved, but we can consistently estimate it for any postulated degree of endogeneity r as An operationalized RESET version, implemented by estat reset, then uses adjusted fitted values y i (r) = β 1 (r) ξ 1i (r) + x 2i β 2 (r) in the auxiliary KLS regression (6). Notice that the added regressors now vary with r, that is, x 3i (r) = { y 2 i (r), y 3 i (r), . . . , y p i (r)} for some polynomial order p ≥ 2. Alternatively, x 3i (r) can be the respective powers of { ξ 1i (r), x 2i } . The test statistic is again the Wald statistic (5) (or its F statistic analogue) for the null hypothesis H 0 : β 3 = 0.
The KLS estimator (3) is derived by assuming a constant variance σ 2 ε . It is thus desirable to test this assumption. We can follow the Breusch and Pagan (1979) approach and run an auxiliary KLS regression of the squared residuals ε 2 i (r) on the endogeneitycorrected fitted values y i (r) or the (exogenous variation of the) right-hand-side variables { ξ 1i (r), x 2i } . 9 The null hypothesis of no conditional heteroskedasticity then corresponds to joint irrelevance of all variables in this auxiliary regression. This test is available with the postestimation command estat hettest.
In a time-series setting, the KLS approach rests on the assumption that there is no serial error correlation. If we suspect serial correlation, we could add lags of the dependent variable and the right-hand-side variables to the regression model to obtain a dynamically complete model (Wooldridge 2020, chap. 11.4). To be adequate for a model with a lagged dependent variable, a test for serial correlation should allow for regressors that are not strictly exogenous. This is the case for the "alternative test" of Durbin (1970), implemented by estat durbinalt as an exclusion restrictions test for the lagged residuals x 3i = { ε i−1 (r), ε i−2 (r), . . . , ε i−p (r)} , up to some lag order p ≥ 1, 9. Occasionally, it can be desirable to just use a subset of the right-hand-side variables or to include additional variables in the conditional heteroskedasticity model. kinkyreg2dta is a wrapper for kinkyreg that creates a dataset with the KLS estimation and postestimation results. It does not produce any graphs or estimation output. While kinkyreg can only vary the endogeneity correlation of one endogenous regressor at a time, kinkyreg2dta allows the user to vary these correlations for multiple endogenous regressors jointly. varlist1 is a list of exogenous variables. varlist2 is a list of endogenous variables. varlist_iv is a list of excluded IVs. With kinkyreg2dta, stepsize(# 1 # 2 ... ) sets the step size for the intervals over which the KLS estimator is computed. Separate step sizes can be specified for each endogenous variable in the order in which they appear in varlist2. stepsize(# 1 ) with only one element yields identical step sizes for all endogenous variables. The default is stepsize(0.01). ekurtosis(#) specifies a value for the kurtosis of the error term to be used in the variance calculation. By default, the kurtosis is estimated based on the KLS estimates.

Options
xkurtosis(#) specifies a value for the kurtosis of the right-hand-side variables to be used in the variance calculation. By default, the maximum of the estimated kurtosis for all variables in varlist1 and varlist2 is used. small requests that a degrees-of-freedom adjustment be made to the variance-covariance matrix and that small-sample t and F statistics be reported. The adjustment factor is N/(N − K), where N is the number of observations and K is the number of coefficients, including the intercept. By default, no degrees-of-freedom adjustment is made, and z and Wald statistics are reported.
11. Users can create their own loops with repeated calls to kinkyreg or use the kinkyreg2dta command if the endogeneity correlation shall be varied for multiple variables. An example is provided in section 5.2. 12. The feasible range is determined by the bounds in (4).
inference(varlist) specifies variables for which KLS inference graphs are generated.
By default, KLS inference is only carried out for the endogenous regressors, that is, inference(varlist2), unless the option lincom() is specified. In the latter case, the default is to produce KLS inference only for the specified linear combinations.
lincom(#: exp) specifies linear combinations exp of the regression coefficients for which KLS inference graphs are generated; see [R] lincom. You may specify as many sets of linear combinations, with different reference numbers # (an integer number between 1 and 1,999), as you need.
The twoway options name() and saving() require varname or # to be specified; The prefix is set with the option namestub(namestub). If varname is specified and the addressed variable contains factor-variable or time-series operators, the symbols "." and "#" are replaced by "_".
order(orderinfo) allows the user to change the order in which the plots are drawn. orderinfo is a list containing one or more of the following graph elements in the order in which they shall be drawn: kls for the KLS coefficient estimate, kls_ci for the KLS confidence interval, iv for the IV coefficient estimate, and iv_ci for the IV confidence interval. The default is order(iv_ci iv kls_ci kls). This option also affects the order of the graph elements in the graph legend; see [G-3] legend_options.
yrange(# 1 # 2 ) specifies that the coefficient and confidence interval plots be restricted to the interval [# 1 , # 2 ] on the y axis. A missing value for # 1 or # 2 refers to minus or plus infinity, respectively.
addplot(plot , before(orderinfo) ) allows the user to overlay the twoway graphs with additional plots; see [G-3] addplot_option. before(orderinfo) allows the user to change the order of the graph elements by drawing the additional plots immediately before the specified element. orderinfo is one of the graph elements kls, kls_ci, iv, or iv_ci as specified with the suboption order(). By default, the additional plots are ordered last.
coefplot(kls | iv varname | # , line_options recast(newplottype) ) determines the look of the KLS and IV coefficient plots. varname must be a variable name in varlist1 or varlist2. # must be the reference number for a linear combination specified with the option lincom(). If neither varname nor # is specified, then all coefficient plots are addressed. recast(newplottype) allows the user to treat the plot as newplottype instead of a line plot; see [G-3] advanced_options.
ciplot(kls | iv varname | # , fitarea_options recast(newplottype) ) determines the look of the KLS and IV confidence interval plots. varname must be a variable name in varlist1 or varlist2. # must be the reference number for a linear combination specified with the option lincom(). If neither varname nor # is specified, then all confidence interval plots are addressed.
fitarea_options are options allowed by graph twoway rarea; see recast(newplottype) allows the user to treat the plot as newplottype instead of a range plot with area shading; see [G-3] advanced_options. 13 namestub(namestub) sets the prefix for the names of all graphs being created unless a name is explicitly specified with the option twoway(varname | #, name(name)).
The default is namestub(kinkyreg). This option also affects the graphs created by the postestimation commands.

coeflegend; see [R] Estimation options.
nograph suppresses the creation of graphs for KLS inference.
noheader suppresses display of the header above the coefficient table that displays the number of observations.
notable suppresses display of the coefficient table.
novstore requests that the variance-covariance matrices for each grid point not be stored to consume less memory. By default, these matrices are stored as hidden estimation results. 14 They are required by some postestimation commands. This option is seldom used.
The following options are specific to kinkyreg2dta: frame(framename , replace ) requests creation of a new frame with name framename in which the new variables are generated. The new frame is made the current 13. For example, recast(rline) might be useful to replace the shaded areas with lines for the boundaries of the confidence intervals. 14. These matrices are stored as e(V_#), where # are consecutive integers from 1 to the number of grid points, with e(V_1) being the variance-covariance matrix for the lowest endogeneity correlation. Storing these matrices also allows the user to replay estimation results for different endogeneity correlations without reestimation by typing kinkyreg, correlation(#).
frame; see [D] frames. replace specifies that the frame may be replaced if it already exists. At least one of the options frame(), replace, or saving() is required.
replace specifies to replace the data in memory with the newly generated data, even if the current data have not been saved to disk. At least one of the options frame(), replace, or saving() is required.
saving(filename , replace ) specifies to save the newly generated data to disk under the name filename. replace permits to overwrite an existing dataset. At least one of the options frame(), replace, or saving() is required.
coef( b se ciub cilb : varlist numlist ) specifies the kinkyreg estimation results to be saved. These can be coefficient estimates (b), standard errors (se), confidence interval upper bounds (ciub), and confidence interval lower bounds (cilb). The respective results are saved for the coefficients of all variables in varlist and linear combinations with reference numbers # in numlist. These linear combinations must be specified with the kinkyreg option lincom(#: exp). If neither varlist nor numlist is specified, the results are saved for all endogenous variables in varlist2. You may specify as many sets of estimation results as you need.
estat(# chi2 | F p : estat_cmdline) specifies the kinkyreg postestimation estimation results to be saved. These can be the values of the test statistic (chi2 or F) and the p-values (p). estat_cmdline is the full syntax of the estat subcommand, including any options. The word estat is optional. You may specify as many postestimation results, with different reference numbers #, as you need.
double specifies to use the storage type double for the variables in the new dataset.

Stored results
kinkyreg stores the following results in e():

Postestimation commands
The kinkyreg package provides the following special-interest postestimation commands: estat test for tests of linear hypotheses, estat exclusion for tests of exclusion restrictions, estat reset for RESET, estat hettest for heteroskedasticity tests, estat durbinalt for Durbin's alternative serial correlation test, 15 and estat rcr for the calculation of the RCR sensitivity parameters.

Syntax
where test_spec is a coefficient list or expression. With estat test, neither name nor # must be specified.
With estat exclusion, name must be a variable name for the individual exclusion tests. For the joint exclusion test, name must not be specified.
With estat reset or estat durbinalt, # must be the integer value of an order specified with the option order().
With estat hettest, # must be the integer value referring to the #th specified varlist. If the option xb was specified, the corresponding test is ordered last.
With estat rcr, name must be lambda for Krauth's λ or delta for Oster's δ.
recast(newplottype) allows the user to treat the plot as newplottype instead of a line plot; see [G-3] advanced_options.
nograph suppresses the creation of the graph for KLS inference.
nojoint requests not to compute the joint exclusion test of all variables.
noindividual requests not to compute the individual exclusion tests for each variable.
xb requests to use the fitted values. Only the exogenous variation of the endogenous right-hand-side variable, (7), is used to compute the fitted values.
With estat reset, powers of the fitted values are used. This is the default.
With estat hettest, a test with fitted values only is computed, in addition to tests with other specified varlists, if any. This option is the default if no varlists are specified.
rhs requests to use the right-hand-side variables of the fitted regression model. Only the exogenous variation of the endogenous variable, (7), is used.
With estat reset, powers of the individual right-hand-side variables are used instead of the fitted values.
With estat hettest, the right-hand-side variables are added to each varlist. This option allows varlist to be empty, but parentheses are still required if multiple varlists are specified.
order(numlist) specifies the orders to be used for the test. A separate test is computed for each value in numlist.
With estat reset, these are the polynomial orders of the fitted values or righthand-side variables. The default is order(2 3 4).
With estat durbinalt, these are the maximum lag orders of the residuals. The default is order(1). ekurtosis(#) specifies a value for the kurtosis of the error term to be used in the variance calculation. By default, the kurtosis is estimated based on the KLS estimates.
xkurtosis(#) specifies a value for the kurtosis of the right-hand-side variables to be used in the variance calculation. By default, the maximum of the estimated kurtosis for all right-hand-side variables is used.
lambda and delta request to compute either Krauth's λ or Oster's δ for the replication of the KLS estimates with the respective RCR estimator. By default, both sensitivity parameters are computed.
minp returns for each endogeneity correlation the minimum p-value of individual significance tests among all variables in the respective variable list. By default, estat hettest computes joint significance tests of all variables in the auxiliary regression.

level(#) sets the confidence level; see [R] Estimation options.
notable suppresses display of the results table.

Stored results
All postestimation commands except estat rcr store the values of the test statistics in the matrices r(chi2_kls) or r(F_kls) and the corresponding p-values in the matrix r(p_kls). The command estat exclusion furthermore stores in matrix r(rho) the values of the endogeneity correlation and corresponding confidence bounds that are implied under validity of the exclusion restrictions. 16 The command estat rcr stores in matrix r(rcr_kls) the RCR parameter values λ and δ. Various additional scalars are returned by each postestimation command if the option correlation(#) is specified.

KLS estimation with a single endogenous regressor
We reanalyze data from the National Longitudinal Survey of Young Men used by Griliches (1976) to estimate the returns to schooling while accounting for individual differences in ability. Further control variables are labor market experience, job-specific tenure, location in the South, residence in a metropolitan area, and a set of year dummies.
. Because ability as a joint predictor of men's wages and the achieved level of schooling is unobserved, the returns to schooling cannot be consistently estimated by OLS. This omitted-variable bias can be mitigated by using a proxy variable for ability. In the following, it is assumed that by controlling for an individual's IQ score, we can account for the relationship between the completed years of schooling and the unobserved ability. However, being an imperfect measure of ability, such a proxy variable usually suffers from measurement error and thus needs to be treated as endogenous. 17 The standard approach is to find IVs that are both relevant and exogenous, that is, sufficiently correlated with the endogenous variable, validly excluded from the model, and uncorrelated with the measurement error. Such candidate instruments might be the age and the marital status of the individuals. 18 17. See Hayashi (2000, chap. 3.9) for a discussion of the omitted-variable and ability biases in the context of this application. Griliches (1976) emphasizes that schooling itself might be correlated with the measurement error of the ability proxy. We ignore this complication and treat schooling as exogenous once ability is controlled for. 18. We choose these instruments for illustrative purposes, following Baum, Schaffer, and Stillman (2007). In his original study, Griliches (1976) uses different sets of instruments.
. ivregress 2sls lw s expr tenure rns smsa _I* (iq = age mrt), small The 2SLS estimates yield a relatively high wage return of 34% to one additional year of schooling, while the significantly negative ability effect seems odd. To economize on space, we do not show the detailed output of the postestimation commands. The key statistics of interest are the Sargan test, 1.39 with a p-value of 0.238, and the first-stage F statistic, 2.72. While the overidentification test seems to indicate that the instruments are valid, 19 their relevance is questionable given a first-stage F statistic well below 10. Baum, Schaffer, and Stillman (2007) use this example to illustrate how their ivreg2 command suite can be used for further weak-instruments diagnostics. Instead, we resort to instrument-free inference with the kinkyreg command. Let us focus on the KLS inference for the endogenous regressor, the IQ score, and the main variable of interest, completed years of schooling. For the model specification in Baum, Schaffer, and Stillman (2007), which we label specification A, we obtain the respective graphs shown in figures 1 and 2 by specifying the option inference(iq s). With the range(-0.75 0.75) option, we request to compute and graph the KLS estimates for 151 potential correlations of IQ with the error term in the interval [−0.75, 0.75], given a default step size 19. Keep in mind that overidentification tests cannot actually test the joint validity of both instruments without maintaining the assumption that a linear combination of them is already valid to begin with.
of 0.01. The appearance of the kinkyreg graphs can be fine-tuned with the twoway(), coefplot(), and ciplot() options, enabling the full flexibility of Stata's graph command suite. For simplicity, we just start with the factory settings of the Stata Journal scheme. We will illustrate some of the graph options further below.
. set scheme sj . kinkyreg lw s expr tenure rns smsa _I* (iq = age mrt), range (-0.75   The wide confidence intervals of the 2SLS estimates immediately strike the eye. This is a well-known consequence of weak instruments. The KLS confidence intervals for a given endogeneity correlation are much narrower. 20 However, the true correlation is unknown, and we should consider the union of the confidence intervals over a reasonable range of correlations. In our example, over the whole range from −0.75 to 0.75, the union of KLS confidence intervals is about as wide as the 2SLS confidence interval, although the former is inconclusive regarding the sign of the effect. The KLS and 2SLS confidence intervals only overlap for relatively large positive endogeneity correlations, and it is noteworthy that the 2SLS point estimates are always outside of the KLS intervals over the whole considered range. This observation casts serious doubt on the appropriateness of the chosen IVs. With prior information on the reasonable range of the endogeneity, we can substantially sharpen the KLS inference. For example, we might be confident that it is less than 0.4 in absolute terms. Moreover, if measurement error is the only source of endogeneity, the correlation of the IQ score with the error term is negative by construction. Because of the resulting attenuation bias, the OLS estimates of the IQ coefficient (which are the KLS estimates with an endogeneity correlation of 0) are biased toward 0. Moreover, we would generally expect the effect of ability on wages to be nonnegative, which is incompatible with positive endogeneity correlations given our KLS estimates but also at odds with the 2SLS estimate.

20.
Recall that the KLS confidence intervals are (asymptotically) conservative. The coverage asymptotically equals 95% for a given value of ρ if the kurtosis of all regressors is identical and consistently estimated, for example, if all regressors are normally distributed. Nevertheless, in finite samples, based on simulation evidence by Kiviet (2020a), the asymptotic confidence intervals may turn out to be slightly liberal. The second output is simply the OLS results. Both the IQ and schooling effects are statistically significantly positive, as we would generally expect, but the KLS estimate of the return to schooling is substantially smaller than the 2SLS point estimate. Also, 21. We could also have directly restricted the KLS estimates in the graphs to this interval with the range() option, but the wider range provides a more complete picture that also allows the user to assess the sensitivity to different assumptions about the endogeneity correlation.
these KLS intervals do not overlap with the corresponding 2SLS confidence intervals, further reducing the confidence in the 2SLS approach, provided our assumptions on the model and the postulated endogeneity range are correct. Admittedly, and as a word of caution, our choice for the lower bound of the endogeneity range is quite arbitrary. If we relax that restriction, the KLS return-to-schooling estimate would turn statistically insignificant. Yet the confidence interval would expand in the opposite direction from the 2SLS estimate.
While we have seen above that the conventional overidentification tests after the 2SLS regression did not reject the null hypothesis, the weakness of the instruments or the nonexistence of a valid linear combination of the instruments might have been detrimental to the reliability of the test. The KLS approach instead allows us to perform instrument-free inference on the exclusion restrictions with the estat exclusion postestimation command. This produces the graph in figure 3, showing p-values for F tests (or Wald tests if we did not specify the small option in the kinkyreg command line) for the significance of the instruments' coefficients when added (jointly or individually) to the regression model, again treating the IQ score as endogenous. To facilitate the interpretation, the y-axis labels are amended using the twoway() option to indicate the conventional significance levels.
. estat exclusion, twoway(, ylabel(0.01 0.05 0.1)) notable  The KLS exclusion restriction tests presented in figure 3 substantiate our claim that age and marital status are unlikely to be valid instruments. Only for very large positive endogeneity correlations do we not reject the null hypothesis that the instruments are validly excluded from the model. Aside from questioning the reliability of the 2SLS estimates, this result also has implications for the KLS approach. If age and marital status are not validly excluded from the model, the KLS estimates would suffer from omitted-variables bias if any of the included regressors is correlated with the excluded variables. In this sample of young men aged between 16 and 30 years, it is in particular age that is substantially correlated with the schooling regressor, but also with experience and tenure. Clearly, the youngest men in the sample cannot be among those with highest years of schooling or experience.
In the following specification B, we have added age and marital status as regressors. If we were to apply 2SLS again, we would have to find another instrument for the endogenous IQ score. The advantage of the KLS approach is that we can obtain valid inference without any instruments. For a compact presentation of the results, we combine all the graphs of interest in the single figure 4. To improve the visibility of the axis titles and labels, we also manipulate a few of the graph settings with standard twoway options.
Focusing again on the endogeneity range [−0.4, 0], the estimated ability effect remains significantly positive, hardly affected by the inclusion of the two additional variables. The schooling effect, however, now turned statistically insignificant after controlling for age and marital status. It appears that the previously found positive return to schooling resulted primarily from the fact that men with many years of school attendance are also older. Labor market experience and job tenure also no longer seem to have a significant effect at this early stage of the individual's labor market career. The full returns to schooling or experience may only be reaped in later years, while ability makes a difference from the start. 22 Above, we used the exclusion restrictions test to investigate whether age and marriage were validly excluded from the model. A similar model misspecification test is the RESET test (Ramsey 1969). By testing the valid exclusion of polynomials in the fitted values, it can hint toward possible functional-form misspecification. By default, the estat reset postestimation command computes the test for polynomials in the fitted values up to the fourth order. 23 This is shown in figure 5, which features added grid lines for the 5% and 10% significance levels.  Griliches (1976) for a discussion of the peculiarities in the analysis of labor market data for young workers. 23. In the calculation of the fitted values, the endogenous IQ regressor is replaced by an estimate of its exogenous variation as in (7) to ensure the asymptotic exogeneity of the fitted values in the test regression.
At the 5% significance level, we do not reject the null hypothesis of correct model specification when we use at least a third-order polynomial. However, the evidence is not too comfortable for the endogeneity correlation range that is of particular interest to us.
Because the IQ score may not be an ideal proxy for ability, let us follow Griliches (1976) by considering the knowledge in world of work (KWW) test score as an alternative proxy variable. He suggests to use one of the potential proxy variables as an instrument for the other. While we could carry out the KLS analysis again without any instrument, it is insightful to compare the results for this specification C with just-identified 2SLS estimates with the IQ score as the IV.
. ivregress 2sls lw s expr tenure rns smsa _I* age mrt (kww = iq), small (output omitted ) . estat firststage (output omitted ) . estat endogenous (output omitted ) For brevity, detailed 2SLS results are omitted. The point estimates are 0.028 for the KWW coefficient and 0.003 for the return to schooling. The latter is neither statistically nor economically significant. These 2SLS results are now in line with our KLS evidence, and the confidence intervals are substantially smaller than with the potentially weak and invalid age and marriage instruments. A noteworthy deviation from the previous KLS results is that the 2SLS estimate of the age effect is not statistically significant.
The first-stage F statistic is 46.1, providing confidence that the instrument is sufficiently strong. The Durbin-Wu-Hausman F statistic of 8.68 with a p-value of 0.003 supports the assumption that KWW is endogenous. However, this conclusion relies on the validity of the instrument, which is untestable in the 2SLS framework because the model is just-identified. 24 The negative sign of the t statistic version of the Durbin-Wu-Hausman test further indicates a negative endogeneity correlation, in line with the measurement-error story. 25 Given that the two ability measures are not perfect substitutes, the IQ score might still have a direct effect on wages even after controlling for the KWW test score, thus violating the exclusion restriction. Before we again use our instrument-free machinery to test the valid exclusion of the IQ score, let us consider another instrument-based approach that has been proposed recently. Conley, Hansen, and Rossi (2012) propose to obtain interval estimates over a range of plausible values for the direct effect of the excluded instrument in the regression model. Because the support of this direct effect is in principle unbounded, forming a prior belief about a plausible range for it could 24. The assumption that both ability proxies are measured with error does not invalidate the use of the IQ score as an IV as long as the measurement errors are uncorrelated with each other. 25. We can compute the t statistic version of the Durbin-Wu-Hausman test manually as a significance test for the first-stage residuals kww_r in the last line of the following procedure: . regress kww s expr tenure rns smsa _I* are mrt iq . predict kww_r, residuals . regress lw kww s expr tenure rns smsa _I* age mrt kww_r generally be harder than agreeing on a reasonable range of endogeneity correlations. If this plausible range is chosen too large, the resulting confidence bands will become uninformatively wide. If the range is chosen too small, it might miss the true value.
Earlier, we obtained KLS estimates of a direct effect of the IQ score that is positive but below 0.018, based on the 95% union of confidence intervals within the endogeneity range [−0.4, 0]. To treat the IQ score as plausibly exogenous (PE) in the sense of Conley, Hansen, and Rossi (2012), we assume that this effect is at least halved once we control for the KWW score. For direct effects of the IQ score within the interval [0, 0.009], we can then use the plausexog package (Clarke and Matta 2018) to obtain the corresponding union of confidence intervals.
. plausexog uci lw s expr tenure rns smsa _I* age mrt (kww = iq), gmin(0) > gmax(0.009) (output omitted ) Instead of showing the output from the plausexog command, let us instead add the resulting confidence bands-[−0.066, 0.044] for KWW, [−0.023, 0.098] for schooling, and [−0.005, 0.106] for age-to the graphical output from the kinkyreg command. We can use the addplot() suboption to overlay the default KLS graphs with these additional confidence bands. Specifically, we use twoway line plots of a function (which is just a constant in our case) to draw horizontal lines over the endogeneity range [−0.75, 0.75]. 26 For aesthetic reasons, we also force these added plots to be drawn before the KLS confidence intervals, and we make some adjustments to the legend. The results are shown in figure 6.

Kinky least squares estimation
Number of obs = 758 . graph combine kinkyreg_kww kinkyreg_s kinkyreg_age, rows(3) ysize (6) 26. See [G-2] graph twoway function. We could achieve the same effect by first generating new variables for the confidence interval bounds and the endogeneity range and then overlaying the graph with a range plot with lines; see [G-2] graph twoway rline.   Figure 6. KLS, 2SLS, and PE coefficient estimates and confidence intervals in specification C While the instrument-based analysis becomes more robust if we allow the IQ score to have a (small) nonnegative direct effect, the resulting widened PE confidence bands make it harder to infer meaningful implications. 27 Most notably, we would no longer have conclusive evidence of a positive ability effect. In contrast, the KLS inference remains informative as long as we restrict our attention to a reasonable subset of endogeneity correlations.
. kinkyreg, correlation(-0.4) (output omitted ) . kinkyreg, correlation(0) (output omitted ) Maintaining the assumption that the endogeneity of the ability proxy is due to measurement error and therefore negative, the KLS estimate of the ability effect is still significantly positive. The schooling and age profiles over different endogeneity values are now remarkably similar, in contrast to the earlier results with the IQ score as the ability proxy. When KWW is just mildly endogenous, the returns to both schooling and age are statistically significantly positive. Over the endogeneity range [−0.4, 0], the union of KLS confidence intervals covers [0.001, 0.041] for the ability effect, [−0.025, 0.046] for the return to schooling, and [−0.006, 0.046] for the age coefficient. All three intervals encompass the respective 2SLS point estimate. This provides some indication that the IQ score could indeed be a valid and relevant instrument. As a further investigation of this matter, let us look again at the KLS exclusion restrictions test. The p-values are shown in figure 7. 27. Notice that the PE upper bound for the KWW score and the lower bound for schooling and age coincide with the respective 2SLS bounds. This is because we have chosen 0 as the lower limit for the direct effect of the IQ score, in which case it would be a valid instrument.  If the KWW score was subject to only minor measurement error, the test would still reject the hypothesis of valid exclusion of the IQ score. The output table of the estat exclusion command reveals that the null hypothesis is not rejected at the 5% significance level for endogeneity correlations in the interval [−0.521, −0.112]. Effectively, the KLS exclusion restrictions test is asymptotically equivalent to a test of coefficient equality between the KLS and 2SLS estimates, assuming that our prior belief about the endogeneity correlation is correct. If the exclusion restriction holds, then both the KLS and the 2SLS estimators are consistent. If it does not hold, the 2SLS estimator becomes inconsistent while the KLS estimator remains consistent. The peak of the p-value curve occurs at a correlation of −0.318. 28 Inverting the test, that is, starting from the assumption of instrument validity, this can be interpreted as the 2SLS-based point estimate of the endogeneity correlation.
To reinforce the trust in our KLS results, we can look at further specification tests. For example, we might suspect that squares and interaction terms of some of the regressors have predictive power. Instead of running the less specific RESET test again, we can test the exclusion restrictions for some of these terms, one at a time. The corresponding p-value curves are shown in figure 8.
. estat exclusion c.expr#c.expr c.tenure#c.tenure c.age#c.age > c.expr#c.tenure c.expr#c.age c.tenure#c.age, > twoway(, ymtick(0.05 0.1, grid)) nojoint notable 28. As demonstrated by Kiviet (2020a), the p-value asymptotically equals 1 at the actual peak. The estimate of −0.318 is obtained as a weighted average of the two adjacent grid points with highest p-values, −0.32 and −0.31, with weights equal to 1/(1 − p). The reported bounds are obtained by linear interpolation between the two grid points with p-values just above and just below the significance level.  Most squares and interaction terms appear to be validly excluded, aside from the interaction effect between tenure and age. 29 This indicates that the return to tenure varies with age but does not yet tell us anything about the magnitude or sign of this effect. In our specification D, we therefore include this interaction term in our regression model and compute the marginal return of tenure at three different ages, 18, 24, and 30 years: β tenure + 18 × β c.tenure#c.age β tenure + 24 × β c.tenure#c.age β tenure + 30 × β c.tenure#c.age We can do this with the lincom() option of kinkyreg. In addition, let us test the simple linear hypotheses of whether the respective marginal effects differ from the return to experience, that is, whether any of the above effects statistically differs from the coefficient β expr . The latter we do with the estat test postestimation command. We combine all graphs in figure 9.

29.
To be precise, we can only conclude that the insignificant interaction terms are indeed validly excluded after rerunning the exclusion restrictions tests for the model augmented with the tenureage interaction effect. The conclusions do not change in our case.
. estat test tenure+c.tenure#c.age*18=expr, twoway(, ylabel(0(0.2)1) > ymtick(0.05 0.1, grid)`tw_combine_options' name(kinkyreg_test_1)) . estat test tenure+c.tenure#c.age*24=expr, > twoway(, ymtick(0.05 0.1, grid)`tw_combine_options' name(kinkyreg_test_2)) . estat test tenure+c.tenure#c.age*30=expr, > twoway(, ymtick(0.05 0.1, grid)`tw_combine_options' name(kinkyreg_test_3)) . graph combine kinkyreg_1 kinkyreg_2 kinkyreg_3 kinkyreg_test_1 > kinkyreg_test_2 kinkyreg_test_3, altshrink We observe that the return to tenure increases with age. For the youngest, who just started their labor market careers, tenure does not determine the wage outcome, irrespective of the postulated endogeneity of the ability measure. At an age of 24 years, the point estimate of the return to tenure is positive throughout, although it is economically small and statistically significant only for a moderate endogeneity of ability. Because there is still not much difference between job-specific tenure and overall labor market experience at such an early age, it is not surprising to find no statistical difference between the two effects. For the oldest in our sample, the marginal effect of tenure rises further and is now statistically significant over the whole range of endogeneity correlations that we considered to be reasonable, r ∈ [−0.4, 0]. Moreover, we now reject the null hypothesis that the returns to tenure and experience are equal. At this age, the accumulation of job-specific knowledge and skills eventually pays off.  . KLS estimates and confidence intervals in specification D of the return to tenure, and p-values for linear hypothesis tests of equality of the returns to tenure and expr, when age equals 18, 24, or 30, respectively Let us scrutinize our regression specification D again with some specification tests. Figure 10 displays the results from RESET tests. The left subfigure shows p-value curves for tests based on polynomials in the fitted values. The right subfigure considers poly-nomials in all the right-hand-side variables. 30 To economize on the degrees of freedom, we consider only second-and third-order polynomials for this second variant of the test.
. estat reset, twoway(, ymtick(0.05 0.1, grid)`tw_combine_options' > legend(on rows(1)) name(kinkyreg_reset_xb)) . estat reset, rhs order(2 3) twoway(, ymtick(0.05 0.1, grid) >`tw_combine_options' legend(on) name(kinkyreg_reset_rhs)) . graph combine kinkyreg_reset_xb kinkyreg_reset_rhs, ysize(1.5) altshrink The results are now much more reassuring than those for our initial model specification. The RESET tests with polynomials of the fitted values in the left-hand graph of figure 10 would still cause some worries if we believed in a quite strong negative endogeneity correlation of the KWW score. 31 Next we use the estat hettest postestimation command to take a look at some KLS versions of Breusch and Pagan (1979) heteroskedasticity tests. Because homoskedasticity was assumed in the derivation of the KLS formulas, evidence of heteroskedasticity may cast doubt on the robustness of our results. We consider four variants of the test, in which we let different sets of variables enter the conditional heteroskedasticity model: i) the right-hand-side variables (option rhs with the empty variable list), ii) the righthand-side variables and the instrument (option rhs and the first nonempty variable list), iii) the right-hand-side variables plus some interaction effects (option rhs and the second nonempty variable list), and iv) the fitted values (option xb). 32 Because joint hypotheses tests with a large number of restrictions might have low power to detect a violation of just a few restrictions entailed by the null hypothesis, we also display a graph that shows the minimum of the p-values among all individual significance tests for a given variable list. This is achieved by adding the option minp. Figure 11 shows all results in a single graph, with the joint significance tests in the left subfigure and the minimum p-values in the right subfigure.
30. For the endogenous KWW regressor, we again use just an estimate of its exogenous variation as in (7). 31. While a chosen significance level provides a useful reference point, it should not be treated as a hard threshold. Low p-values above the significance level are still not entirely reassuring. 32. The fitted values in iv and the endogenous right-hand-side variable in i-iii are again adjusted to correct for the endogeneity.  Figure 11. p-values for KLS heteroskedasticity tests in specification D The joint hypotheses tests do not reject the null hypothesis of no conditional heteroskedasticity within our range of most reasonable endogeneity correlations. Just for the most flexible specification, iii, we find at least one regressor in the auxiliary regression with a statistically significant coefficient for negative endogeneity correlations of at least −0.25. While we could add further interaction terms to our regression model in an attempt to mitigate any heteroskedasticity concerns, the quantitative and qualitative conclusions would hardly change. Because most specification tests are already supportive for our chosen model, we are confident that the insights we have drawn from our KLS analysis are meaningful and statistically well grounded. Having said that, the analysis stands and falls with our maintained assumption that the ability proxy has a moderately negative correlation with the error term, consistent with a measurement-error story, and that all remaining regressors are exogenous.
The KLS procedure is related to the alternative instrument-free approaches proposed by Krauth (2016) and Oster (2019). Here we briefly illustrate that all three methods coincide by translating the endogeneity correlation into the respective sensitivity parameters of the other two approaches. Krauth (2016) places bounds on an RCR parameter λ. This is the ratio of the endogeneity correlation to the correlation of the endogenous regressor with an index of the control variables. For a given choice of the endogeneity correlation, say, our lower bound r l = −0.4, we can obtain λ(r l ) = r l /Corr{x 1i , x 2i β 2 (r l )} with the respective KLS estimate β 2 (r l ). Oster (2019) uses a similar measure of relative variability as the main sensitivity parameter δ. It is obtained by scaling Krauth's parameter with a ratio of SD, δ(r l ) = λ(r l )×SD{x 2i β 2 (r l )}/SD{ ε i (r l )}, where ε i (r l ) are the KLS residuals. The kinkyreg postestimation command estat rcr computes these RCR parameters for the whole range of considered endogeneity correlations. The resulting graphs are shown in figure 12. To zoom in, we have truncated the y axis to the interval [−5, 5] with the twoway() suboption yrange(-5 5) for the second subfigure. Furthermore, with the option correlation (-0.4), the values corresponding to r l = −0.4 can be displayed and stored as scalars r(lambda) and r(delta), respectively.
. estat rcr, twoway(,`tw_combine_options' legend(on) name(kinkyreg_rcr)) . estat rcr, correlation(-0.4) twoway(, yrange(-5 5)`tw_combine_options' > legend(on) name(kinkyreg_rcr_yrange)) Postulated endogeneity of kww = -0.4000 Relative correlation restriction sensitivity parameters Krauth's lambda = -4.1450 Oster's delta = -2.7802 . local lambda = r(lambda) . local delta = r(delta) . graph combine kinkyreg_rcr kinkyreg_rcr_yrange, ysize(1.5) altshrink We immediately notice that the functions λ(r) and δ(r) have a singularity. This is the point where the correlation of the endogenous regressor with the index of the control variables switches signs. The RCR estimators are not defined if this correlation equals 0, or if no control variables are present at all. When we approach this singularity from the left or right, the functions tend to ±∞. Furthermore, without additional restrictions, the RCR estimators may have multiple solutions for a given value of the sensitivity parameter. 33 For example, with the data at hand, a value of δ = 1.24 corresponds to three different endogeneity correlations of about −0.63, 0.64, and 0.73. In contrast, the KLS estimator is monotonous in r and does not suffer from these peculiarities.
. generate tenure_age = c.tenure#c.age . rcr lw kww s expr tenure rns smsa _I* age mrt tenure_age, lambda(`lambda' 0) (output omitted ) . regress lw kww s expr tenure rns smsa _I* age mrt c.tenure#c.age (output omitted ) . psacalc beta kww, delta(`delta') (output omitted ) The KWW coefficient estimates from the KLS and both RCR procedures are identical. The standard errors reported by the rcr command differ slightly from those computed by kinkyreg. While the latter uses the analytical formula from Kiviet (2020a) for the asymptotic variance-covariance matrix, Krauth (2016) uses delta-method techniques that may provide a poor approximation of the finite-sample distribution when the slope of λ(r) is either relatively large or relatively small. 35 The psacalc command does not calculate any standard errors, because of a lack of asymptotic results. Oster (2019) proposes to instead compute bootstrap standard errors, which could be done with the bootstrap prefix command.
A disadvantage of the rcr and psacalc commands is that they do not report coefficient estimates for the control variables. We can manually recover them by removing the effect of the endogenous variable from the dependent variable and then running a regression on the control variables. While the resulting coefficient estimates coincide with the KLS estimates, the standard errors are incorrect. If the RCR method is the starting point, say, because there is prior information about the sensitivity parameter δ (or λ), it is therefore advisable to calculate the corresponding value r and then apply the KLS method to obtain the full set of coefficient estimates with correct standard errors. The following code lines illustrate how we can map the RCR results back into the KLS estimates.

35.
Even for the OLS case, the standard errors reported by rcr and regress differ, with and without the option vce(robust) for the latter.
While we can numerically match the coefficient estimates with the different estimators, at least as long as relevant control variables are present, measurement error as the source of endogeneity is not the ideal example for the RCR methods. The RCR sensitivity parameters are usually interpreted as a measure for "the relative selection on observables and unobservables" (Oster 2019) in an evaluation of the OLS robustness to omitted-variables bias. In this sense, measurement error would not be seen as an omitted control variable. Oster considers an additional sensitivity parameter, the maximum R-squared, that is attainable from a hypothetical regression that includes all unobserved control variables. If there is remaining unexplained variation, for instance, due to measurement error, this maximum R-squared would be smaller than its default value 1. Yet the illustrated equivalence of the three instrument-free methods only holds if this hypothetical maximum R-squared is set to 1 in Oster's approach. This does not invalidate the KLS approach, which is completely flexible regarding the source of the endogeneity, but the corresponding RCR sensitivity parameters would have to be interpreted with caution.
In general, it might be difficult to pick reasonable intervals for δ or λ, not least because there are no natural bounds for these sensitivity parameters. 36 In contrast, the endogeneity correlation ρ is bounded by construction and a restriction of its sign is often credible.

KLS estimation with multiple endogenous regressors
For the exclusion restriction test that is underlying figure 7, the attentive reader might have noticed that we implicitly assumed the variable iq to be uncorrelated with the error term of the auxiliary regression. However, if we follow our argumentation that the ability proxies are measured with error, this assumption is violated. When we augment the model specification D with the second proxy variable, we thus have two endogenous regressors. In this specification E, varying both endogeneity correlations simultaneously yields a three-dimensional grid of coefficient estimates and corresponding confidence intervals. While there are no theoretical limits to the number of endogenous variables in the model, implementing a general package for flexible KLS inference quickly reaches computational limitations. It also requires a different approach to the visualization of the results already when there are just two endogenous variables.
The kinkyreg command does not attempt to provide a full-fledged solution to these complications. Yet it allows the user to fit the model with an arbitrary number of endogenous regressors by fixing all but one endogeneity correlation at user-specified values. The produced graphs can be regarded as two-dimensional slices through a multidimensional surface. The user can then call the kinkyreg command multiple times with different values for the correlations to produce a set of slices as desired.
36. Altonji, Elder, and Taber (2005) and Oster (2019) suggest a bound of 1 for the sensitivity parameter δ, which they interpret as equal selection on observed and unobserved variables. Cinelli and Hazlett (2020) critically discuss this approach and conclude that δ is not easily interpretable.
To illustrate this approach, let us vary the endogeneity correlation of the KWW score automatically over the range [−0.75, 0.75] but choose fixed values for the correlation of the IQ score with the error term from the set {−0.4, −0.2, 0}, one at a time. We do this with a simple loop and the option endogeneity(), which gets filled with the respective value for the endogeneity correlation of iq. The second entry of that option is set to missing, which indicates that the endogeneity for the second endogenous variable, kww, should be varied automatically. We eventually plot the coefficient estimates and confidence intervals for the two endogenous variables and the exogenous schooling variable in the single figure 13: . forvalues i = 1 / 3 { 2. local endo : word`i' of -0.4 -0.2 0 3. quietly kinkyreg lw s expr tenure rns smsa _I* age mrt > c.tenure#c.age (iq kww), endogeneity(`endo' .) range(-0.75 0.75) small > inference(iq kww s) twoway(, yrange(-0.2 0.2) ylabel(-0.2(0.1)0.2) > xlabel(-1(0.5)1)`tw_combine_options') twoway(iq, ylabel(-0.1(0.1)0.2) > title("postulated endogeneity of iq fixed at`endo'", size(vlarge)) > name(kinkyreg_iq_`i')) twoway(kww, name(kinkyreg_kww_`i')) > twoway(s, legend(on) name(kinkyreg_s_`i')) 4. } . graph combine kinkyreg_iq_1 kinkyreg_iq_2 kinkyreg_iq_3 kinkyreg_kww_1 > kinkyreg_kww_2 kinkyreg_kww_3 kinkyreg_s_1 kinkyreg_s_2 kinkyreg_s_3, > altshrink Notice that some of the graphs do not extend over the full range from −0.75 to 0.75. This is because the feasible range of endogeneity correlations becomes tighter when we have multiple endogenous variables. To avoid distorted pictures from very wide confidence intervals toward the boundaries, we have truncated the y axis with the twoway() suboption yrange(-0.2 0.2). This has the effect that the portions of the plots are omitted where the confidence interval spans beyond ±0.2.
The rightmost column displays results when iq is treated as exogenous. In line with the results from the exclusion restrictions test of the previous subsection, the IQ score could be excluded from the model if it was indeed exogenous, unless there is only a small negative or even positive endogeneity of the KWW score. 37 However, when we allow the IQ score to be endogenous itself, its direct effect becomes statistically significant, as evidenced in the first two columns. While there is hardly any noticeable effect of the endogeneity correlation of IQ on the coefficient estimate of the KWW score, the return to schooling decreases slightly with an increasingly negative endogeneity of the IQ score. When the endogeneity correlation of the latter is −0.4, the return to schooling even becomes statistically significantly negative for most of the plausible negative endogeneity correlations of the KWW score.
We could carry out further specification tests and redo our analysis for the returns to tenure and labor market experience, but to economize on space we leave this as an exercise to the interested reader. Instead, we illustrate how one can produce three-dimensional surface plots and contour plots, varying both endogeneity correlations. To achieve this, we use the kinkyreg2dta command to create a new dataset with the coefficient estimates for the variable of interest, s, and the p-values from the corresponding statistical significance test. Here we restrict ourselves to the endogeneity interval [−0.4, 0] for both ability proxies. Note that kinkyreg2dta is a simple wrapper command for kinkyreg that allows for multiple endogenous regressors. Internally, it calls kinkyreg (and the respective postestimation commands) for each value of iq's endogeneity correlation to compute the desired results over the grid range of kww's endogeneity correlations. We ask for the data to be generated in a new frame, and subsequently we obtain the surface and contour plots in figure 14. For the former, we use the community-contributed surface package (Mander 1999).

Conclusion
In this article, we introduced the kinkyreg command for kinky least-squares estimation of linear regression models. For models with endogenous regressors, the KLS approach provides valid confidence intervals for the regression coefficients, adopting a credible range for the endogeneity correlation. In many applications, researchers might have a strong prior belief about such a credible endogeneity range, while it is often more difficult to justify identifying exclusion restrictions. Our outlined instrument-free approach can provide more decisive evidence on the validity of exclusion restrictions than overidentification tests. In addition, the approach is not vulnerable to the familiar weak-instruments problem of instrument-based methods. Eventually, no approach strictly dominates the other. Pursuing instrument-free inference can be a reasonable standalone approach, or it can complement instrument-based methods.

Acknowledgments
We thank Eric Melse and an anonymous referee for providing valuable feedback.

Programs and supplemental materials
To install a snapshot of the corresponding software files as they existed at the time of publication of this article, type . net sj 21-3 . net install st0653 (to install program files, if available) . net get st0653 (to install ancillary files, if available)