code: def compare_corrections_to_regenie(
      spark,
      pvalue_threshold,
      output_prefix,
      compare_all_cols,
      uncorrected,
      corrected,
      missing=[],
  ):
      (
          genotype_df,
          phenotype_df,
          covariate_df,
          offset_df,
      ) = fx.get_input_dfs(spark, binary=True, missing=missing)
      glowgr_df = lr.logistic_regression(
          genotype_df,
          phenotype_df,
          covariate_df,
          offset_df,
          correction=lr.correction_approx_firth,
          pvalue_threshold=pvalue_threshold,
          values_column="values",
      ).toPandas()
      fx.compare_to_regenie(output_prefix, glowgr_df, compare_all_cols)
  
      correction_counts = glowgr_df.correctionSucceeded.value_counts(
          dropna=False
      ).to_dict()
      if uncorrected > 0:
          # null in Spark DataFrame converts to nan in pandas
          assert correction_counts[np.nan] == uncorrected
      if corrected > 0:
          assert correction_counts[True] == corrected
      assert False not in correction_counts
  
      return glowgr_df
  
imports: from dataclasses import dataclass
  import functions
  import glow.gwas.log_reg
  import glow.gwas.approx_firth
  import pandas
  from nptyping import Float, NDArray
  import numpy
  import pytest
  from typing import Any
label_desc: Use image node_id 8 for calling a global function with example usage: compare_corrections_to_regenie(spark, pvalue_threshold, output_prefix, compare_all_cols, uncorrected, corrected, missing) and returns: glowgr_df