def test_004_docs_feat_three(self): """Test docs feature 3: multiple dependent or independent variables""" df = scdata.load_example_data1() x_exog = ['x1', 'x2'] y_endog = 'y1' controls = ['c1', 'c2', 'group1', 'group2'] sc = specy.SpecificationCurve(df, y_endog, x_exog, controls) sc.fit() sc.plot() sc.df_r.head()
def test_010_preferred_specification(self): """Test of labelling preferred specification.""" df = scdata.load_example_data1() x_exog = 'x1' y_endog = 'y1' controls = ['c2', 'group1', 'group2'] sc = specy.SpecificationCurve(df, y_endog, x_exog, controls) sc.fit() sc.plot(preferred_spec=['group1', 'x1', 'y1']) sc.df_r.head()
def test_005_save_fig(self): """Test save fig..""" df = scdata.load_example_data1() x_exog = ['x1', 'x2'] y_endog = 'y1' controls = ['c1', 'c2', 'group1', 'group2'] sc = specy.SpecificationCurve(df, y_endog, x_exog, controls, cat_expand=['group1']) sc.fit() sc.plot(save_path='test_fig.pdf') os.remove('test_fig.pdf')
def test_002_docs_feat_two(self): """Test docs feature 2.""" df = scdata.load_example_data1() y_endog = 'y1' x_exog = 'x1' controls = ['c1', 'c2', 'group1', 'group2'] sc = specy.SpecificationCurve(df, y_endog, x_exog, controls, exclu_grps=[['c1', 'c2']]) sc.fit() sc.plot() sc.df_r.head()
def test_001_fe_grp(self): """Test expand multiple FE groups. Docs feature 1.""" df = scdata.load_example_data1() y_endog = 'y1' x_exog = 'x1' controls = ['c1', 'c2', 'group1', 'group2'] sc = specy.SpecificationCurve(df, y_endog, x_exog, controls, cat_expand=['group1', 'group2']) sc.fit() sc.plot() sc.df_r.head()
def test_009_always_include(self): """Test of always include.""" df = scdata.load_example_data1() x_exog = 'x1' y_endog = 'y1' controls = ['c2', 'group1', 'group2'] sc = specy.SpecificationCurve(df, y_endog, x_exog, controls, always_include='c1') sc.fit() sc.plot() sc.df_r.head()