Learn R Programming

FENmlm (version 2.4.4)

update.femlm: Updates a femlm estimation

Description

Updates and re-estimates a femlm model. This function updates the formulas and use previous starting values to estimate a new femlm model. The data is obtained from the original call.

Usage

# S3 method for femlm
update(object, fml.update, ...)

Value

It returns a femlm object (see details in femlm.

Arguments

object

An object of class femlm. Typically the result of a femlm estimation.

fml.update

Changes to be made to the original argument fml. See more information on update.formula. You can add/withdraw both variables and clusters. E.g. . ~ . + x2 | . + z2 would add the variable x2 and the cluster z2 to the former estimation.

...

Other arguments to be passed to the function femlm.

Author

Laurent Berge

See Also

femlm, predict.femlm, summary.femlm, vcov.femlm, getFE.

Examples

Run this code

# Example using trade data
data(trade)

# main estimation
est_pois <- femlm(Euros ~ log(dist_km) | Origin + Destination, trade)

# we add the variable log(Year)
est_2 <- update(est_pois, . ~ . + log(Year))

# we add another cluster: "Product"
est_3 <- update(est_2, . ~ . | . + Product)

# we remove the cluster "Origin" and the variable log(dist_km)
est_4 <- update(est_3, . ~ . - log(dist_km) | . - Origin)

# Quick look at the 4 estimations
res2table(est_pois, est_2, est_3, est_4)

Run the code above in your browser using DataLab