Learn R Programming

sampleSelection (version 0.6-2)

model.matrix.selection: Design Matrix of Selection Models

Description

Create design matrix of sample selection models

Usage

## S3 method for class 'selection':
model.matrix(object, part = "outcome", ... )

Arguments

object
object of class selection.
part
character string indication which design matrix/matrices to extract: "outcome" for the design matrix/matrices of the outcome equation(s) or "selection" for the design matrix of the selection equation.
...
further arguments passed to other methods (e.g. model.matrix.probit or model.matrix).

Value

  • If argument part is "selection", the design matrix of the selection equation is returned.

    If argument part is "outcome", the design matrix of the outcome equation of a tobit-2 model or a list that contains the design matrices of the (two) outcome equations of a tobit-5 model is returned. All values of observations (rows of the design matrix) that were not selected for estimating the corresponding outcome equation are set to NA.

See Also

selection, model.matrix, and model.matrix.probit