How to use the pymer4.utils._sig_stars function in pymer4

To help you get started, we’ve selected a few pymer4 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ejolly / pymer4 / pymer4 / models / Lmer.py View on Github external
                df = df.assign(Sig=df["Perm-P-val"].apply(lambda x: _sig_stars(x)))
github ejolly / pymer4 / pymer4 / models / Lmer.py View on Github external
                df = df.assign(Sig=df["P-val"].apply(lambda x: _sig_stars(x)))
            elif "Perm-P-val" in df.columns:
github ejolly / pymer4 / pymer4 / models / Lm2.py View on Github external
intercept_pd = dict()
            for c in results.columns:
                intercept_pd[c] = np.nan
            intercept_pd = pd.DataFrame(intercept_pd, index=[0])
            results = pd.concat([intercept_pd, results], ignore_index=True)
        results.index = x.columns
        self.coefs = results
        if to_corrs:
            self.fixef = pd.DataFrame(betas, columns=ivs)
        else:
            self.fixef = pd.DataFrame(betas, columns=x.columns)
        self.fixef.index = self.data[self.group].unique()
        self.fixef.index.name = self.group
        if permute:
            # get signifance stars
            sig = [_sig_stars(elem) for elem in perm_ps]
            # Replace dof and p-vales with permutation results
            if conf_int != "boot":
                self.coefs = self.coefs.drop(columns=["DF", "P-val"])
            if to_corrs:
                self.coefs["Num_perm"] = [np.nan] + [permute] * (
                    self.coefs.shape[0] - 1
                )
                self.coefs["Sig"] = [np.nan] + sig
                self.coefs["Perm-P-val"] = [np.nan] + perm_ps
            else:
                self.coefs["Num_perm"] = [permute] * self.coefs.shape[0]
                self.coefs["Sig"] = sig
                self.coefs["Perm-P-val"] = perm_ps
            self.coefs = self.coefs[
                [
                    "Estimate",
github ejolly / pymer4 / pymer4 / models / Lm.py View on Github external
robust=robust,
                    n_lags=n_lags,
                    cluster=cluster,
                    weights=weights,
                    seed=seeds[i],
                )
                for i in range(permute)
            )
            perm_ts = np.array(perm_ts)

            p = []
            for col, fit_t in zip(range(perm_ts.shape[1]), t):
                p.append(_perm_find(perm_ts[:, col], fit_t))
            p = np.array(p)
            df = np.array([permute] * len(p))
            sig = np.array([_sig_stars(elem) for elem in p])

        # Make output df
        results = np.column_stack([b, ci_l, ci_u, se, df, t, p, sig])
        results = pd.DataFrame(results)
        results.index = x.columns
        results.columns = [
            "Estimate",
            "2.5_ci",
            "97.5_ci",
            "SE",
            "DF",
            "T-stat",
            "P-val",
            "Sig",
        ]
        results[