def try_to_update_cur_outcome(self):

        n1, m1, sd1, n2, m2, sd2 = self.ma_unit.get_raw_data_for_groups(self.cur_groups)
        se1, se2 = self._get_float(0, 3), self._get_float(1, 3)
        
        # here we check whether or not we have sufficient data to compute an outcome
        if not any([self.no_val(x) for x in [n1, m1, sd1, n2, m2, sd2 ]]) or \
                    not any([self.no_val(x) for x in [m1, se1, m2, se2]]) and self.cur_effect=="MD" or \
                    not any([self.no_val(x) for x in [n1, m1, sd1]]) and self.cur_effect in CONTINUOUS_ONE_ARM_METRICS:
            est_and_ci_d = None
            if self.cur_effect in CONTINUOUS_TWO_ARM_METRICS:
                est_and_ci_d = meta_py_r.continuous_effect_for_study(n1, m1, sd1, se1=se1, \
                                                        n2=n2, m2=m2, sd2=sd2, se2=se2,\
                                                        metric=self.cur_effect, conf_level=meta_py_r.get_global_conf_level())
            else:
                # continuous, one-arm metric
                est_and_ci_d = meta_py_r.continuous_effect_for_study(n1, m1, sd1, \
                                      two_arm=False, metric=self.cur_effect, conf_level=meta_py_r.get_global_conf_level())
            
            
            display_est, display_low, display_high = est_and_ci_d["display_scale"]
            self.ma_unit.set_display_effect_and_ci(self.cur_effect, self.group_str, display_est, display_low, display_high)                            
            
            est, low, high = est_and_ci_d["calc_scale"] # calculation (e.g., log) scale
            self.ma_unit.set_effect_and_ci(self.cur_effect, self.group_str, est, low, high)    
            self.set_current_effect()
    def try_to_update_cur_outcome(self):
        n1, m1, sd1, n2, m2, sd2 = self.ma_unit.get_raw_data_for_groups(
            self.cur_groups)
        se1, se2 = self._get_float(0, 3), self._get_float(1, 3)

        # here we check whether or not we have sufficient data to compute an outcome
        if not any([self.no_val(x) for x in [n1, m1, sd1, n2, m2, sd2 ]]) or \
                    not any([self.no_val(x) for x in [m1, se1, m2, se2]]) and self.cur_effect=="MD" or \
                    not any([self.no_val(x) for x in [n1, m1, sd1]]) and self.cur_effect in CONTINUOUS_ONE_ARM_METRICS:
            est_and_ci_d = None
            if self.cur_effect in CONTINUOUS_TWO_ARM_METRICS:
                est_and_ci_d = meta_py_r.continuous_effect_for_study(
                    n1,
                    m1,
                    sd1,
                    se1=se1,
                    n2=n2,
                    m2=m2,
                    sd2=sd2,
                    se2=se2,
                    metric=self.cur_effect,
                    conf_level=self.conf_level)
            else:
                # continuous, one-arm metric
                est_and_ci_d = meta_py_r.continuous_effect_for_study(
                    n1,
                    m1,
                    sd1,
                    two_arm=False,
                    metric=self.cur_effect,
                    conf_level=self.conf_level)

            est, low, high = est_and_ci_d[
                "calc_scale"]  # calculation (e.g., log) scale
            self.ma_unit.set_effect_and_ci(self.cur_effect,
                                           self.group_str,
                                           est,
                                           low,
                                           high,
                                           mult=self.mult)
            self.set_current_effect()
    def update_outcome_if_possible(self, study_index):
        """
        Checks the parametric study to ascertain if enough raw data has been
        entered to compute the outcome. If so, the outcome is computed and
        displayed.
        """
        est, lower, upper = None, None, None

        data_type = self.get_current_outcome_type(get_str=False)
        if self.raw_data_is_complete_for_study(study_index):
            if data_type == BINARY:
                e1, n1, e2, n2 = self.get_cur_raw_data_for_study(study_index)
                est, lower, upper = meta_py_r.effect_for_study(e1, n1, e2, n2)
            elif data_type == CONTINUOUS:
                n1, m1, se1, n2, m2, se2 = self.get_cur_raw_data_for_study(study_index)
                est, lower, upper = meta_py_r.continuous_effect_for_study(n1, m1, se1, n2, m2, se2)

        ma_unit = self.get_current_ma_unit_for_study(study_index)
        # now set the effect size & CIs
        ma_unit.set_effect_and_ci(self.current_effect, est, lower, upper)