Learn R Programming

fixest (version 0.5.1)

model.matrix.fixest: Design matrix of a femlm model

Description

This function creates a design matrix of the linear part of a femlm, feols or feglm estimation. Note that it is only the linear part. The fixed-effects variables (which can be considered as factors) are excluded from the matrix.

Usage

# S3 method for fixest
model.matrix(object, data, na.rm = TRUE, ...)

Arguments

object

A fixest object. Obtained using the functions femlm, feols or feglm.

data

If missing (default) then the original data is obtained by evaluating the call. Otherwise, it should be a data.frame.

na.rm

Default is TRUE. Should observations with NAs be removed from the matrix?

...

Not currently used.

Value

It returns a design matrix.

See Also

See also the main estimation functions femlm, feols or feglm. formula.fixest, update.fixest, summary.fixest, vcov.fixest.

Examples

Run this code
# NOT RUN {
# simple estimation on iris data, using "Species" fixed-effects
res = femlm(Sepal.Length ~ Sepal.Width*Petal.Length +
            Petal.Width | Species, iris)

head(model.matrix(res))



# }

Run the code above in your browser using DataLab