Determine Type of Regression Discontinuity Design
rd_type.Rd
rd_type
cross-tabulates observations based on (1) a binary treatment and
(2) one or two assignments and their cutoff values.
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:::rd_type().
Usage
rd_type(
data,
treat,
assign_1,
cutoff_1,
operator_1 = NULL,
assign_2 = NULL,
cutoff_2 = NULL,
operator_2 = NULL
)
Arguments
- data
A
data.frame
, with each row representing an observation.- treat
A string specifying the name of the numeric treatment variable (treated = positive values).
- assign_1
A string specifying the variable name of the primary assignment.
- cutoff_1
A numeric value containing the cutpoint at which assignment to the treatment is determined, for the primary assignment.
- operator_1
The operator specifying the treatment option according to design for the primary assignment. Options are
"g"
(treatment is assigned ifx1
is greater than its cutoff),"geq"
(treatment is assigned ifx1
is greater than or equal to its cutoff),"l"
(treatment is assigned ifx1
is less than its cutoff), and"leq"
(treatment is assigned ifx1
is less than or equal to its cutoff).- assign_2
An optional string specifying the variable name of the secondary assignment.
- cutoff_2
An optional numeric value containing the cutpoint at which assignment to the treatment is determined, for the secondary assignment.
- operator_2
The operator specifying the treatment option according to design for the secondary assignment. Options are
"g"
(treatment is assigned ifx2
is greater than its cutoff),"geq"
(treatment is assigned ifx2
is greater than or equal to its cutoff),"l"
(treatment is assigned ifx2
is less than its cutoff), and"leq"
(treatment is assigned ifx2
is less than or equal to its cutoff).
Value
rd_type
returns a list of two elements:
- crosstab
The cross-table as a data.frame. Columns in the dataframe include treatment rules, number of observations in the control condition, number of observations in the treatment condition, and the probability of an observation being in treatment or control.
- type
A string specifying the type of design used, either
"SHARP"
or"FUZZY"
.