def z_score(self, baseline=0.0): """Return a parametric estimation of the z-score associated with the null hypothesis: (H0) 'contrast equals baseline' Parameters ========== baseline: float, optional, Baseline value for the test statistic """ if self.p_value_ == None or not self.baseline == baseline: self.p_value_ = self.p_value(baseline) # Avoid inf values kindly supplied by scipy. self.z_score_ = z_score(self.p_value_) return self.z_score_
def z_score(self, baseline=0.0): """Return a parametric estimation of the z-score associated with the null hypothesis: (H0) 'contrast equals baseline' Parameters ---------- baseline: float, optional Baseline value for the test statistic Notes ----- The value of 0 is used where the stat is not defined """ if self.p_value_ is None or not self.baseline == baseline: self.p_value_ = self.p_value(baseline) # Avoid inf values kindly supplied by scipy. self.z_score_ = z_score(self.p_value_) self.z_score_[np.isnan(self.stat_)] = 0 return self.z_score_