def test_reg_unif(self): std = reg(self.df, self.y, self.x, cluster=self.cluster, addcons=True) shac = reg(self.df, self.y, self.x, shac=self.spatial_hac, addcons=True) expected = std.vce / std._vce_correct result = shac.vce / shac._vce_correct assert_array_almost_equal(expected, result)
def setup_class(cls): """Stata reg output from `sysuse auto; reg price mpg`""" test_path = path.split(path.relpath(__file__))[0] auto_path = path.join(test_path, 'data', 'auto.dta') autodata = pd.read_stata(auto_path) y = 'price' x = ['mpg', 'length'] a_name = 'gear_ratio' cls.result = reg(autodata, y, x, a_name=a_name, cluster=a_name) cls.expected = areg_cluster