exogenous_fn {switchSelection} | R Documentation |
Modify exogenous variables in data frame
Description
Change some values of the exogenous variables in a data frame.
Usage
exogenous_fn(exogenous, newdata)
Arguments
exogenous |
list such that exogenous[[i]] represents the value
(or a vector of values of the same size as nrow(newdata) ) which will
be exogenously assigned to the variable names(exogenous)[[i]] in
newdata i.e., newdata[, names(exogenous)[i]] <- exogenous[[i]] .
If newdata is NULL and exogenous is not NULL then
newdata is set to object$data .
This argument is especially useful for causal inference when some endogenous
(dependent) variables should be exogenously assigned with some values i.e.,
in the right hand side of the formula and formula2 .
The purpose of the exogeneous argument is just a convenience so
equivalently it is possible to exogenously provide the values to variables
via newdata argument.
|
newdata |
data frame.
|
Details
This function changes exogenous
variables in newdata
.
Value
The function returns data frame which is similar to newdata
but some values of this data frame are set according to exogenous
.
[Package
switchSelection version 2.0.0
Index]