R Under development (unstable) (2025-09-17 r88852 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(TransportHealth) Attaching package: 'TransportHealth' The following object is masked from 'package:base': trunc > > test_check("TransportHealth") Response: sysBloodPressure Treatment: med1 Effect type: meanDiff ATE estimate: -1.3623474319688 Standard error: 0.130495153980857 Fitted outcome model: Call: stats::glm(formula = outcomeModel, family = family, data = studyData, model = !wipe) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 99.55 0.46 218.6 <2e-16 *** med11 -4.79 0.08 -56.5 <2e-16 *** sex1 5.17 0.22 23.7 <2e-16 *** stress1 5.13 0.09 59.5 <2e-16 *** percentBodyFat 0.51 0.02 31.7 <2e-16 *** med21 0.05 0.14 0.4 0.7 med11:stress1 6.80 0.13 52.5 <2e-16 *** med11:med21 -4.78 0.22 -21.7 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for gaussian family taken to be 0.9934386) Null deviance: 24255.05 on 999 degrees of freedom Residual deviance: 985.49 on 992 degrees of freedom AIC: 2841 Number of Fisher Scoring iterations: 2 Response: sysBloodPressure Treatment: med1 Effect type: meanDiff ATE estimate: -1.70849816110969 Standard error: 0.141232257607355 Fitted outcome model: Call: glm(formula = sysBloodPressure ~ med1 + sex + stress + percentBodyFat + med2 + med1:stress + med1:med2, family = gaussian, data = testData$studyData) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 99.90 0.47 213.3 <2e-16 *** med11 -5.07 0.08 -59.8 <2e-16 *** sex1 5.03 0.22 22.8 <2e-16 *** stress1 4.95 0.08 59.3 <2e-16 *** percentBodyFat 0.51 0.02 30.6 <2e-16 *** med21 0.05 0.13 0.4 0.7 med11:stress1 6.90 0.13 52.6 <2e-16 *** med11:med21 -4.90 0.20 -24.0 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for gaussian family taken to be 0.9805509) Null deviance: 22487.97 on 999 degrees of freedom Residual deviance: 972.71 on 992 degrees of freedom AIC: 2828 Number of Fisher Scoring iterations: 2 Absolute SMDs of covariates between treatments before and after weighting: variable smd method sex sex 0.1606401760 Observed percentBodyFat percentBodyFat 0.1726372920 Observed stress stress 0.0564523292 Observed sex1 sex 0.0003958318 Weighted percentBodyFat1 percentBodyFat 0.0005609718 Weighted stress1 stress 0.0033677034 Weighted Absolute SMDs of effect modifiers between study and target populations before and after weighting: variable smd method stress stress 0.62376003 Observed med2 med2 0.57462556 Observed stress1 stress 0.02483355 Weighted med21 med2 0.04097303 Weighted MSM results: Call: stats::glm(formula = msmFormula, family = family, data = toAnalyze, weights = finalWeights) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 116.7 0.1 880 <2e-16 *** med11 -1.3 0.2 -6 1e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for gaussian family taken to be 67.78389) Null deviance: 68973 on 999 degrees of freedom Residual deviance: 67648 on 998 degrees of freedom AIC: 6314 Number of Fisher Scoring iterations: 2 Absolute SMDs of covariates between treatments before and after weighting: variable smd method sex sex 0.1606401760 Observed percentBodyFat percentBodyFat 0.1726372920 Observed stress stress 0.0564523292 Observed sex1 sex 0.0003958318 Weighted percentBodyFat1 percentBodyFat 0.0005609718 Weighted stress1 stress 0.0033677034 Weighted Absolute SMDs of effect modifiers between study and target populations before and after weighting: variable smd method stress stress 0.62376003 Observed med2 med2 0.57462556 Observed stress1 stress 0.02483355 Weighted med21 med2 0.04097303 Weighted MSM results: Call: stats::glm(formula = msmFormula, family = family, data = toAnalyze, weights = finalWeights) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 116.7 0.1 880 <2e-16 *** med11 -1.3 0.2 -6 1e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for gaussian family taken to be 67.78389) Null deviance: 68973 on 999 degrees of freedom Residual deviance: 67648 on 998 degrees of freedom AIC: 6314 Number of Fisher Scoring iterations: 2 Absolute SMDs of covariates between treatments before and after weighting: variable smd method sex sex 0.1606401760 Observed percentBodyFat percentBodyFat 0.1726372920 Observed stress stress 0.0564523292 Observed sex1 sex 0.0003958318 Weighted percentBodyFat1 percentBodyFat 0.0005609718 Weighted stress1 stress 0.0033677034 Weighted Absolute SMDs of effect modifiers between study and target populations before and after weighting: variable smd method stress stress 0.62376003 Observed med2 med2 0.57462556 Observed stress1 stress 0.02483355 Weighted med21 med2 0.04097303 Weighted MSM results: Call: stats::glm(formula = msmFormula, family = family, data = toAnalyze, weights = finalWeights) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 116.7 0.1 880 <2e-16 *** med11 -1.3 0.2 -6 1e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for gaussian family taken to be 67.78389) Null deviance: 68973 on 999 degrees of freedom Residual deviance: 67648 on 998 degrees of freedom AIC: 6314 Number of Fisher Scoring iterations: 2 Absolute SMDs of covariates between treatments before and after weighting: variable smd method sex sex 0.1606401760 Observed percentBodyFat percentBodyFat 0.1726372920 Observed stress stress 0.0564523292 Observed sex1 sex 0.0003958318 Weighted percentBodyFat1 percentBodyFat 0.0005609718 Weighted stress1 stress 0.0033677034 Weighted Absolute SMDs of effect modifiers between study and target populations before and after weighting: variable smd method stress stress 0.62376003 Observed med2 med2 0.57462556 Observed stress1 stress 0.02483355 Weighted med21 med2 0.04097303 Weighted MSM results: Call: stats::glm(formula = msmFormula, family = family, data = toAnalyze, weights = finalWeights) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 116.7 0.1 880 <2e-16 *** med11 -1.3 0.2 -6 1e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for gaussian family taken to be 67.78389) Null deviance: 68973 on 999 degrees of freedom Residual deviance: 67648 on 998 degrees of freedom AIC: 6314 Number of Fisher Scoring iterations: 2 Absolute SMDs of covariates between treatments before and after weighting: variable smd method sex sex 0.16064018 Observed percentBodyFat percentBodyFat 0.17263729 Observed stress stress 0.05645233 Observed sex1 sex 0.16064018 Weighted percentBodyFat1 percentBodyFat 0.17263729 Weighted stress1 stress 0.05645233 Weighted Absolute SMDs of effect modifiers between study and target populations before and after weighting: variable smd method stress stress 0.6237600 Observed med2 med2 0.5746256 Observed stress1 stress 0.6237600 Weighted med21 med2 0.5746256 Weighted MSM results: Call: stats::glm(formula = msmFormula, family = family, data = toAnalyze, weights = finalWeights) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 115.3 0.2 595 <2e-16 *** med11 -2.6 0.3 -9 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for gaussian family taken to be 21.70052) Null deviance: 23357 on 999 degrees of freedom Residual deviance: 21657 on 998 degrees of freedom AIC: 5919 Number of Fisher Scoring iterations: 2 Transported ATE: -4.18768913578803 Standard error: 0.302498144769392 Link function: identity Source study treatment effect: -2.97741445754012 Source study standard error: 0.292659815843048 Subgroup source treatment effects: effectModifier subgroup effect se 1 med2 1 -7.911545 0.2885836 2 med2 0 -2.424598 0.2839014 3 percentBodyFatDicho 1 -3.129429 0.2805072 4 percentBodyFatDicho 0 -2.348436 0.2988636 Source data summary: med2 percentBodyFatDicho 0.1 0.6 Target data summary: med2 percentBodyFatDicho 0.3 0.7 Transported ATE: -4.19884619553392 Standard error: 0.302722120269639 Link function: identity Source study treatment effect: -2.97741445754012 Source study standard error: 0.292659815843048 Subgroup source treatment effects: effectModifier subgroup effect se 1 med2 1 -7.911545 0.2885836 2 med2 0 -2.424598 0.2839014 3 percentBodyFatDicho 1 -3.129429 0.2805072 4 percentBodyFatDicho 0 -2.348436 0.2988636 Source data summary: med2 percentBodyFatDicho 0.1 0.6 Target data summary: med2 percentBodyFatDicho 0.3 0.7 Absolute SMDs of covariates between treatments before and after weighting: variable smd method sex sex 1.962425e-01 Observed percentBodyFat percentBodyFat 1.972612e-01 Observed stress stress 6.651088e-02 Observed sex1 sex 2.350506e-05 Weighted percentBodyFat1 percentBodyFat 1.552335e-04 Weighted stress1 stress 7.185717e-04 Weighted Aggregate level data summary of effect modifiers of interests before and after weighting: Effect Modifiers Study (N = 1000) Target (N = 1500) 1 MED2_PROP 0.088 0.315 2 PERCENTBODYFAT_MEAN 21.236 22.242 3 PERCENTBODYFAT_SD 6.827 5.976 4 SEX_PROP 0.523 0.315 5 STRESS_PROP 0.415 0.697 6 TOXICGRADE_LOW_PROP 0.716 0.436 7 TOXICGRADE_MEDIUM_PROP 0.141 0.363 Study (Post-Weighting) Pre Weighting Difference Post Weighting Difference 1 0.306 0.227 0.009 2 22.215 1.006 0.027 3 6.048 -0.851 -0.072 4 0.323 -0.208 -0.008 5 0.698 0.282 -0.001 6 0.432 -0.280 0.004 7 0.367 0.222 -0.004 MSM results: Call: stats::glm(formula = msmFormula, family = family, data = toAnalyze, weights = finalWeights) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 116.0 0.4 311 <2e-16 *** med11 -0.8 0.6 -1 0.2 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for gaussian family taken to be 13.19776) Null deviance: 13280 on 999 degrees of freedom Residual deviance: 13171 on 998 degrees of freedom AIC: 6686 Number of Fisher Scoring iterations: 2 Absolute SMDs of covariates between treatments before and after weighting: variable smd method sex sex 1.962425e-01 Observed percentBodyFat percentBodyFat 1.972612e-01 Observed stress stress 6.651088e-02 Observed sex1 sex 2.350506e-05 Weighted percentBodyFat1 percentBodyFat 1.552335e-04 Weighted stress1 stress 7.185717e-04 Weighted Aggregate level data summary of effect modifiers of interests before and after weighting: Effect Modifiers Study (N = 1000) Target (N = 1500) 1 MED2_PROP 0.088 0.315 2 PERCENTBODYFAT_MEAN 21.236 22.242 3 PERCENTBODYFAT_SD 6.827 5.976 4 SEX_PROP 0.523 0.315 5 STRESS_PROP 0.415 0.697 6 TOXICGRADE_LOW_PROP 0.716 0.436 7 TOXICGRADE_MEDIUM_PROP 0.141 0.363 Study (Post-Weighting) Pre Weighting Difference Post Weighting Difference 1 0.306 0.227 0.009 2 22.215 1.006 0.027 3 6.048 -0.851 -0.072 4 0.323 -0.208 -0.008 5 0.698 0.282 -0.001 6 0.432 -0.280 0.004 7 0.367 0.222 -0.004 MSM results: Call: stats::glm(formula = msmFormula, family = family, data = toAnalyze, weights = finalWeights) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 116.0 0.4 311 <2e-16 *** med11 -0.8 0.6 -1 0.2 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for gaussian family taken to be 13.19776) Null deviance: 13280 on 999 degrees of freedom Residual deviance: 13171 on 998 degrees of freedom AIC: 6686 Number of Fisher Scoring iterations: 2 Absolute SMDs of covariates between treatments before and after weighting: variable smd method sex sex 0.19624254 Observed percentBodyFat percentBodyFat 0.19726116 Observed stress stress 0.06651088 Observed sex1 sex 0.19624254 Weighted percentBodyFat1 percentBodyFat 0.19726116 Weighted stress1 stress 0.06651088 Weighted Aggregate level data summary of effect modifiers of interests before and after weighting: Effect Modifiers Study (N = 1000) Target (N = 1500) Study (Post-Weighting) 1 MED2_PROP 0.088 0.315 0.088 2 STRESS_PROP 0.415 0.697 0.415 Pre Weighting Difference Post Weighting Difference 1 0.227 0.227 2 0.282 0.282 MSM results: Call: stats::glm(formula = msmFormula, family = family, data = toAnalyze, weights = finalWeights) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 115.3 0.2 577 <2e-16 *** med11 -2.5 0.3 -8 7e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for gaussian family taken to be 22.50683) Null deviance: 23977 on 999 degrees of freedom Residual deviance: 22462 on 998 degrees of freedom AIC: 5956 Number of Fisher Scoring iterations: 2 [ FAIL 0 | WARN 44 | SKIP 0 | PASS 324 ] [ FAIL 0 | WARN 44 | SKIP 0 | PASS 324 ] > > proc.time() user system elapsed 982.71 51.93 1035.64