IDEAS home Printed from https://ideas.repec.org/a/jss/jstsof/v079i03.html
   My bibliography  Save this article

Kernel-Based Regularized Least Squares in R (KRLS) and Stata (krls)

Author

Listed:
  • Ferwerda, Jeremy
  • Hainmueller, Jens
  • Hazlett, Chad J.

Abstract

The Stata package krls as well as the R package KRLS implement kernel-based regularized least squares (KRLS), a machine learning method described in Hainmueller and Hazlett (2014) that allows users to tackle regression and classification problems without strong functional form assumptions or a specification search. The flexible KRLS estimator learns the functional form from the data, thereby protecting inferences against misspecification bias. Yet it nevertheless allows for interpretability and inference in ways similar to ordinary regression models. In particular, KRLS provides closed-form estimates for the predicted values, variances, and the pointwise partial derivatives that characterize the marginal effects of each independent variable at each data point in the covariate space. The method is thus a convenient and powerful alternative to ordinary least squares and other generalized linear models for regression-based analyses.

Suggested Citation

  • Ferwerda, Jeremy & Hainmueller, Jens & Hazlett, Chad J., 2017. "Kernel-Based Regularized Least Squares in R (KRLS) and Stata (krls)," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 79(i03).
  • Handle: RePEc:jss:jstsof:v:079:i03
    DOI: http://hdl.handle.net/10.18637/jss.v079.i03
    as

    Download full text from publisher

    File URL: https://www.jstatsoft.org/index.php/jss/article/view/v079i03/v79i03.pdf
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v079i03/krls.zip
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v079i03/v79i03.do
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v079i03/KRLS_1.0-0.tar.gz
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v079i03/v79i03.R
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v079i03/growthdata.dta
    Download Restriction: no

    File URL: https://libkey.io/http://hdl.handle.net/10.18637/jss.v079.i03?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. Hainmueller, Jens & Hazlett, Chad, 2014. "Kernel Regularized Least Squares: Reducing Misspecification Bias with a Flexible and Interpretable Machine Learning Approach," Political Analysis, Cambridge University Press, vol. 22(2), pages 143-168, April.
    2. Simon N. Wood, 2004. "Stable and Efficient Multiple Smoothing Parameter Estimation for Generalized Additive Models," Journal of the American Statistical Association, American Statistical Association, vol. 99, pages 673-686, January.
    3. Ho, Daniel E. & Imai, Kosuke & King, Gary & Stuart, Elizabeth A., 2007. "Matching as Nonparametric Preprocessing for Reducing Model Dependence in Parametric Causal Inference," Political Analysis, Cambridge University Press, vol. 15(3), pages 199-236, July.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Christopher Hare & Tzu-Ping Liu & Robert N. Lupton, 2018. "What Ordered Optimal Classification reveals about ideological structure, cleavages, and polarization in the American mass public," Public Choice, Springer, vol. 176(1), pages 57-78, July.
    2. Joachim Wagner, 2024. "Estimation of empirical models for margins of exports with unknown non-linear functional forms: A Kernel-Regularized Least Squares (KRLS) approach Evidence from eight European countries," Working Paper Series in Economics 424, University of Lüneburg, Institute of Economics.
    3. Wagner, Joachim, 2024. "Estimation of empirical models for margins of exports with unknown nonlinear functional forms: A Kernel-Regularized Least Squares (KRLS) approach," KCG Working Papers 32, Kiel Centre for Globalization (KCG).
    4. Joachim Wagner, 2024. "Cloud Computing and Extensive Margins of Exports - Evidence for Manufacturing Firms from 27 EU Countries," Working Paper Series in Economics 427, University of Lüneburg, Institute of Economics.
    5. Choi, Yeri & Lee, Sugie, 2020. "The impact of urban physical environments on cooling rates in summer: Focusing on interaction effects with a kernel-based regularized least squares (KRLS) model," Renewable Energy, Elsevier, vol. 149(C), pages 523-534.
    6. Joachim Wagner, 2024. "Robots and Extensive Margins of Exports - Evidence for Manufacturing Firms from 27 EU Countries," Working Paper Series in Economics 426, University of Lüneburg, Institute of Economics.
    7. Kartal, Mustafa Tevfik & Pata, Ugur Korkut & Kılıç Depren, Serpil & Depren, Özer, 2023. "Effects of possible changes in natural gas, nuclear, and coal energy consumption on CO2 emissions: Evidence from France under Russia’s gas supply cuts by dynamic ARDL simulations approach," Applied Energy, Elsevier, vol. 339(C).

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Fervers, Lukas, 2018. "Can public employment schemes break the negative spiral of long-term unemployment, social exclusion and loss of skills? Evidence from Germany," Journal of Economic Psychology, Elsevier, vol. 67(C), pages 18-33.
    2. Liu, Yan & Chen, Xi & Yan, Zhijun, 2019. "Depression in the House: The Effects of Household Air Pollution from Solid Fuel Use in China," IZA Discussion Papers 12654, Institute of Labor Economics (IZA).
    3. Noemi Kreif & Richard Grieve & Rosalba Radice & Zia Sadique & Roland Ramsahai & Jasjeet S. Sekhon, 2012. "Methods for Estimating Subgroup Effects in Cost-Effectiveness Analyses That Use Observational Data," Medical Decision Making, , vol. 32(6), pages 750-763, November.
    4. Do, Manh Hung & Nguyen, Trung Thanh & Grote, Ulrike, 2023. "Land consolidation, rice production, and agricultural transformation: Evidence from household panel data for Vietnam," Economic Analysis and Policy, Elsevier, vol. 77(C), pages 157-173.
    5. Federico Biagi & Daniele Bondonio & Alberto Martini, 2015. "Counterfactual Impact Evaluation of Enterprise Support Programmes. Evidence from a Decade of Subsidies to Italian Firm," ERSA conference papers ersa15p1619, European Regional Science Association.
    6. Bono, Pierre-Henri & David, Quentin & Desbordes, Rodolphe & Py, Loriane, 2022. "Metro infrastructure and metropolitan attractiveness," Regional Science and Urban Economics, Elsevier, vol. 93(C).
    7. Zichen Deng & Maarten Lindeboom, 2021. "Early-life Famine Exposure, Hunger Recall and Later-life Health," Tinbergen Institute Discussion Papers 21-054/V, Tinbergen Institute.
    8. Leah Warfield Smith & Randall Lee Rose & Alex R. Zablah & Heath McCullough & Mohammad “Mike” Saljoughian, 2023. "Examining post-purchase consumer responses to product automation," Journal of the Academy of Marketing Science, Springer, vol. 51(3), pages 530-550, May.
    9. Baron, Opher & Callen, Jeffrey L. & Segal, Dan, 2023. "Does the bullwhip matter economically? A cross-sectional firm-level analysis," International Journal of Production Economics, Elsevier, vol. 259(C).
    10. Noémi Kreif & Richard Grieve & M. Zia Sadique, 2013. "Statistical Methods For Cost‐Effectiveness Analyses That Use Observational Data: A Critical Appraisal Tool And Review Of Current Practice," Health Economics, John Wiley & Sons, Ltd., vol. 22(4), pages 486-500, April.
    11. Jonathan Colmer & Ralf Martin & Mirabelle Muûls & Ulrich J. Wagner, 2020. "Does pricing carbon mitigate climate change? Firm-level evidence from the European Union emissions trading scheme," CEP Discussion Papers dp1728, Centre for Economic Performance, LSE.
    12. Jian Jiu Chen & Sai Yin Ho & Wing Man Au & Man Ping Wang & Tai Hing Lam, 2015. "Family Smoking, Exposure to Secondhand Smoke at Home and Family Unhappiness in Children," IJERPH, MDPI, vol. 12(11), pages 1-14, November.
    13. Christopher Muller & Daniel Schrage, 2014. "Mass Imprisonment and Trust in the Law," The ANNALS of the American Academy of Political and Social Science, , vol. 651(1), pages 139-158, January.
    14. Kube, Roland & von Graevenitz, Kathrine & Löschel, Andreas & Massier, Philipp, 2019. "Do voluntary environmental programs reduce emissions? EMAS in the German manufacturing sector," Energy Economics, Elsevier, vol. 84(S1).
    15. Blackman, Allen, 2013. "Evaluating forest conservation policies in developing countries using remote sensing data: An introduction and practical guide," Forest Policy and Economics, Elsevier, vol. 34(C), pages 1-16.
    16. repec:zbw:rwirep:0170 is not listed on IDEAS
    17. Natalie Carvalho & Naveen Thacker & Subodh S Gupta & Joshua A Salomon, 2014. "More Evidence on the Impact of India's Conditional Cash Transfer Program, Janani Suraksha Yojana: Quasi-Experimental Evaluation of the Effects on Childhood Immunization and Other Reproductive and Chil," PLOS ONE, Public Library of Science, vol. 9(10), pages 1-13, October.
    18. K. Poehlmann & R. Helm & O. Mauroner & J. Auburger, 2021. "Corporate spin-offs’ success factors: management lessons from a comparative empirical analysis with research-based spin-offs," Review of Managerial Science, Springer, vol. 15(6), pages 1767-1796, August.
    19. Renata Baborska & Emilio Hernandez & Emiliano Magrini & Cristian Morales-Opazo, 2020. "The impact of financial inclusion on rural food security experience: A perspective from low-and middle-income countries," Review of Development Finance Journal, Chartered Institute of Development Finance, vol. 10(2), pages 1-18.
    20. Hamilton, Timothy L. & Wichman, Casey J., 2018. "Bicycle infrastructure and traffic congestion: Evidence from DC's Capital Bikeshare," Journal of Environmental Economics and Management, Elsevier, vol. 87(C), pages 72-93.
    21. Fiaschi, Davide & Lavezzi, Andrea Mario, 2007. "Nonlinear economic growth: Some theory and cross-country evidence," Journal of Development Economics, Elsevier, vol. 84(1), pages 271-290, September.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:jss:jstsof:v:079:i03. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F. Baum (email available below). General contact details of provider: http://www.jstatsoft.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.