sparse_model_matrix | R Documentation |
fixest
object returned in sparse formatThis function creates the left-hand-side or the right-hand-side(s) of a femlm
, feols
or feglm
estimation. Note that this function currently does not accept a formula
sparse_model_matrix(
object,
data,
type = "rhs",
na.rm = TRUE,
collin.rm = TRUE,
combine = TRUE,
...
)
object |
A |
data |
If missing (default) then the original data is obtained by evaluating the |
type |
Character vector or one sided formula, default is "rhs". Contains the type of matrix/data.frame to be returned. Possible values are: "lhs", "rhs", "fixef", "iv.rhs1" (1st stage RHS), "iv.rhs2" (2nd stage RHS), "iv.endo" (endogenous vars.), "iv.exo" (exogenous vars), "iv.inst" (instruments). |
na.rm |
Default is |
collin.rm |
Logical scalar, default is |
combine |
Logical scalar, default is |
... |
Not currently used. |
It returns either a single sparse matrix a list of matrices, depending whether combine
is TRUE
or FALSE
. The sparse matrix is of class dgCMatrix
from the Matrix
package.
Laurent Berge, Kyle Butts
See also the main estimation functions femlm
, feols
or feglm
. formula.fixest
, update.fixest
, summary.fixest
, vcov.fixest
.
est = feols(wt ~ i(vs) + hp | cyl, mtcars)
sparse_model_matrix(est)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.