Search code examples
rdata-sciencedata-visualizationsjplot

R sjPlot error message: Error in sjt.lm(fit1, fit2) : could not find function "sjt.lm"


I want the summary output of my linear regression models neatly presented.

The HTML tables in this tutorial https://www.r-bloggers.com/2015/03/beautiful-tables-for-linear-model-summaries-rstats/ is exactly what I want.

The problem's that when I try to run the example code from the tutorial, I get an error message: Error in sjt.lm(fit1, fit2) : could not find function "sjt.lm"

Thanks for any help!

library(sjPlot)
library(sjmisc)
library(sjlabelled)
data(efc)
efc <- set_var_labels(efc, get_var_labels(efc))
fit1 <- lm(barthtot ~ c160age + c12hour + c161sex + c172code, data=efc)
fit2 <- lm(neg_c_7 ~ c160age + c12hour + c161sex + c172code, data=efc)
sjt.lm(fit1, fit2)

Solution

  • This package has been updated since 2005. The new plot functionality is plot_model(). See website for more info: https://strengejacke.github.io/sjPlot/index.html