While machine learning is attracting increasing attention among social scientists and economists, the range of off-the-shelf machine learning tools available in many commercial software packages is still limited. We present two Stata packages implementing linear regularized regression methods intended for prediction, model selection, and causal inference. LASSOPACK implements lasso, square-root lasso, elastic net, ridge regression, adaptive lasso, and post-estimation OLS. LASSOPACK offers three approaches for setting the tuning parameters: K-fold cross-validation, information criteria and rigorous penalization. PDSLASSO supports the post-double selection of Belloni et al. (2014) and post-regularization methodology of Chernozhukov, Hansen and Spindler (2015) for selecting controls and/or instruments in structural models. For demonstration, we apply PDSLASSO to a gravity model of commuting flows in Ireland. We investigate empirically whether rising rents have lead to a change in commuting behaviour. To this end, we consider a panel gravity model of commuting flows over 2011-2016.