Hi, I don't understand why the following codes generate error message:
And the error is:
I checked the length of each variable, which is all the same. Each fitted model works without any issue, but `export_summs()` seems to generate a problem. Is there any mistake in my code?
Thanks for help.
Code:
library(wooldridge)
library(jtools)
library(huxtable)
data('card')
fit1 <- lm(card$educ~card$nearc4)
fit2 <- lm(card$educ~card$nearc4 + card$motheduc + card$fatheduc)
fit3 <- lm(card$lwage~card$nearc4)
if (requireNamespace("huxtable")) {
# Export all 3 regressions with "Model #" labels,
# standardized coefficients, and robust standard errors
export_summs(fit1, fit2, fit3,
model.names = c("Model 1","Model 2","Model 3"),
scale = TRUE, robust = TRUE)
}
Code:
Error in model.frame.default(formula = card$educ ~ `card$nearc4` + `card$motheduc` + : variable lengths differ (found for 'card$nearc4')
Thanks for help.

Comment