Skip to main content

RdRobustOptions

Struct RdRobustOptions 

Source
pub struct RdRobustOptions {
Show 20 fields pub c: f64, pub p: usize, pub q: usize, pub deriv: usize, pub kernel: Kernel, pub vce: Vce, pub nnmatch: usize, pub covs_drop_coll: bool, pub scaleregul: f64, pub scalepar: f64, pub level: f64, pub bwselect: &'static str, pub masspoints: &'static str, pub stdvars: bool, pub bwrestrict: bool, pub bwcheck: Option<usize>, pub rho: Option<f64>, pub sharpbw: bool, pub h: Option<(f64, f64)>, pub b: Option<(f64, f64)>,
}
Expand description

Scalar/config options for rdrobust_with, a typed alternative to the raw rdrobust positional arguments. The data inputs (y, x, fuzzy, covs, dz, cluster, weights) stay separate; this struct carries everything else.

Default matches the R/Python wrapper defaults, so RdRobustOptions { p: 2, q: 3, ..Default::default() } overrides one knob and leaves the rest at their R defaults. Each field forwards to the matching positional argument of rdrobust; see that function for the per-argument semantics.

Fields§

§c: f64

RD cutoff on the running variable (R c, default 0).

§p: usize

Polynomial order for the point estimate (R p, default 1).

§q: usize

Polynomial order for the bias correction; must exceed p (R q, default 2).

§deriv: usize

Derivative order of the estimand: 0 = level, 1 = kink (R deriv, default 0).

§kernel: Kernel

Kernel for the local-polynomial weights (R kernel, default triangular).

§vce: Vce

Variance estimator before any cluster remap (R vce, default nn).

§nnmatch: usize

Minimum neighbors for vce = nn (R nnmatch, default 3).

§covs_drop_coll: bool

Drop collinear covariates in the FWL partialling (R covs_drop, default false here).

§scaleregul: f64

Regularization scale in bandwidth selection; 0 removes it (R scaleregul, default 1).

§scalepar: f64

Scaling applied to the RD parameter (R scalepar, default 1).

§level: f64

Confidence-interval level in percent, e.g. 95 (R level, default 95).

§bwselect: &'static str

Bandwidth-selection method when h is None, e.g. "mserd" (R bwselect, default “mserd”).

§masspoints: &'static str

Mass-point handling: "off", "check", or "adjust" (R masspoints, default “adjust”).

§stdvars: bool

Standardize x and y before bandwidth selection (R stdvars, default true).

§bwrestrict: bool

Clamp selected bandwidths to the range of x (R bwrestrict, default true).

§bwcheck: Option<usize>

Minimum unique observations in the pilot bandwidth; None skips the check (R bwcheck, default NULL).

§rho: Option<f64>

Sets b = h / rho; None leaves b from b/selection (R rho, default NULL).

§sharpbw: bool

Force sharp-RD bandwidth selection in a fuzzy design (R sharpbw, default false).

§h: Option<(f64, f64)>

Main bandwidths (left, right); None triggers selection (R h, default NULL).

§b: Option<(f64, f64)>

Bias bandwidths (left, right); None defaults to h (or h / rho) (R b, default NULL).

Trait Implementations§

Source§

impl Clone for RdRobustOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RdRobustOptions

Source§

impl Debug for RdRobustOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RdRobustOptions

Source§

fn default() -> Self

R/Python wrapper defaults: c=0, p=1, q=2, deriv=0, triangular kernel, nn variance, nnmatch=3, scaleregul=1, scalepar=1, level=95, bwselect="mserd", masspoints="adjust", stdvars/bwrestrict on, and the remaining knobs off/unset.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.