tw_model: Fit Panel Data Given Simulated Data

View source: R/twsim2.R

tw_modelR Documentation

Fit Panel Data Given Simulated Data

Description

This function will take the result of data generated by the tw_data function and fit panel data models using the plm model-fitting function. Available models include standard fixed effects models (1-way and 2-way), random effects models and pooled OLS.

Usage

tw_model(gendata, models = c("randomfx", "wfe"), binary_outcome = FALSE)

Arguments

gendata

A data frame of simulated panel data procued by tw_data

models

Whether to include random effects estimates in the returned data frame (defaults to true).

Value

The function returns a data.frame with the coefficients of all of the requested models (includes 1-way and 2-way FE models by default).

Examples


## Not run: 
# generate panel data
gendata <- tw_data()
# estimate panel models
estimates <- tw_model(gendata)

## End(Not run)



saudiwin/twofe_sim documentation built on Feb. 6, 2024, 11:31 a.m.