# Path: econtools/util/gentools.py
# def force_list(x: Any) -> list:
#     """If type not `list`, pass to `force_interable`, then convert to list."""
#     if isinstance(x, list):
#         return x
#     else:
#         return list(force_iterable(x))


from typing import Tuple
from numpy.linalg import matrix_rank        # not in `scipy.linalg`
from econtools.util.gentools import force_list
import pandas as pd
import numpy as np
import numpy.linalg as la    # scipy.linalg yields slightly diff results (tsls)
import scipy.stats as stats
            return self._r2
        except AttributeError:
            self._r2 = 1 - self.ssr/self.sst
            return self._r2

    @property
    def r2_a(self):
        try:
            return self._r2_a
        except AttributeError:
            self._r2_a = (
                1 - (self.ssr/(self.N - self.K))/(self.sst/(self.N - 1)))
            return self._r2_a

    def Ftest(self, col_names, equal=False):
        """F test using regression results.

        Args:
            col_names (str or list): Regressor name(s) to test.

        Keyword Args:
            equal (bool): Defaults to False. If True, test if all coefficients
                in ``col_names`` are equal. If False, test if ``col_names`` are
                jointly significant.

        Returns:
            tuple: A tuple containing:
                - **F** (float): F-stat.
                - **pF** (float): p-score for ``F``.
        """

# Path: econtools/util/gentools.py
# def force_list(x: Any) -> list:
#     """If type not `list`, pass to `force_interable`, then convert to list."""
#     if isinstance(x, list):
#         return x
#     else:
#         return list(force_iterable(x))


# Path: econtools/metrics/results.py
from typing import Tuple
from numpy.linalg import matrix_rank        # not in `scipy.linalg`
from econtools.util.gentools import force_list
import pandas as pd
import numpy as np
import numpy.linalg as la    # scipy.linalg yields slightly diff results (tsls)
import scipy.stats as stats

            return self._r2
        except AttributeError:
            self._r2 = 1 - self.ssr/self.sst
            return self._r2

    @property
    def r2_a(self):
        try:
            return self._r2_a
        except AttributeError:
            self._r2_a = (
                1 - (self.ssr/(self.N - self.K))/(self.sst/(self.N - 1)))
            return self._r2_a

    def Ftest(self, col_names, equal=False):
        """F test using regression results.

        Args:
            col_names (str or list): Regressor name(s) to test.

        Keyword Args:
            equal (bool): Defaults to False. If True, test if all coefficients
                in ``col_names`` are equal. If False, test if ``col_names`` are
                jointly significant.

        Returns:
            tuple: A tuple containing:
                - **F** (float): F-stat.
                - **pF** (float): p-score for ``F``.
        """

        cols = force_list(col_names)