Thank you for your guidance. Here is the Reprex for my problem:
library(miceadds)
#> Loading required package: mice
#>
#> Attaching package: 'mice'
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following objects are masked from 'package:base':
#>
#> cbind, rbind
#> * miceadds 3.11-6 (2021-01-21 11:48:47)
library(apaTables)
library(sjPlot)
#> Install package "strengejacke" from GitHub (`devtools::install_github("strengejacke/strengejacke")`) to load all sj-packages at once!
df_clean3 <- structure(list(InvestigationID = c("PE09001", "EA09001", "EQ09001",
"DP09001", "EQ09002"), YearOpen = c(2009L, 2009L, 2009L, 2009L,
2009L), Population = c(2500L, 754500L, 232L, 230517L, 53788L),
NoComplaintsReported = c(3L, 42L, 0L, 0L, 0L), NoCrashesFiresReported = c(1L,
18L, 0L, 0L, 0L), NoInjuryIncidentsReported = c(0L, 1L, 0L,
0L, 0L), NoInjuriesReported = c(0L, 1L, 0L, 0L, 0L), NoFatalityIncidentsReported = c(0L,
0L, 0L, 0L, 0L), NoFatalitiesReported = c(0L, NA, 0L, 0L,
0L), NoOtherFailuresReported = c(0L, 114L, 0L, 0L, 0L), recall = c(1L,
1L, 1L, 0L, 1L), label = structure(c(3L, 18L, 33L, 35L, 8L
), .Label = c("Arc", "Benz", "Blue", "BMW", "Braun", "Carrier",
"Caterpillar", "Chih", "Chrysler", "Coach", "Daimler", "Dorel",
"Flyer", "Ford", "General", "Harley", "Heil", "Honda", "Hyundai",
"Jaguar", "Jonway", "Kia", "Krawler", "Lippert", "Mack",
"Mazda", "Mitsubishi", "Navistar", "North", "Omni", "Paccar",
"Subaru", "Suburb", "Sutphen", "Toyota", "Volkswagen", "Volvo",
"Winnebago"), class = "factor")), row.names = c(1L, 2L, 3L,
14L, 17L), class = "data.frame")
model1 <- miceadds::glm.cluster(data=df_clean3, formula=recall ~ log(Population)+NoComplaintsReported+NoCrashesFiresReported+NoInjuriesReported+NoFatalityIncidentsReported+NoOtherFailuresReported+YearOpen+label, cluster="label", family="binomial")
apa.reg.table(model1)
#> Error in 2:last_model_number_predictors: argument of length 0
tab_df(model1, title="logistic regression", file="logit-test.doc")
#> Error in UseMethod("family"): no applicable method for 'family' applied to an object of class "NULL"
Created on 2022-03-28 by the reprex package (v2.0.1)