R Under development (unstable) (2025-07-25 r88451 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview > # * https://testthat.r-lib.org/articles/special-files.html > > library(testthat) > library(gtregression) > > test_check("gtregression") Attaching package: 'dplyr' The following object is masked from 'package:testthat': matches The following objects are masked from 'package:stats': filter, lag The following objects are masked from 'package:base': intersect, setdiff, setequal, union # A tibble: 18 x 6 Variable Type `Missing (%)` Unique Levels Compatibility 1 pregnant numeric 0% 17 - compatible 2 glucose numeric 0.7% 135 - compatible 3 pressure numeric 4.6% 46 - compatible 4 triceps numeric 29.6% 50 - compatible 5 insulin numeric 48.7% 185 - compatible 6 mass numeric 1.4% 247 - compatible 7 pedigree numeric 0% 517 - compatible 8 age numeric 0% 52 - compatible 9 diabetes numeric 0% 2 - maybe 10 bmi factor 1.4% 3 Normal, Overweight, ~ compatible 11 age_cat factor 0% 3 Young, Middle-aged, ~ compatible 12 npreg_cat factor 0% 2 Low parity, High par~ compatible 13 glucose_cat factor 0.7% 2 Normal, High compatible 14 bp_cat factor 4.6% 2 Normal, High compatible 15 triceps_cat factor 29.6% 2 Normal, High compatible 16 insulin_cat factor 48.7% 3 Low, Normal, High compatible 17 dpf_cat factor 0% 3 Low Genetic Risk, Mo~ compatible 18 diabetes_cat factor 0% 2 Diabetes negative, D~ compatible Interpretation notes: - compatible: ready to use in regression - maybe: require transformation to factor or check no of levels - incompatible: not usable as-is (e.g., all NA, <2 levels) ------------------------------------------------------------ Crude Estimate: 2.961 Adjusted Estimate: 2.496 % Change from Crude: 15.69 % ------------------------------------------------------------ Confounding: Yes ------------------------------------------------------------ Notes: * Confounding is suggested if percent change >= 10 %. * This method does not assess effect modification. * Use DAGs or domain knowledge to support confounder identification. # A tibble: 4 x 5 covariate crude_est adjusted_est pct_change is_confounder 1 bmi 2.96 2.50 15.7 TRUE 2 age_cat 2.96 2.62 11.5 TRUE 3 npreg_cat 2.96 2.78 6.07 FALSE 4 bp_cat 2.96 NA NA NA Notes: * Confounding is suggested if percent change >= 10 %. * This method does not assess effect modification. * Use DAGs or domain knowledge to support confounder identification. ------------------------------------------------------------ Crude Estimate: 2.961 Adjusted Estimate: NA % Change from Crude: NA % ------------------------------------------------------------ Confounding: NA ------------------------------------------------------------ Notes: * Confounding is suggested if percent change >= 10 %. * This method does not assess effect modification. * Use DAGs or domain knowledge to support confounder identification. # A tibble: 4 x 5 covariate crude_est adjusted_est pct_change is_confounder 1 bmi 2.96 NA NA NA 2 age_cat 2.96 NA NA NA 3 npreg_cat 2.96 NA NA NA 4 bp_cat 2.96 NA NA NA Notes: * Confounding is suggested if percent change >= 10 %. * This method does not assess effect modification. * Use DAGs or domain knowledge to support confounder identification. # A tibble: 3 x 5 covariate crude_est adjusted_est pct_change is_confounder 1 Eth 1.18 1.24 4.98 FALSE 2 Age 1.18 1.01 14.5 TRUE 3 Lrn 1.18 1.21 2.37 FALSE Notes: * Confounding is suggested if percent change >= 10 %. * This method does not assess effect modification. * Use DAGs or domain knowledge to support confounder identification. --------------------------------------------------- Interaction Term Assessment using Likelihood Ratio Test Model without interaction: diabetes ~ age_cat + glucose_cat Model with interaction: diabetes ~ age_cat + glucose_cat + age_cat:glucose_cat ----------------------------------------------------- P-value: 0.1741 Interaction is not statistically significant. Simpler model may be preferred. ---------------------------------------------------- --------------------------------------------------- Interaction Term Assessment using Likelihood Ratio Test Model without interaction: diabetes ~ age_cat + glucose_cat Model with interaction: diabetes ~ age_cat + glucose_cat + age_cat:glucose_cat ----------------------------------------------------- P-value: 0.0100 Interaction is statistically significant. Consider including it. ---------------------------------------------------- Attaching package: 'gtsummary' The following object is masked from 'package:testthat': matches robpoisson: Implausible predicted probability >0.99999 occurred: 1.20967417078353 robpoisson: Implausible predicted probability >0.99999 occurred: 1.27352337518945 Table saved as: 'regression_results.docx' in the working directory. Plot saved as: 'plot_png.png' in the working directory. Plot saved as: 'plot_pdf.pdf' in the working directory. Plot saved as: 'plot_jpg.jpg' in the working directory. Word document saved as: 'final_report.docx' in the working directory. If tables or plots extend beyond the page, consider switching to landscape layout in Word (Layout > Orientation > Landscape). Attaching package: 'MASS' The following object is masked from 'package:gtsummary': select The following object is masked from 'package:dplyr': select Running stratified multivariable regression by: glucose_cat > Stratum: glucose_cat = High > Stratum: glucose_cat = Normal Running stratified multivariable regression by: glucose_cat > Stratum: glucose_cat = Normal > Stratum: glucose_cat = High Running stratified multivariable regression by: glucose_cat > Stratum: glucose_cat = High > Stratum: glucose_cat = Normal Running stratified multivariable regression by: glucose_cat > Stratum: glucose_cat = High x There was an error calling `tidy_fun()`. Most likely, this is because the function supplied in `tidy_fun=` was misspelled, does not exist, is not compatible with your object, or was missing necessary arguments (e.g. `conf.level=` or `conf.int=`). See error message below. > Stratum: glucose_cat = Normal Running stratified univariate regression by: glucose_cat > Stratum: glucose_cat = High > Stratum: glucose_cat = Normal Running stratified univariate regression by: glucose_cat > Stratum: glucose_cat = Normal > Stratum: glucose_cat = High Running stratified univariate regression by: glucose_cat > Stratum: glucose_cat = High > Stratum: glucose_cat = Normal Running stratified univariate regression by: age_cat > Stratum: age_cat = Older > Stratum: age_cat = Middle-aged > Stratum: age_cat = Young Running stratified univariate regression by: glucose_cat Call: glm(formula = formula, family = binomial("logit"), data = data) Coefficients: (Intercept) glucose -6.09552 0.04242 Degrees of Freedom: 391 Total (i.e. Null); 390 Residual Null Deviance: 498.1 Residual Deviance: 386.7 AIC: 390.7 [ FAIL 0 | WARN 2 | SKIP 2 | PASS 242 ] ══ Skipped tests (2) ═══════════════════════════════════════════════════════════ • On CRAN (2): 'test-dissect.R:73:3', 'test-multi_reg.R:62:7' [ FAIL 0 | WARN 2 | SKIP 2 | PASS 242 ] > > proc.time() user system elapsed 140.48 3.09 143.87