Skip to contents

Returns the robust (sandwich) variance-covariance matrix.

Usage

# S3 method for class 'robcov_vglm'
vcov(object, ...)

Arguments

object

A robcov_vglm object.

...

Additional arguments (ignored).

Value

The robust variance-covariance matrix.

Examples

trial <- sim_markov("actt2", n_patients = 40, follow_up_time = 6, seed = 1)
markov_data <- prepare_markov_data(trial, absorbing_state = 8)
fit <- vglm_markov(
  ordered(y) ~ time + tx + yprev,
  family = VGAM::cumulative(reverse = TRUE, parallel = TRUE),
  data = markov_data
)
#> Warning: `id_var` was not supplied to vglm_markov(); stored patient-ID metadata, cluster-robust standard errors for frequentist wrappers, and automatic FWB refits will not be available from the fitted object.
#> Warning: 12 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: 76 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: 77 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: 128 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: 151 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: 151 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: 151 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: 151 diagonal elements of the working weights variable 'wz' have been replaced by 1.819e-12
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: fitted values close to 0 or 1
#> Warning: It seems that the nonparallelism assumption has resulted in intersecting linear/additive predictors. Try propodds() or fitting a partial nonproportional odds model or choosing some other link function, etc.
#> Warning: some quantities such as z, residuals, SEs may be inaccurate due to convergence at a half-step
robust_fit <- robcov_vglm(fit, cluster = markov_data$id)
vcov(robust_fit)
#>               (Intercept):1 (Intercept):2 (Intercept):3 (Intercept):4
#> (Intercept):1    0.68157900    0.31176163    0.26230659    0.23822018
#> (Intercept):2    0.31176163    4.03879747    4.20659911    3.82953330
#> (Intercept):3    0.26230659    4.20659911    4.40345743    4.01803312
#> (Intercept):4    0.23822018    3.82953330    4.01803312    3.84656546
#> (Intercept):5    0.20657003    3.70333394    3.89686381    3.74445463
#> (Intercept):6    0.15872992    3.59743779    3.79413708    3.65741137
#> time            -0.06078981   -0.10888022   -0.10699996   -0.09244885
#> tx              -0.10376223   -0.09946213   -0.09274708   -0.08856369
#> yprev2          -0.28303472    0.44322398    0.49716008    0.46347378
#> yprev3          -0.21053880   -1.74917522   -1.82070427   -1.66796499
#> yprev4           0.05278025   -3.52276636   -3.72869292   -3.53221128
#> yprev5           0.02958509   -3.28199059   -3.48008139   -3.36473017
#> yprev6           0.11544661   -3.19410049   -3.39998133   -3.30644674
#> yprev7           0.12770816   -3.10729919   -3.31593107   -3.24189693
#>               (Intercept):5 (Intercept):6         time           tx      yprev2
#> (Intercept):1    0.20657003    0.15872992 -0.060789808 -0.103762227 -0.28303472
#> (Intercept):2    3.70333394    3.59743779 -0.108880224 -0.099462127  0.44322398
#> (Intercept):3    3.89686381    3.79413708 -0.106999957 -0.092747077  0.49716008
#> (Intercept):4    3.74445463    3.65741137 -0.092448846 -0.088563695  0.46347378
#> (Intercept):5    3.93573311    3.91604813 -0.086272674 -0.097674786  0.47124197
#> (Intercept):6    3.91604813    4.26490634 -0.079605250 -0.065155339  0.49632743
#> time            -0.08627267   -0.07960525  0.012361390  0.004984025  0.02846527
#> tx              -0.09767479   -0.06515534  0.004984025  0.102260603  0.03709325
#> yprev2           0.47124197    0.49632743  0.028465270  0.037093249  0.76673310
#> yprev3          -1.59845770   -1.57411131  0.042766802 -0.015600481 -0.20258334
#> yprev4          -3.45624453   -3.40171875  0.051938106  0.004891656 -0.66394035
#> yprev5          -3.31803555   -3.25262820  0.044041084  0.023766687 -0.54470888
#> yprev6          -3.48921890   -3.70389836  0.033639714 -0.014641639 -0.61150564
#> yprev7          -3.55391896   -3.91529748  0.032375606 -0.039556167 -0.62647700
#>                    yprev3       yprev4      yprev5      yprev6      yprev7
#> (Intercept):1 -0.21053880  0.052780252  0.02958509  0.11544661  0.12770816
#> (Intercept):2 -1.74917522 -3.522766358 -3.28199059 -3.19410049 -3.10729919
#> (Intercept):3 -1.82070427 -3.728692916 -3.48008139 -3.39998133 -3.31593107
#> (Intercept):4 -1.66796499 -3.532211280 -3.36473017 -3.30644674 -3.24189693
#> (Intercept):5 -1.59845770 -3.456244529 -3.31803555 -3.48921890 -3.55391896
#> (Intercept):6 -1.57411131 -3.401718755 -3.25262820 -3.70389836 -3.91529748
#> time           0.04276680  0.051938106  0.04404108  0.03363971  0.03237561
#> tx            -0.01560048  0.004891656  0.02376669 -0.01464164 -0.03955617
#> yprev2        -0.20258334 -0.663940348 -0.54470888 -0.61150564 -0.62647700
#> yprev3         0.86715643  1.574285545  1.47031139  1.45304801  1.43222347
#> yprev4         1.57428554  3.512314884  3.24467574  3.24916527  3.18708095
#> yprev5         1.47031139  3.244675740  3.15027202  3.10885398  3.06109054
#> yprev6         1.45304801  3.249165272  3.10885398  3.57513334  3.57201485
#> yprev7         1.43222347  3.187080950  3.06109054  3.57201485  4.15251783