Learn R Programming

speccurvieR (version 0.4.2)

controlExtractor: Extracts the control variable names and coefficients from an lm model summary.

Description

Extracts the control variable names and coefficients from a model summary.

Usage

controlExtractor(model, x, feols_model = F)

Value

A dataframe with two columns, `term` contains the name of the control and `coef` contains the coefficient estimate.

Arguments

model

A model summary object.

x

A string containing the independent variable name.

feols_model

An indicator for whether `model` is a `fixest::feols()` model. Defaults to `FALSE`.

Examples

Run this code
m <- summary(lm(Salnty ~ STheta + T_degC, bottles))
controlExtractor(model = m, x = "STheta");

m <- summary(lm(Salnty ~ STheta*T_degC + O2Sat, bottles))
controlExtractor(model = m, x = "STheta");

Run the code above in your browser using DataLab