Running examples in ‘sjstats-Ex.R’ failed
The error most likely occurred in:

> ### Name: check_assumptions
> ### Title: Check model assumptions
> ### Aliases: check_assumptions outliers heteroskedastic autocorrelation
> ###   normality multicollin
> 
> ### ** Examples
> 
> data(efc)
> 
> fit <- lm(barthtot ~ c160age + c12hour + c161sex + c172code, data = efc)
> outliers(fit)
No outliers detected.
> heteroskedastic(fit)
Heteroscedasticity (non-constant error variance) detected: p = 0.000
# A tibble: 1 x 1
  heteroskedastic
            <dbl>
1    3.885808e-07
> autocorrelation(fit)
Autocorrelated residuals detected: p = 0.000
# A tibble: 1 x 1
  autocorrelation
            <dbl>
1               0
> normality(fit)
Non-normality of residuals detected: p = 0.000
# A tibble: 1 x 1
  non.normality
          <dbl>
1  1.535796e-13
> check_assumptions(fit)
# A tibble: 1 x 4
  heteroskedasticity multicollinearity non.normal.resid autocorrelation
               <dbl>             <lgl>            <dbl>           <dbl>
1       3.885808e-07             FALSE     1.535796e-13               0
> 
> fit <- lm(barthtot ~ c160age + c12hour + c161sex + c172code + neg_c_7,
+           data = efc)
> outliers(fit)
2 outliers removed in updated model.
# A tibble: 2 x 3
    models adjusted.r2      aic
     <chr>       <dbl>    <dbl>
1 original   0.3458095 7487.639
2  updated   0.3530485 7468.980
> check_assumptions(fit, as.logical = TRUE)
# A tibble: 1 x 4
  heteroskedasticity multicollinearity non.normal.resid autocorrelation
               <lgl>             <lgl>            <lgl>           <lgl>
1               TRUE             FALSE             TRUE            TRUE
> 
> # apply function to multiple models in list-variable
> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> tmp <- efc %>%
+   bootstrap(50) %>%
+   mutate(models = lapply(.$strap, function(x) {
+     lm(neg_c_7 ~ e42dep + c12hour + c161sex, data = x)
+   }))
> 
> # for list-variables, argument 'model.column' is the
> # quoted name of the list-variable with fitted models
> tmp %>% heteroskedastic("models")
Error in eval(data, envir = environment(formula(model))) : 
  object 'x' not found
Calls: %>% ... .Call -> .f -> <Anonymous> -> ncvTest.lm -> eval -> eval
Execution halted