@@ -206,80 +206,26 @@ def test_interactions_nhanes_pairwise(data_NHANES):
206206 )
207207 compare_result (loaded_result , python_result , rtol = 1e-02 )
208208
209- # Test Adding pvalues
210- clarite .analyze .add_corrected_pvalues (python_result_nobeta , pvalue = "LRT_pvalue" )
211- clarite .analyze .add_corrected_pvalues (python_result , pvalue = "Full_Var1_Var2_Pval" )
212- clarite .analyze .add_corrected_pvalues (
213- python_result , pvalue = "LRT_pvalue" , groupby = ["Term1" , "Term2" ]
214- )
215- # Ensure grouped pvalue corrections match
216- grouped_bonf = (
217- python_result .reset_index (drop = False )
218- .groupby (["Term1" , "Term2" , "Outcome" ])["LRT_pvalue_bonferroni" ]
219- .first ()
220- )
221- grouped_fdr = (
222- python_result .reset_index (drop = False )
223- .groupby (["Term1" , "Term2" , "Outcome" ])["LRT_pvalue_fdr" ]
224- .first ()
225- )
226-
227209 # TODO: Alter this test because nobeta did not open all categories
228- # assert (grouped_bonf == python_result_nobeta["LRT_pvalue_bonferroni"]).all()
229- # assert (grouped_fdr == python_result_nobeta["LRT_pvalue_fdr"]).all()
230- assert grouped_bonf == grouped_bonf
231- assert grouped_fdr == grouped_fdr
232-
233210
234- def test_interaction_exe ():
235- nested_table = clarite .load .from_csv (
236- "/Users/andrerico/HALL/Python_3_10/clarite-python/tests/test_data_files/nested_table.csv"
237- )
238- # Return same result if not change data type
239- # list_bin = (
240- # "female",
241- # "black",
242- # "mexican",
243- # "other_hispanic",
244- # "other_eth",
211+ # # Test Adding pvalues
212+ # clarite.analyze.add_corrected_pvalues(python_result_nobeta, pvalue="LRT_pvalue")
213+ # clarite.analyze.add_corrected_pvalues(python_result, pvalue="Full_Var1_Var2_Pval")
214+ # clarite.analyze.add_corrected_pvalues(
215+ # python_result, pvalue="LRT_pvalue", groupby=["Term1", "Term2"]
245216 # )
246- # list_cat = (
247- # "SDDSRVYR",
248- # "SES_LEVEL",
217+
218+ # # Ensure grouped pvalue corrections match
219+ # grouped_bonf = (
220+ # python_result.reset_index(drop=False)
221+ # .groupby(["Term1", "Term2", "Outcome"])["LRT_pvalue_bonferroni"]
222+ # .first()
249223 # )
250- # list_cont = (
251- # "BMXBMI",
252- # "RIDAGEYR",
253- # "LBXCOT",
254- # "IRON_mg",
255- # "DR1TSFAT",
256- # "DRDSDT1",
224+ # grouped_fdr = (
225+ # python_result.reset_index(drop=False)
226+ # .groupby(["Term1", "Term2", "Outcome"])["LRT_pvalue_fdr"]
227+ # .first()
257228 # )
258229
259- # nested_table = clarite.modify.make_binary(data=nested_table, only=(list_bin))
260- # nested_table = clarite.modify.make_categorical(data=nested_table, only=(list_cat))
261- # nested_table = clarite.modify.make_continuous(data=nested_table, only=(list_cont))
262-
263- e1 = "DR1TSFAT"
264- e2 = "DRDSDT1"
265- list_covariant = [
266- "female" ,
267- "black" ,
268- "mexican" ,
269- "other_hispanic" ,
270- "other_eth" ,
271- "SDDSRVYR" ,
272- "BMXBMI" ,
273- "SES_LEVEL" ,
274- "RIDAGEYR" ,
275- "LBXCOT" ,
276- "IRON_mg" ,
277- ]
278- retorno = clarite .analyze .interaction_study (
279- data = nested_table ,
280- outcomes = "LBXHGB" ,
281- interactions = [(e1 , e2 )],
282- covariates = list_covariant ,
283- )
284-
285- assert retorno == retorno
230+ # assert (grouped_bonf == python_result_nobeta["LRT_pvalue_bonferroni"]).all()
231+ # assert (grouped_fdr == python_result_nobeta["LRT_pvalue_fdr"]).all()
0 commit comments