def error(r):
    """
    Manually calculate the error according to Wilks definition; compare to bse.
    Proves that the bse parameter is equal to Equation 7.18b in Wilks.
    """
    se2 = (r.resid.values ** 2).sum() / (r.nobs - 2)
    xfact2 = 12 / (r.nobs ** 3 - r.nobs)
    sigma = se2 ** 0.5 * xfact2 ** 0.5
    print('Provided: %.10f, manually calculated: %.10f' % (r.bse.x1, sigma))
    return
