var_center
computes the univariate assignment variable X based on the cutoffs of
This is an internal function and is typically not directly invoked by the user.
It can be accessed using the triple colon, as in rddapp:::var_center().
var_center(x, cut = c(0, 0), t.design = NULL, t.plot = FALSE)
Data frame or matrix of two assignment variables, where the 1st column is X1, the 2nd column is X2
Cutoffs of two assignment variables X1, X2.
The treatment option according to design.
The 1st entry is for x1: "g"
means treatment is assigned
if x1 is greater than its cutoff, "geq"
means treatment is assigned
if x1 is greater than or equal to its cutoff, "l"
means treatment is assigned
if x1 is less than its cutoff, "leq"
means treatment is assigned
if x1 is less than or equal to its cutoff.
The 2nd entry is for x2.
Whether calculate the univariate treatment variable T and make a plot
var_center
returns the univariate assignment variable as a vector
according to the design.