Skip to contents

Simply extracts the weights used to estimate a fixest model.

Usage

# S3 method for fixest
weights(object, ...)

Arguments

object

A fixest object.

...

Not currently used.

Value

Returns a vector of the same length as the number of observations in the original data set. Ignored observations due to NA or perfect fit are re-introduced and their weights set to NA.

See also

Examples


est = feols(Petal.Length ~ Petal.Width, iris, weights = ~as.integer(Sepal.Length) - 3.99)
weights(est)
#>   [1] 1.01 0.01 0.01 0.01 1.01 1.01 0.01 1.01 0.01 0.01 1.01 0.01 0.01 0.01 1.01
#>  [16] 1.01 1.01 1.01 1.01 1.01 1.01 1.01 0.01 1.01 0.01 1.01 1.01 1.01 1.01 0.01
#>  [31] 0.01 1.01 1.01 1.01 0.01 1.01 1.01 0.01 0.01 1.01 1.01 0.01 0.01 1.01 1.01
#>  [46] 0.01 1.01 0.01 1.01 1.01 3.01 2.01 2.01 1.01 2.01 1.01 2.01 0.01 2.01 1.01
#>  [61] 1.01 1.01 2.01 2.01 1.01 2.01 1.01 1.01 2.01 1.01 1.01 2.01 2.01 2.01 2.01
#>  [76] 2.01 2.01 2.01 2.01 1.01 1.01 1.01 1.01 2.01 1.01 2.01 2.01 2.01 1.01 1.01
#>  [91] 1.01 2.01 1.01 1.01 1.01 1.01 1.01 2.01 1.01 1.01 2.01 1.01 3.01 2.01 2.01
#> [106] 3.01 0.01 3.01 2.01 3.01 2.01 2.01 2.01 1.01 1.01 2.01 2.01 3.01 3.01 2.01
#> [121] 2.01 1.01 3.01 2.01 2.01 3.01 2.01 2.01 2.01 3.01 3.01 3.01 2.01 2.01 2.01
#> [136] 3.01 2.01 2.01 2.01 2.01 2.01 2.01 1.01 2.01 2.01 2.01 2.01 2.01 2.01 1.01