Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@cache_readonly
def oddsratio_pooled(self):
"""
The pooled odds ratio.
The value is an estimate of a common odds ratio across all of the
stratified tables.
"""
odds_ratio = np.sum(self._ad / self._n) / np.sum(self._bc / self._n)
return odds_ratio
@cache_readonly
def llf_recursive_obs(self):
"""
(float) Loglikelihood at observation, computed from recursive residuals
"""
from scipy.stats import norm
return np.log(norm.pdf(self.resid_recursive, loc=0,
scale=self.scale**0.5))
@cache_readonly
def mannwhitney_u(self):
"""Mann-Whitney U-statistic.
Performs a basic rank-sum test.
Notes
-----
Operates on untransformed, non-paired data.
See also
--------
scipy.stats.mannwhitneyu
"""
if self._mannwhitney_stats is not None:
return self._mannwhitney_stats[0]
@cache_readonly
def uncentered_tss(self):
"""
Uncentered sum of squares.
The sum of the squared values of the (whitened) endogenous response
variable.
"""
wendog = self.model.wendog
return np.dot(wendog, wendog)
@cache_readonly
def polyn(self):
polyn = [interp1d(self.size, self.crit_table[:, i])
for i in range(self.n_alpha)]
return polyn
@cache_readonly
def standard_errors(self):
"""
Returns the standard errors of the parameter estimates.
"""
return np.sqrt(np.diag(self.cov_params()))
@cache_readonly
def resid(self):
return self.model.geterrors(self.params)
@cache_readonly
def _chol_sigma_u(self):
return np.linalg.cholesky(self.sigma_u)
@cache_readonly
def resid_studentized_internal(self):
"""Studentized residuals using variance from OLS
this uses sigma from original estimate
does not require leave one out loop
"""
return self.get_resid_studentized_external(sigma=None)
# return self.results.resid / self.sigma_est
@cache_readonly
def dffits(self):
"""dffits measure for influence of an observation
based on resid_studentized_external,
uses results from leave-one-observation-out loop
It is recommended that observations with dffits large than a
threshold of 2 sqrt{k / n} where k is the number of parameters, should
be investigated.
Returns
-------
dffits: float
dffits_threshold : float
References