diff --git a/R/measure_diffusion.R b/R/measure_diffusion.R index 8da7142d..3bb59484 100644 --- a/R/measure_diffusion.R +++ b/R/measure_diffusion.R @@ -1,6 +1,6 @@ # net_diffusion #### -#' Diffusion metrics for networks +#' Measures of network diffusion #' @description #' These functions allow measurement of various features of #' a diffusion process: @@ -17,6 +17,7 @@ #' to be protected through vaccination, isolation, or recovery for herd immunity to be reached. #' - `network_hazard()` measures the hazard rate or instantaneous probability that #' nodes will adopt/become infected at that time +#' #' @param diff_model A valid network diffusion model, #' as created by `as_diffusion()` or `play_diffusion()`. #' @family measures @@ -199,7 +200,7 @@ network_hazard <- function(diff_model){ # node_diffusion #### -#' Diffusion metrics for nodes +#' Measures of nodes in a diffusion #' @description #' These functions allow measurement of various features of #' a diffusion process: @@ -215,6 +216,7 @@ network_hazard <- function(diff_model){ #' a given mark #' - `node_is_exposed()`: Marks the nodes that are susceptible, #' i.e. are in the immediate neighbourhood of given mark vector +#' #' @inheritParams cohesion #' @inheritParams net_diffusion #' @family measures diff --git a/R/model_regression.R b/R/model_regression.R index a156df56..81753cc9 100644 --- a/R/model_regression.R +++ b/R/model_regression.R @@ -1,5 +1,6 @@ #' Linear and logistic regression for network data #' +#' @description #' This function provides an implementation of #' the multiple regression quadratic assignment procedure (MRQAP) #' for both one-mode and two-mode network linear models. diff --git a/R/model_tests.R b/R/model_tests.R index 46cd5fea..39b054e7 100644 --- a/R/model_tests.R +++ b/R/model_tests.R @@ -1,7 +1,17 @@ #' Conditional uniform graph and permutation tests #' -#' These functions conduct conditional uniform graph (CUG) -#' or permutation (QAP) tests of any graph-level statistic. +#' @description +#' These functions conduct tests of any network-level statistic: +#' +#' - `test_random()` performs a conditional uniform graph (CUG) test +#' of a measure against a distribution of measures on random networks +#' of the same dimensions. +#' - `test_permutation()` performs a quadratic assignment procedure (QAP) test +#' of a measure against a distribution of measures on permutations +#' of the original network. +#' - `test_gof()` performs a chi-squared test on the squared Mahalanobis distance +#' between a diff_model and diff_models objects. +#' #' @name tests #' @inheritParams regression #' @family models @@ -10,8 +20,7 @@ #' e.g. the name of the attribute. NULL -#' @describeIn tests Returns test results for some measure on an object -#' against a distribution of measures on random networks of the same dimensions +#' @rdname tests #' @examples #' marvel_friends <- to_unsigned(ison_marvel_relationships) #' marvel_friends <- to_giant(marvel_friends) %>% @@ -62,8 +71,7 @@ test_random <- function(.data, FUN, ..., class(out) <- "network_test" out } -#' @describeIn tests Returns test results for some measure on an object -#' against a distribution of measures on permutations of the original network +#' @rdname tests #' @examples #' (qaptest <- test_permutation(marvel_friends, #' network_heterophily, attribute = "Attractive", @@ -161,8 +169,7 @@ plot.network_test <- function(x, ..., color="red", linewidth=1.2) + ggplot2::ylab("Density") } -#' @describeIn tests Returns the squared Mahalanobis distance -#' and chi-squared results for diff_model and diff_models objects +#' @rdname tests #' @param diff_model A diff_model object is returned by #' `play_diffusion()` or `as_diffusion()` and contains #' a single empirical or simulated diffusion. diff --git a/man/net_diffusion.Rd b/man/net_diffusion.Rd index 9c3677ce..2f130e62 100644 --- a/man/net_diffusion.Rd +++ b/man/net_diffusion.Rd @@ -7,7 +7,7 @@ \alias{network_reproduction} \alias{network_immunity} \alias{network_hazard} -\title{Diffusion metrics for networks} +\title{Measures of network diffusion} \source{ \code{{netdiffuseR}} } diff --git a/man/node_diffusion.Rd b/man/node_diffusion.Rd index 8bef67a5..2475f0af 100644 --- a/man/node_diffusion.Rd +++ b/man/node_diffusion.Rd @@ -7,7 +7,7 @@ \alias{node_thresholds} \alias{node_infection_length} \alias{node_exposure} -\title{Diffusion metrics for nodes} +\title{Measures of nodes in a diffusion} \usage{ node_adoption_time(diff_model) diff --git a/man/tests.Rd b/man/tests.Rd index 91fe2651..fd28f351 100644 --- a/man/tests.Rd +++ b/man/tests.Rd @@ -70,21 +70,18 @@ a single empirical or simulated diffusion.} \code{play_diffusions()} and contains a series of diffusion simulations.} } \description{ -These functions conduct conditional uniform graph (CUG) -or permutation (QAP) tests of any graph-level statistic. -} -\section{Functions}{ +These functions conduct tests of any network-level statistic: \itemize{ -\item \code{test_random()}: Returns test results for some measure on an object -against a distribution of measures on random networks of the same dimensions - -\item \code{test_permutation()}: Returns test results for some measure on an object -against a distribution of measures on permutations of the original network - -\item \code{test_gof()}: Returns the squared Mahalanobis distance -and chi-squared results for diff_model and diff_models objects - -}} +\item \code{test_random()} performs a conditional uniform graph (CUG) test +of a measure against a distribution of measures on random networks +of the same dimensions. +\item \code{test_permutation()} performs a quadratic assignment procedure (QAP) test +of a measure against a distribution of measures on permutations +of the original network. +\item \code{test_gof()} performs a chi-squared test on the squared Mahalanobis distance +between a diff_model and diff_models objects. +} +} \section{Mahalanobis distance}{ \code{test_gof()} takes a single diff_model object,