# Term names from Shipley SEM
m <- shipley.sem
xNam(m)
xNam(m, intercept = FALSE)
# Model with different types of predictor (some multi-coefficient terms)
d <- data.frame(
y = rnorm(100),
x1 = rnorm(100),
x2 = as.factor(rep(c("a", "b", "c", "d"), each = 25)),
x3 = rep(1, 100)
)
m <- lm(y ~ poly(x1, 2) + x2 + x3, data = d)
xNam(m)
xNam(m, aliased = FALSE) # drop term that cannot be estimated (x3)
xNam(m, aliased = FALSE, list = TRUE) # names as list
Run the code above in your browser using DataLab