model.matrix.fixest {fixest} | R Documentation

## 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 and the cluster variables (which can be considered as factors) are excluded from the matrix.

### Usage

    ## S3 method for class 'fixest'
    model.matrix(object, data, ...)

### 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`.
`...` | Not currently used.

### Value

It returns a design matrix.

### Author(s)

Laurent Berge

### See Also

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

### Examples

    # simple estimation on iris data, clustering by "Species"
    res = femlm(Sepal.Length ~ Sepal.Width*Petal.Length +
                Petal.Width | Species, iris)

    head(model.matrix(res))

[Package fixest version 0.1.0 Index]