turnbull: Allow skipping computation of standard errors
This commit is contained in:
parent
793e6309cf
commit
434b432cf7
@ -66,6 +66,7 @@ enum OutputFormat {
|
||||
|
||||
#[derive(ValueEnum, Clone)]
|
||||
pub enum SEMethod {
|
||||
None,
|
||||
OIM,
|
||||
OIMDropZeros,
|
||||
LikelihoodRatio,
|
||||
@ -107,10 +108,8 @@ pub fn main(args: TurnbullArgs) {
|
||||
]);
|
||||
}
|
||||
summary.add_row(row![r->format!("{:.3}", result.failure_intervals.last().unwrap().1), r->"0.00000", "", "", ""]);
|
||||
} else {
|
||||
} else if let Some(survival_prob_ci) = &result.survival_prob_ci {
|
||||
// No standard errors, just print CIs
|
||||
let survival_prob_ci = result.survival_prob_ci.as_ref().unwrap();
|
||||
|
||||
summary.set_titles(row!["Time", c->"Surv. Prob.", H2c->"(95% CI)"]);
|
||||
summary.add_row(row![r->"0.000", r->"1.00000", "", ""]);
|
||||
for (i, prob) in result.survival_prob.iter().enumerate() {
|
||||
@ -122,6 +121,17 @@ pub fn main(args: TurnbullArgs) {
|
||||
]);
|
||||
}
|
||||
summary.add_row(row![r->format!("{:.3}", result.failure_intervals.last().unwrap().1), r->"0.00000", "", ""]);
|
||||
} else {
|
||||
// No standard errors or CIs
|
||||
summary.set_titles(row!["Time", c->"Surv. Prob."]);
|
||||
summary.add_row(row![r->"0.000", r->"1.00000"]);
|
||||
for (i, prob) in result.survival_prob.iter().enumerate() {
|
||||
summary.add_row(row![
|
||||
r->format!("{:.3}", result.failure_intervals[i].1),
|
||||
r->format!("{:.5}", prob),
|
||||
]);
|
||||
}
|
||||
summary.add_row(row![r->format!("{:.3}", result.failure_intervals.last().unwrap().1), r->"0.00000"]);
|
||||
}
|
||||
|
||||
summary.printstd();
|
||||
@ -218,6 +228,7 @@ pub fn fit_turnbull(data_times: Matrix2xX<f64>, progress_bar: ProgressBar, max_i
|
||||
let mut survival_prob_ci = None;
|
||||
|
||||
match se_method {
|
||||
SEMethod::None => {}
|
||||
SEMethod::OIM => {
|
||||
survival_prob_se = Some(survival_prob_oim_se(&data, &p, zero_tolerance, false));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user