pub struct Dataset<'a> {
pub y: &'a [f64],
pub x: &'a [f64],
pub t: Option<&'a [f64]>,
pub z: Option<&'a [f64]>,
pub dz: usize,
pub cluster: Option<&'a [f64]>,
pub weights: Option<&'a [f64]>,
}Expand description
One dataset in a batch: sharp design when t is None, fuzzy otherwise.
A Dataset carries everything a single crate::rdrobust::rdrobust_with call
needs from the data side (the per-fit knobs live in the shared
RdRobustOptions), so a batch fit is a true repeated rdrobust.
Fields§
§y: &'a [f64]Outcome variable, one value per observation.
x: &'a [f64]Running (forcing) variable. For nearest-neighbor vce, must be sorted ascending.
t: Option<&'a [f64]>Treatment-status variable for a fuzzy design; None runs a sharp design.
z: Option<&'a [f64]>Covariates flattened row-major as n x dz; None runs without covariate adjustment.
dz: usizeNumber of covariate columns in z (0 when z is None).
cluster: Option<&'a [f64]>Cluster ids; presence remaps the variance estimator to its cluster-robust form. None for no clustering.
weights: Option<&'a [f64]>User weights multiplying the kernel; None for an unweighted fit.
Auto Trait Implementations§
impl<'a> Freeze for Dataset<'a>
impl<'a> RefUnwindSafe for Dataset<'a>
impl<'a> Send for Dataset<'a>
impl<'a> Sync for Dataset<'a>
impl<'a> Unpin for Dataset<'a>
impl<'a> UnsafeUnpin for Dataset<'a>
impl<'a> UnwindSafe for Dataset<'a>
Blanket Implementations§
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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.