pub struct EValue {
pub threshold: f64,
}Expand description
E-value for the point estimate: the minimum strength of association, on the risk-ratio scale, that an unmeasured confounder would need with both treatment and outcome to fully explain away the observed effect.
For continuous outcomes this uses the VanderWeele/Ding approximate conversion of the
standardized mean difference d = ATE / SD(Y) to a risk ratio via RR = exp(0.91 d),
then the standard E-value formula E = RR + sqrt(RR (RR − 1)) (inverted first if RR < 1).
Fields§
§threshold: f64Pass if the computed E-value is at least this large.
Default DEFAULT_EVALUE_THRESHOLD (2.0) marks moderate robustness. Override via
EValue::with_threshold when a different convention is needed; the E-value itself
is always reported in RefutationReport::comparison regardless of the gate.
Implementations§
Source§impl EValue
impl EValue
Sourcepub fn new() -> Self
pub fn new() -> Self
Default threshold DEFAULT_EVALUE_THRESHOLD (2.0 ≈ moderate robustness).
Sourcepub fn with_threshold(threshold: f64) -> Self
pub fn with_threshold(threshold: f64) -> Self
Explicit pass threshold (for report-only use, set threshold = 0.0 or ignore
passed and read RefutationReport::comparison).
Sourcepub fn refute(
&self,
problem: &RefutationProblem<'_>,
) -> Result<RefutationReport, ValidationError>
pub fn refute( &self, problem: &RefutationProblem<'_>, ) -> Result<RefutationReport, ValidationError>
Compute the E-value for problem.original.ate.
§Errors
The outcome has fewer than 2 valid rows or zero variance.
Trait Implementations§
Source§impl<'a> Validator<RefutationProblem<'a>> for EValue
impl<'a> Validator<RefutationProblem<'a>> for EValue
Source§type Prepared = PreparedRefutation<'a>
type Prepared = PreparedRefutation<'a>
Self::prepare.Source§type Report = RefutationReport
type Report = RefutationReport
Self::validate.Source§fn prepare(
&self,
artifact: &RefutationProblem<'a>,
_ctx: &ExecutionContext,
) -> Result<Self::Prepared, ValidationError>
fn prepare( &self, artifact: &RefutationProblem<'a>, _ctx: &ExecutionContext, ) -> Result<Self::Prepared, ValidationError>
artifact into a reusable prepared form. Read moreSource§fn validate(
&self,
prepared: &mut Self::Prepared,
_workspace: &mut EstimationWorkspace,
_ctx: &ExecutionContext,
) -> Result<Self::Report, ValidationError>
fn validate( &self, prepared: &mut Self::Prepared, _workspace: &mut EstimationWorkspace, _ctx: &ExecutionContext, ) -> Result<Self::Report, ValidationError>
Auto Trait Implementations§
impl Freeze for EValue
impl RefUnwindSafe for EValue
impl Send for EValue
impl Sync for EValue
impl Unpin for EValue
impl UnsafeUnpin for EValue
impl UnwindSafe for EValue
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> ForeignBufferOwner for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more