summary.regmedint
R/08_regmedint_class_user_methods.R
print.summary_regmedint.Rd
Print results contained in a summary_regmedint
object with additional explanation regarding the evaluation settings.
# S3 method for summary_regmedint
print(x, ...)
An object of the class summary_regmedint
.
For compatibility with the generic function.
Invisibly return the first argument.
library(regmedint)
data(vv2015)
regmedint_obj <- regmedint(data = vv2015,
## Variables
yvar = "y",
avar = "x",
mvar = "m",
cvar = c("c"),
eventvar = "event",
## Values at which effects are evaluated
a0 = 0,
a1 = 1,
m_cde = 1,
c_cond = 0.5,
## Model types
mreg = "logistic",
yreg = "survAFT_weibull",
## Additional specification
interaction = TRUE,
casecontrol = FALSE)
## Implicit printing
summary(regmedint_obj)
#> ### Mediator model
#>
#> Call:
#> glm(formula = m ~ x + c, family = binomial(link = "logit"), data = data)
#>
#> Deviance Residuals:
#> Min 1Q Median 3Q Max
#> -1.5143 -1.1765 0.9177 1.1133 1.4602
#>
#> Coefficients:
#> Estimate Std. Error z value Pr(>|z|)
#> (Intercept) -0.3545 0.3252 -1.090 0.276
#> x 0.3842 0.4165 0.922 0.356
#> c 0.2694 0.2058 1.309 0.191
#>
#> (Dispersion parameter for binomial family taken to be 1)
#>
#> Null deviance: 138.59 on 99 degrees of freedom
#> Residual deviance: 136.08 on 97 degrees of freedom
#> AIC: 142.08
#>
#> Number of Fisher Scoring iterations: 4
#>
#> ### Outcome model
#>
#> Call:
#> survival::survreg(formula = Surv(y, event) ~ x + m + x:m + c,
#> data = data, dist = "weibull")
#> Value Std. Error z p
#> (Intercept) -1.0424 0.1903 -5.48 4.3e-08
#> x 0.4408 0.3008 1.47 0.14
#> m 0.0905 0.2683 0.34 0.74
#> c -0.0669 0.0915 -0.73 0.46
#> x:m 0.1003 0.4207 0.24 0.81
#> Log(scale) -0.0347 0.0810 -0.43 0.67
#>
#> Scale= 0.966
#>
#> Weibull distribution
#> Loglik(model)= -11.4 Loglik(intercept only)= -14.5
#> Chisq= 6.31 on 4 degrees of freedom, p= 0.18
#> Number of Newton-Raphson Iterations: 5
#> n= 100
#>
#> ### Mediation analysis
#> est se Z p lower upper
#> cde 0.541070807 0.29422958 1.8389409 0.06592388 -0.03560858 1.11775019
#> pnde 0.488930417 0.21049248 2.3227928 0.02019028 0.07637274 0.90148809
#> tnie 0.018240025 0.03706111 0.4921608 0.62260566 -0.05439841 0.09087846
#> tnde 0.498503455 0.21209540 2.3503737 0.01875457 0.08280410 0.91420281
#> pnie 0.008666987 0.02730994 0.3173565 0.75097309 -0.04485951 0.06219348
#> te 0.507170442 0.21090051 2.4047853 0.01618197 0.09381303 0.92052785
#> pm 0.045436278 0.09119614 0.4982259 0.61832484 -0.13330488 0.22417743
#>
#> Evaluated at:
#> avar: x
#> a1 (intervened value of avar) = 1
#> a0 (reference value of avar) = 0
#> mvar: m
#> m_cde (intervend value of mvar for cde) = 1
#> cvar: c
#> c_cond (covariate vector value) = 0.5
#>
#> Note that effect estimates can vary over m_cde and c_cond values when interaction = TRUE.
## Explicit printing
print(summary(regmedint_obj))
#> ### Mediator model
#>
#> Call:
#> glm(formula = m ~ x + c, family = binomial(link = "logit"), data = data)
#>
#> Deviance Residuals:
#> Min 1Q Median 3Q Max
#> -1.5143 -1.1765 0.9177 1.1133 1.4602
#>
#> Coefficients:
#> Estimate Std. Error z value Pr(>|z|)
#> (Intercept) -0.3545 0.3252 -1.090 0.276
#> x 0.3842 0.4165 0.922 0.356
#> c 0.2694 0.2058 1.309 0.191
#>
#> (Dispersion parameter for binomial family taken to be 1)
#>
#> Null deviance: 138.59 on 99 degrees of freedom
#> Residual deviance: 136.08 on 97 degrees of freedom
#> AIC: 142.08
#>
#> Number of Fisher Scoring iterations: 4
#>
#> ### Outcome model
#>
#> Call:
#> survival::survreg(formula = Surv(y, event) ~ x + m + x:m + c,
#> data = data, dist = "weibull")
#> Value Std. Error z p
#> (Intercept) -1.0424 0.1903 -5.48 4.3e-08
#> x 0.4408 0.3008 1.47 0.14
#> m 0.0905 0.2683 0.34 0.74
#> c -0.0669 0.0915 -0.73 0.46
#> x:m 0.1003 0.4207 0.24 0.81
#> Log(scale) -0.0347 0.0810 -0.43 0.67
#>
#> Scale= 0.966
#>
#> Weibull distribution
#> Loglik(model)= -11.4 Loglik(intercept only)= -14.5
#> Chisq= 6.31 on 4 degrees of freedom, p= 0.18
#> Number of Newton-Raphson Iterations: 5
#> n= 100
#>
#> ### Mediation analysis
#> est se Z p lower upper
#> cde 0.541070807 0.29422958 1.8389409 0.06592388 -0.03560858 1.11775019
#> pnde 0.488930417 0.21049248 2.3227928 0.02019028 0.07637274 0.90148809
#> tnie 0.018240025 0.03706111 0.4921608 0.62260566 -0.05439841 0.09087846
#> tnde 0.498503455 0.21209540 2.3503737 0.01875457 0.08280410 0.91420281
#> pnie 0.008666987 0.02730994 0.3173565 0.75097309 -0.04485951 0.06219348
#> te 0.507170442 0.21090051 2.4047853 0.01618197 0.09381303 0.92052785
#> pm 0.045436278 0.09119614 0.4982259 0.61832484 -0.13330488 0.22417743
#>
#> Evaluated at:
#> avar: x
#> a1 (intervened value of avar) = 1
#> a0 (reference value of avar) = 0
#> mvar: m
#> m_cde (intervend value of mvar for cde) = 1
#> cvar: c
#> c_cond (covariate vector value) = 0.5
#>
#> Note that effect estimates can vary over m_cde and c_cond values when interaction = TRUE.