Given the situation you describe (sizeable(?) errors in the predictors) from that link what should stand out is
In the case when some regressors have been measured with errors,
estimation based on the standard assumption leads to inconsistent
estimates, meaning that the parameter estimates do not tend to the
true values even in very large samples.
I understand that you don't want to become an expert in Statistics. But because of the above severe warning, you should consult a Statistician rather than grow your own code.
Of course, it also depends on the size of the errors in the predictor variables. If very small, then there is no issue. But your description does not include such information.