mixpoissonreg
ObjectsR/8_tidy_mixpoissonreg.R
tidy_local_influence.mixpoissonreg.Rd
Functions to provide tidy outputs of local influence diagnostics. tidy_local_influence.mixpoissonreg
provides a tibble::tibble()
containing the local influence diagnostics under the chosen perturbation schemes.
local_influence_benchmarks.mixpoissonreg
provides a tibble::tibble()
with a single row and one column
for each selected perturbation scheme containing influential benchmarks for each perturbation scheme.
# S3 method for mixpoissonreg tidy_local_influence( model, perturbation = c("case_weights", "hidden_variable", "mean_explanatory", "precision_explanatory", "simultaneous_explanatory"), curvature = c("conformal", "normal"), direction = c("canonical", "max.eigen"), parameters = c("all", "mean", "precision"), mean.covariates = NULL, precision.covariates = NULL, ... ) # S3 method for mixpoissonreg local_influence_benchmarks( model, perturbation = c("case_weights", "hidden_variable", "mean_explanatory", "precision_explanatory", "simultaneous_explanatory"), curvature = c("conformal", "normal"), direction = c("canonical", "max.eigen"), parameters = c("all", "mean", "precision"), mean.covariates = NULL, precision.covariates = NULL, ... )
model | A |
---|---|
perturbation | a list or vector of perturbation schemes to be returned. The currently available schemes are "case_weights", "hidden_variable", "mean_explanatory", "precision_explanatory", "simultaneous_explanatory". See Barreto-Souza and Simas (2016) for further details. |
curvature | the curvature to be returned, 'conformal' for the conformal normal curvature (see Zhu and Lee, 2001 and Poon and Poon, 1999) or 'normal' (see Zhu and Lee, 2001 and Cook, 1986). |
direction | the 'max.eigen' returns the eigenvector associated to the largest eigenvalue of the perturbation matrix. The 'canonical' considers the curvatures under the canonical directions, which is known as "total local curvature" (see Lesaffre and Verbeke, 1998). For conformal normal curvatures both of them coincide. The default is 'canonical'. |
parameters | the parameter to which the local influence will be computed. The options are 'all', 'mean' and 'precision'. This argument affects the 'case_weights' and 'hidden_variable' perturbation schemes. The default is 'all'. |
mean.covariates | a list or vector of characters containing the mean-explanatory variables to be used in the 'mean-explanatory' and 'simultaneous-explanatory' perturbation schemes. If NULL, the 'mean-explanatory' and 'simultaneous-explanatory' perturbation schemes will be computed by perturbing all mean-related covariates. The default is NULL. |
precision.covariates | a list or vector of characters containing the precision-explanatory variables to be used in the 'precision-explanatory' and 'simultaneous-explanatory' perturbation schemes. If NULL, the 'precision-explanatory' and 'simultaneous-explanatory' perturbation schemes will be computed by perturbing all precision-related covariates. The default is NULL. |
... | Currently not used. |
A tibble containing the perturbations schemes as columns.
DOI:10.1007/s11222-015-9601-6 doi: 10.1007/s11222-015-9601-6 (Barreto-Souza and Simas; 2016)
Cook, R. D. (1986) Assessment of Local Influence. Journal of the Royal Statistical Society. Series B (Methodological), Vol. 48, pp.133-169. https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2517-6161.1986.tb01398.x
Lesaffre, E. and Verbeke, G. (1998) Local Influence in Linear Mixed Models. Biometrics, 54, pp. 570-582.
Poon, W.-Y. and Poon, Y.S. (1999) Conformal normal curvature and assessment of local influence. Journal of the Royal Statistical Society. Series B (Methodological), Vol. 61, pp.51-61. https://rss.onlinelibrary.wiley.com/doi/abs/10.1111/1467-9868.00162
Zhu, H.-T. and Lee, S.-Y. (2001) Local influence for incomplete data models. Journal of the Royal Statistical Society. Series B (Methodological), Vol. 63, pp.111-126. https://rss.onlinelibrary.wiley.com/doi/abs/10.1111/1467-9868.00279
# \donttest{ data("Attendance", package = "mixpoissonreg") daysabs_fit <- mixpoissonreg(daysabs ~ gender + math + prog | gender + math + prog, data = Attendance) tidy_local_influence(daysabs_fit)#> # A tibble: 314 x 5 #> case_weights hidden_variable mean_explanatory precision_explanatory #> <dbl> <dbl> <dbl> <dbl> #> 1 0.00146 0.000353 0.000533 0.00217 #> 2 0.000970 0.000268 0.000782 0.00129 #> 3 0.000712 0.000369 0.000535 0.00132 #> 4 0.000350 0.000328 0.000875 0.000130 #> 5 0.000680 0.000562 0.00101 0.000701 #> 6 0.00118 0.00387 0.00494 0.000740 #> 7 0.00125 0.00230 0.00396 0.00139 #> 8 0.00243 0.00127 0.00230 0.00185 #> 9 0.00107 0.00180 0.00266 0.00160 #> 10 0.00249 0.00325 0.000340 0.000788 #> # … with 304 more rows, and 1 more variable: simultaneous_explanatory <dbl>daysabs_fit_ml <- mixpoissonregML(daysabs ~ gender + math + prog | gender + math + prog, data = Attendance, envelope = 100) tidy_local_influence(daysabs_fit_ml, perturbation = "case_weights")#> # A tibble: 314 x 1 #> case_weights #> <dbl> #> 1 0.00146 #> 2 0.000970 #> 3 0.000712 #> 4 0.000350 #> 5 0.000680 #> 6 0.00118 #> 7 0.00125 #> 8 0.00243 #> 9 0.00107 #> 10 0.00249 #> # … with 304 more rows# } daysabs_prog <- mixpoissonreg(daysabs ~ prog | prog, data = Attendance) tidy_local_influence(daysabs_prog)#> # A tibble: 314 x 5 #> case_weights hidden_variable mean_explanatory precision_explanatory #> <dbl> <dbl> <dbl> <dbl> #> 1 0.000847 0.000249 0.000887 0.00142 #> 2 0.000847 0.000249 0.000887 0.00142 #> 3 0.000198 0.000169 0.000365 0.0000611 #> 4 0.000483 0.000172 0.000598 0.000703 #> 5 0.000483 0.000172 0.000598 0.000703 #> 6 0.000913 0.00266 0.00605 0.00118 #> 7 0.00113 0.00191 0.00451 0.00181 #> 8 0.00139 0.000758 0.00210 0.00245 #> 9 0.00125 0.00158 0.00382 0.00209 #> 10 0.00326 0.00460 0.000454 0.000646 #> # … with 304 more rows, and 1 more variable: simultaneous_explanatory <dbl>