|
15 | 15 | parameters <- .extract_anova_aovlist(model) |
16 | 16 | } else if (inherits(model, "anova.rms")) { |
17 | 17 | parameters <- .extract_anova_aov_rms(model) |
| 18 | + } else if (inherits(model, "seqanova.svyglm")) { |
| 19 | + parameters <- .extract_anova_aov_svyglm(model) |
18 | 20 | } |
19 | 21 |
|
20 | 22 | # Rename |
|
70 | 72 | # Reorder |
71 | 73 | row.names(parameters) <- NULL |
72 | 74 | col_order <- c( |
73 | | - "Response", "Group", "Parameter", "Coefficient", "SE", "Pillai", "AIC", |
| 75 | + "Response", "Group", "Parameter", "Coefficient", "DEff", "SE", "Pillai", "AIC", |
74 | 76 | "BIC", "Log_Likelihood", "Chi2", "Chi2_df", "RSS", "Sum_Squares", |
75 | 77 | "Sum_Squares_Partial", "Sum_Squares_Error", "df", "Deviance", "Statistic", |
76 | 78 | "df_num", "df_error", "Deviance_error", "Mean_Square", "F", "Rao", "p" |
|
255 | 257 | } |
256 | 258 |
|
257 | 259 |
|
| 260 | +# Anova.seqanova.svyglm ------------- |
| 261 | +.extract_anova_aov_svyglm <- function(model) { |
| 262 | + if (identical(attributes(model)$method, "Wald")) { |
| 263 | + params <- lapply(model, function(x) { |
| 264 | + data.frame(F = as.vector(x$Ftest), df = x$df, df_error = x$ddf, p = as.vector(x$p)) |
| 265 | + }) |
| 266 | + } else { |
| 267 | + params <- lapply(model, function(x) { |
| 268 | + data.frame(Chi2 = x$chisq, DEff = x$lambda, df = x$df, df_error = x$ddf, p = as.vector(x$p)) |
| 269 | + }) |
| 270 | + } |
| 271 | + |
| 272 | + params <- do.call(rbind, params) |
| 273 | + cbind(data.frame(Parameter = sapply(model, "[[", "test.terms"), params)) |
| 274 | +} |
| 275 | + |
| 276 | + |
258 | 277 |
|
259 | 278 |
|
260 | 279 | # test helper ------------- |
|
0 commit comments