Learn R Programming

itsadug (version 2.0)

diff_terms: Compare the formulas of two models and return the difference(s).

Description

Compare the formulas of two models and return the difference(s).

Usage

diff_terms(model1, model2)

Arguments

model1
A fitted regression model (using lm, glm, gam, or bam).
model2
A fitted regression model (using lm, glm, gam, or bam).

Value

  • A list with model terms that are not shared by both models.

See Also

Other Utility functions: convertNonAlphanumeric, findAbsMin, find_difference, find_n_neighbors, getDec, getRange, group_sort, list2str, missing_est, move_n_point, print_summary, se, summary_data, timeBins

Examples

Run this code
data(simdat)

# Fit simple GAM model:
gam1 <- bam(Y ~ s(Time), data=simdat)
gam2 <- bam(Y ~ Group+s(Time), data=simdat)
diff_terms(gam1, gam2)

Run the code above in your browser using DataLab