diff --git a/DESCRIPTION b/DESCRIPTION index 6d9f9d42..f1dc3465 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: migraph Title: Inferential Methods for Multimodal and Other Networks -Version: 1.5.6 -Date: 2025-11-19 +Version: 1.5.7 +Date: 2026-02-18 Description: A set of tools for testing networks. It includes functions for univariate and multivariate conditional uniform graph and quadratic assignment procedure testing, diff --git a/NAMESPACE b/NAMESPACE index 946b0455..6ae92131 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,18 +3,21 @@ S3method(glance,ergm) S3method(glance,netlm) S3method(glance,netlogit) +S3method(glance,sienaFit) S3method(predict,netlm) S3method(predict,netlogit) S3method(print,diffs_model) -S3method(print,ergm) S3method(print,netlm) S3method(print,netlogit) S3method(print,network_test) S3method(print,over_memb) S3method(summary,diffs_model) +S3method(summary,ergm) +S3method(summary,sienaFit) S3method(tidy,ergm) S3method(tidy,netlm) S3method(tidy,netlogit) +S3method(tidy,sienaFit) export("%>%") export(glance) export(net_regression) diff --git a/NEWS.md b/NEWS.md index d87c2e7e..6c583a04 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# migraph 1.5.7 + +2026-02-18 + +- Using fict_marvel in tests +- Added tidy(), glance(), and summary() methods for sienaFit class objects +- Added summary.ergm() + # migraph 1.5.6 2025-11-19 diff --git a/R/class_models.R b/R/class_models.R index 16760729..b8e9f357 100644 --- a/R/class_models.R +++ b/R/class_models.R @@ -97,6 +97,17 @@ tidy.ergm <- function( dplyr::as_tibble(ret) } +#' @method tidy sienaFit +#' @export +tidy.sienaFit <- function(ans){ + tibble::tibble( + dv = ans$effects$name, + term = ans$effects$effectName, + estimate = ans$theta, + se = ans$se, + tstat = ans$theta/ans$se + ) +} #' @importFrom generics glance #' @export @@ -239,6 +250,15 @@ glance.ergm <- function(x, deviance = FALSE, mcmc = FALSE, ...) { ret } +#' @method glance sienaFit +#' @export +glance.sienaFit <- function(ans){ + tibble::tibble( + tmax = ans$tmax, + tconv.max = ans$tconv.max[,1] + ) +} + #' @export print.netlm <- function(x, ...){ cat("# Fitted model results\n") @@ -256,7 +276,15 @@ print.netlogit <- function(x, ...){ } #' @export -print.ergm <- function(x, ...){ +summary.ergm <- function(x, ...){ + cat("# Fitted model results\n") + print(tidy(x)) + cat("\n# Model summary statistics\n") + print(glance(x)) +} + +#' @export +summary.sienaFit <- function(x, ...){ cat("# Fitted model results\n") print(tidy(x)) cat("\n# Model summary statistics\n") diff --git a/cran-comments.md b/cran-comments.md index ec9cf8aa..4631e4d7 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -9,4 +9,4 @@ 0 errors | 0 warnings | 0 notes -- Fixed CRAN errors +- This release is required to avoid a reverse dependency issue because of renaming some data in the manynet package diff --git a/tests/testthat/test-model_tests.R b/tests/testthat/test-model_tests.R index e32f2c68..a7ebee70 100644 --- a/tests/testthat/test-model_tests.R +++ b/tests/testthat/test-model_tests.R @@ -1,5 +1,6 @@ # # Making sure the tests family of functions works as intended. -marvel_friends <- manynet::to_giant(manynet::to_unsigned(manynet::ison_marvel_relationships)) %>% +marvel_friends <- manynet::to_uniplex(manynet::fict_marvel, "relationship") %>% + manynet::to_giant() %>% manynet::to_unsigned() %>% manynet::to_subgraph(PowerOrigin == "Human") cugtest <- test_random(marvel_friends, manynet::net_heterophily, @@ -38,9 +39,6 @@ test_that("test_random works", { }) # Set the qaptest up -marvel_friends <- manynet::to_unsigned(manynet::ison_marvel_relationships) -marvel_friends <- manynet::to_giant(marvel_friends) -marvel_friends <- manynet::to_subgraph(marvel_friends, PowerOrigin == "Human") qaptest <- test_permutation(marvel_friends, manynet::net_heterophily, attribute = "Attractive",