Skip to contents

Print Method for Object of Class ctmeddelta

Usage

# S3 method for class 'ctmeddelta'
print(x, alpha = 0.05, digits = 4, ...)

Arguments

x

an object of class ctmeddelta.

alpha

Numeric vector. Significance level \(\alpha\).

digits

Integer indicating the number of decimal places to display.

...

further arguments.

Value

Prints a list of matrices of time intervals, estimates, standard errors, test statistics, p-values, and confidence intervals.

Author

Ivan Jacob Agaloos Pesigan

Examples

phi <- matrix(
  data = c(
    -0.357, 0.771, -0.450,
    0.0, -0.511, 0.729,
    0, 0, -0.693
  ),
  nrow = 3
)
colnames(phi) <- rownames(phi) <- c("x", "m", "y")
vcov_phi_vec <- matrix(
  data = c(
    0.002704274, -0.001475275, 0.000949122,
    -0.001619422, 0.000885122, -0.000569404,
    0.00085493, -0.000465824, 0.000297815,
    -0.001475275, 0.004428442, -0.002642303,
    0.000980573, -0.00271817, 0.001618805,
    -0.000586921, 0.001478421, -0.000871547,
    0.000949122, -0.002642303, 0.006402668,
    -0.000697798, 0.001813471, -0.004043138,
    0.000463086, -0.001120949, 0.002271711,
    -0.001619422, 0.000980573, -0.000697798,
    0.002079286, -0.001152501, 0.000753,
    -0.001528701, 0.000820587, -0.000517524,
    0.000885122, -0.00271817, 0.001813471,
    -0.001152501, 0.00342605, -0.002075005,
    0.000899165, -0.002532849, 0.001475579,
    -0.000569404, 0.001618805, -0.004043138,
    0.000753, -0.002075005, 0.004984032,
    -0.000622255, 0.001634917, -0.003705661,
    0.00085493, -0.000586921, 0.000463086,
    -0.001528701, 0.000899165, -0.000622255,
    0.002060076, -0.001096684, 0.000686386,
    -0.000465824, 0.001478421, -0.001120949,
    0.000820587, -0.002532849, 0.001634917,
    -0.001096684, 0.003328692, -0.001926088,
    0.000297815, -0.000871547, 0.002271711,
    -0.000517524, 0.001475579, -0.003705661,
    0.000686386, -0.001926088, 0.004726235
  ),
  nrow = 9
)

# Specific time interval ----------------------------------------------------
delta <- DeltaMed(
  phi = phi,
  vcov_phi_vec = vcov_phi_vec,
  delta_t = 1,
  from = "x",
  to = "y",
  med = "m"
)
print(delta)
#> 
#> Total, Direct, and Indirect Effects
#> 
#> $`1`
#>          interval     est     se       z      p    2.5%   97.5%
#> total           1 -0.1000 0.0329 -3.0424 0.0023 -0.1645 -0.0356
#> direct          1 -0.2675 0.0436 -6.1280 0.0000 -0.3530 -0.1819
#> indirect        1  0.1674 0.0194  8.6167 0.0000  0.1293  0.2055
#> 

# Range of time intervals ---------------------------------------------------
delta <- DeltaMed(
  phi = phi,
  vcov_phi_vec = vcov_phi_vec,
  delta_t = 1:5,
  from = "x",
  to = "y",
  med = "m"
)
print(delta)
#> 
#> Total, Direct, and Indirect Effects
#> 
#> $`1`
#>          interval     est     se       z      p    2.5%   97.5%
#> total           1 -0.1000 0.0329 -3.0424 0.0023 -0.1645 -0.0356
#> direct          1 -0.2675 0.0436 -6.1280 0.0000 -0.3530 -0.1819
#> indirect        1  0.1674 0.0194  8.6167 0.0000  0.1293  0.2055
#> 
#> $`2`
#>          interval     est     se       z      p    2.5%   97.5%
#> total           2  0.0799 0.0370  2.1603 0.0307  0.0074  0.1524
#> direct          2 -0.3209 0.0512 -6.2642 0.0000 -0.4213 -0.2205
#> indirect        2  0.4008 0.0389 10.3027 0.0000  0.3246  0.4771
#> 
#> $`3`
#>          interval     est     se       z p    2.5%   97.5%
#> total           3  0.2508 0.0366  6.8606 0  0.1792  0.3225
#> direct          3 -0.2914 0.0485 -6.0055 0 -0.3866 -0.1963
#> indirect        3  0.5423 0.0493 11.0007 0  0.4456  0.6389
#> 
#> $`4`
#>          interval     est     se       z p    2.5%   97.5%
#> total           4  0.3449 0.0350  9.8570 0  0.2763  0.4135
#> direct          4 -0.2374 0.0433 -5.4828 0 -0.3223 -0.1525
#> indirect        4  0.5823 0.0548 10.6249 0  0.4749  0.6897
#> 
#> $`5`
#>          interval     est     se       z p    2.5%   97.5%
#> total           5  0.3693 0.0342 10.8008 0  0.3022  0.4363
#> direct          5 -0.1828 0.0376 -4.8614 0 -0.2566 -0.1091
#> indirect        5  0.5521 0.0571  9.6771 0  0.4403  0.6639
#>