Skip to content

Commit

Permalink
Converted documentation links to Roxygen rmarkdown links and ensured …
Browse files Browse the repository at this point in the history
…that all external links are anchored..
  • Loading branch information
krivit committed Oct 9, 2024
1 parent 23191e2 commit 945a413
Show file tree
Hide file tree
Showing 24 changed files with 175 additions and 182 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ergm.ego
Version: 1.1-704
Date: 2023-05-30
Version: 1.1-729
Date: 2024-10-09
Title: Fit, Simulate and Diagnose Exponential-Family Random Graph Models to Egocentrically Sampled Network Data
Authors@R: c(
person(c("Pavel", "N."), "Krivitsky", role=c("aut","cre"), email="[email protected]", comment=c(ORCID="0000-0002-9101-3362")),
Expand Down Expand Up @@ -32,7 +32,7 @@ Description: Utilities for managing egocentrically sampled network data and a wr
License: GPL-3 + file LICENSE
URL: https://statnet.org
BugReports: https://github.com/statnet/ergm.ego/issues
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2.9000
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
LazyData: true
Expand Down
18 changes: 9 additions & 9 deletions R/EgoStat.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,17 @@ split_aaties_by_ego <- function(x, egor){
h
}

#' \code{\link[ergm]{ergm}} Terms Implemented for
#' \code{\link{egor}}
#' [ergm()] Terms Implemented for
#' [`egor`]
#'
#' This page describes the \code{\link[ergm]{ergm}} terms (and hence network
#' This page describes the [ergm()] terms (and hence network
#' statistics) for which inference based on egocentrically sampled data is
#' implemented in \code{ergm.ego} package. Other packages may add their own
#' implemented in \CRANpkg{ergm.ego} package. Other packages may add their own
#' terms. These functions should not be called by the end-user.
#'
#' The current recommendation for any package implementing additional
#' egocentric calculator terms is to create a help file with a name or alias
#' \code{ergm.ego-terms}, so that \code{help("ergm.ego-terms")} will
#' \code{\link{ergm.ego-terms}}, so that \code{help("ergm.ego-terms")} will
#' list egocentric ERGM terms available from all loaded packages.
#'
#'
Expand All @@ -178,9 +178,9 @@ split_aaties_by_ego <- function(x, egor){
#' \describe{ \item{Special-purpose terms:}{ \describe{
#' \item{netsize.adj(edges=+1, mutual=0, transitiveties=0,
#' cyclicalties=0)}{A special-purpose term equivalent to a linear
#' combination of \code{\link[ergm]{edges-ergmTerm}},
#' \code{\link[ergm]{mutual-ergmTerm}}, \code{\link[ergm]{transitiveties-ergmTerm}}, and
#' \code{\link[ergm]{cyclicalties-ergmTerm}}, to house the network-size
#' combination of \code{\link[ergm:edges-ergmTerm]{edges}},
#' \code{\link[ergm:mutual-ergmTerm]{mutual}}, \code{\link[ergm:transitiveties-ergmTerm]{transitiveties}}, and
#' \code{\link[ergm:cyclicalties-ergmTerm]{cyclicalties}}, to house the network-size
#' adjustment offset. This term is added to the model automatically
#' and should not be used in the model formula directly. } } }
#'
Expand Down Expand Up @@ -216,7 +216,7 @@ split_aaties_by_ego <- function(x, egor){
#' evaluated, some inferential results and standard error calculation
#' methods may not be applicable.
#'
#' @seealso \code{\link[ergm]{ergm-terms}}
#' @seealso [`ergmTerm`]
#' @keywords models
NULL

Expand Down
10 changes: 5 additions & 5 deletions R/control.ergm.ego.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
################################################################################


#' Control parameters for \code{\link{ergm.ego}}.
#' Control parameters for [ergm.ego()].
#'
#' Constructs and checks the list of control parameters for estimation by
#' \code{\link{ergm.ego}}.
#' [ergm.ego()].
#'
#'
#' @param ppopsize,ppopsize.mul Parameters to determine the size
Expand Down Expand Up @@ -78,12 +78,12 @@
#' number of nominations. Used to be `FALSE`, now `TRUE` in light of
#' the findings of Krivitsky et. al (2020).
#'
#' @param ergm Control parameters for the \code{\link[ergm]{ergm}()} call
#' to fit the model, constructed by \code{\link[ergm]{control.ergm}()}.
#' @param ergm Control parameters for the [ergm()] call
#' to fit the model, constructed by [control.ergm()].
#' @param \dots Not used at this time.
#' @return A list with arguments as components.
#' @author Pavel N. Krivitsky
#' @seealso \code{\link[ergm]{control.ergm}()}
#' @seealso [control.ergm()]
#' @references
#'
#' Pavel N. Krivitsky and Martina Morris (2017). "Inference for social network models from egocentrically sampled data, with application to understanding persistent racial disparities in HIV prevalence in the US." *Annals of Applied Statistics*, 11(1): 427–455. \doi{10.1214/16-AOAS1010}
Expand Down
12 changes: 6 additions & 6 deletions R/control.simulate.ergm.ego.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
################################################################################


#' Control parameters for \code{\link{simulate.ergm.ego}}.
#' Control parameters for [simulate.ergm.ego()].
#'
#' Constructs and checks the list of control parameters for simulation by
#' \code{\link{simulate.ergm.ego}}.
#' [simulate.ergm.ego()].
#'
#'
#' @param ppop.wt Because each ego must be represented in the pseuodopopulation
Expand All @@ -27,12 +27,12 @@
#' the sum of these rounded freqencies.}
#' \item{"sample"}{Resample in proportion to \eqn{w_i}.} }
#'
#' @param SAN A list of control parameters for \code{\link[ergm]{san}}
#' constructed by \code{\link[ergm]{control.ergm}}, called to construct a
#' @param SAN A list of control parameters for [san()]
#' constructed by [control.ergm()], called to construct a
#' pseudopopulation network consistent with the data.
#' @param simulate A list of control parameters for
#' \code{\link[ergm]{simulate.formula}} constructed by
#' \code{\link[ergm]{control.simulate}}, called to simulate from the model fit.
#' [simulate.formula()] constructed by
#' [control.simulate()], called to simulate from the model fit.
#' @param \dots Not used at this time.
#' @return A list with arguments as components.
#' @author Pavel N. Krivitsky
Expand Down
15 changes: 7 additions & 8 deletions R/degreedist.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' graph.
#'
#' @aliases degreedist
#' @param object A \code{\link{egor}} object.
#' @param object A [`egor`] object.
#' @param freq,prob Whether to plot the raw frequencies or the conditional
#' proportions of the degree values. Defaults to the latter.
#' @param by A character vector giving the name of a vertex attribute; if
Expand All @@ -36,8 +36,7 @@
#' if `by=NULL` or a matrix with a row for each category if not. If
#' \code{plot==TRUE} returns invisibly.
#'
#' @seealso \code{\link{degreedist}},
#' \code{\link[ergm:summary_formula]{summary}}
#' @seealso [degreedist()], \code{\link[ergm:summary_formula]{summary}} for formulas.
#' @examples
#'
#' data(faux.mesa.high)
Expand Down Expand Up @@ -151,12 +150,12 @@ degreedist.egor <- function(object, freq = FALSE, prob = !freq,
#' Summarizing the mixing among groups in an egocentric dataset
#'
#' A \code{\link[network]{mixingmatrix}} method for
#' \code{\link{egor}} objects, to return counts of how often a ego
#' [`egor`] objects, to return counts of how often a ego
#' of each group nominates an alter of each group.
#'
#'
#' @aliases mixingmatrix
#' @param object A \code{\link{egor}} object.
#' @param object A [`egor`] object.
#' @param attrname A character vector containing the name of the network
#' attribute whose mixing matrix is wanted.
#' @param rowprob Whether the counts should be normalized by row sums. That is,
Expand All @@ -166,11 +165,11 @@ degreedist.egor <- function(object, freq = FALSE, prob = !freq,
#' @param ... Additional arguments, currently unused.
#' @return A matrix with a row and a column for each level of \code{attrname}.
#'
#' Note that, unlike \code{\link[network]{mixingmatrix}}, what is counted are
#' Note that, unlike [network::mixingmatrix()], what is counted are
#' \emph{nominations}, not ties. This means that under an egocentric census,
#' the diagonal of \code{mixingmatrix.egor} will be twice that returned by
#' \code{\link[network]{mixingmatrix}} for the original undirected network.
#' @seealso \code{\link[network]{mixingmatrix}}, \code{\link[ergm]{nodemix-ergmTerm}},
#' [network::mixingmatrix()] for the original undirected network.
#' @seealso [network::mixingmatrix()], \code{\link[ergm:nodemix-ergmTerm]{nodemix}} ERGM term,
#' \code{\link[ergm.ego]{summary}} method for egocentric data
#' @examples
#'
Expand Down
31 changes: 15 additions & 16 deletions R/egor.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
################################################################################


#' Convert (deprecated) \code{\link{egodata}} Objects to
#' \code{\link{egor}} Objects
#' Convert (deprecated) [`egodata`] Objects to [`egor`] Objects
#'
#' @aliases egodata
#'
#' @param x a \code{\link{egodata}} object
#' @param x an [`egodata`] object
#' @param ... additional arguments, currently unused.
#'
#' @return An \code{\link{egor}} object.
#' @return An [`egor`] object.
#'
#' @author Pavel N. Krivitsky
#' @keywords manip methods
Expand All @@ -34,21 +33,21 @@ as.egor.egodata <- function(x, ...){
#' @export
as_egor.egodata <- as.egor.egodata

#' Construct an Egocentric View of a \code{\link{network}} Object
#' Construct an Egocentric View of a [`network`] Object
#'
#' Given a \code{\link[network]{network}} object, construct an
#' \code{\link{egor}} object representing a census of all the actors in the
#' Given a [`network`] object, construct an
#' [`egor`] object representing a census of all the actors in the
#' network. Used mainly for testing.
#'
#'
#' @param x A \code{\link[network]{network}} object.
#' @param x A [`network`] object.
#' @param special.cols Vertex attributes that should not be copied to the
#' \code{egos} and \code{alters} tables. Defaults to attributes special to the
#' \code{\link[network]{network}} objects.
#' [`network`] objects.
#' @param ... Additional arguments, currently unused.
#' @return An \code{\link{egor}} object.
#' @return An [`egor`] object.
#' @author Pavel N. Krivitsky
#' @seealso \code{\link{template_network}}, which performs the inverse
#' @seealso [template_network()], which performs the inverse
#' operation (though drops the ties).
#' @keywords datagen manip
#' @examples
Expand Down Expand Up @@ -92,14 +91,14 @@ as.egor.network<-function(x,special.cols=c("na"),...){
#' Construct an Empty ``Template'' Network Consistent with an Egocentric Sample
#'
#' Taking an object with ego information, constructs a
#' \code{\link[network]{network}} object with no edges whose vertices have the
#' [`network`] object with no edges whose vertices have the
#' attributes of the egos in the dataset, replicating the egos as needed, and
#' taking into accounts their sampling weights.
#'
#'
#' @param x A \code{\link{egor}} object.
#' @param x A [`egor`] object.
#' @param N The target number of vertices the output network should have.
#' @param scaling If \code{\link{egor}} contains weights or \code{N} is not
#' @param scaling If [`egor`] contains weights or \code{N} is not
#' a multiple of number of egos in the sample, it may not be possible, for a
#' finite \code{N} to represent each ego exactly according to its relative
#' weight, and \code{scaling} controls how the fractional egos are allocated:
Expand All @@ -109,9 +108,9 @@ as.egor.network<-function(x,special.cols=c("na"),...){
#' these rounded freqencies.} \item{"sample"}{Resample in
#' proportion to \eqn{w_i}.} }
#' @param ... Additional arguments, currently unused.
#' @return A \code{\link[network]{network}} object.
#' @return A [`network`] object.
#' @author Pavel N. Krivitsky
#' @seealso \code{\link{as.egor.network}}, which performs the inverse
#' @seealso [as.egor.network()], which performs the inverse
#' operation.
#' @keywords manip
#' @examples
Expand Down
30 changes: 15 additions & 15 deletions R/ergm.ego.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
#' Inference for Exponential-Family Random Graph Models based on Egocentrically
#' Sampled Data
#'
#' A wrapper around the \code{\link[ergm]{ergm}} to fit an ERGM to an
#' \code{\link{egor}}.
#' A wrapper around the [ergm()] to fit an ERGM to an
#' [`egor`].
#'
#'
#' @param formula An \code{\link{formula}} object, of the form \code{e
#' ~ <model terms>}, where \code{e} is a \code{\link{egor}}
#' object. See \code{\link[ergm]{ergm}} for details and examples.
#' @param formula A [`formula`] object, of the form \code{e
#' ~ <model terms>}, where \code{e} is a [`egor`]
#' object. See [ergm()] for details and examples.
#'
#' For a list of currently implemented egocentric terms for the RHS, see
#' \code{\link{ergm.ego-terms}}.
#' @param constraints A one-sided formula \code{\link{formula}} giving
#' the sample space constraints. See \code{\link[ergm]{ergm}} for
#' [`ergm.ego-terms`].
#' @param constraints A one-sided formula [`formula`] giving
#' the sample space constraints. See [ergm()] for
#' details and examples.
#'
#' @param popsize The size \eqn{|N|} of the finite population network
Expand All @@ -43,19 +43,19 @@
#' when the terms need them for models that scale.
#' @param na.rm How to handle missing actor attributes in egos or alters,
#' when the terms need them for models that do not scale.
#' @param \dots Additional arguments passed to \code{\link[ergm]{ergm}}.
#' @param control A \code{\link{control.ergm.ego}} control list.
#' @param do.fit Whether to actually call \code{\link[ergm]{ergm}}
#' @return An object of class \code{ergm.ego} inheriting from
#' \code{\link[ergm]{ergm}}, with the following additional or overridden
#' @param \dots Additional arguments passed to [ergm()].
#' @param control A [control.ergm.ego()] control list.
#' @param do.fit Whether to actually call [ergm()]
#' @return An object of class [`ergm.ego`] inheriting from
#' [`ergm`], with the following additional or overridden
#' elements:
#' \item{"v"}{Variance-covariance matrix of the estimate of the
#' sufficient statistics}
#' \item{"m"}{Estimate of the sufficient
#' statistics}
#' \item{"egor"}{The [`egor`] object passed}
#' \item{"popsize"}{Population network size used}
#' \item{"ppopsize"}{Pseudopopulation size used, see \code{\link{control.ergm.ego}}}
#' \item{"ppopsize"}{Pseudopopulation size used, see [control.ergm.ego()]}
#' \item{"coef"}{The
#' coefficients, along with the network size adjustment \code{netsize.adj}
#' coefficient.}
Expand All @@ -82,7 +82,7 @@
#' Models." \emph{Statistical Methodology}, 8(4): 319–339. \doi{10.1016/j.stamet.2011.01.005}
#'
#' @keywords models
#' @seealso \code{\link[ergm]{ergm}()}
#' @seealso [ergm()]
#' @examples
#' \donttest{
#' data(faux.mesa.high)
Expand Down
14 changes: 7 additions & 7 deletions R/gof.ergm.ego.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,24 @@
#' Conduct Goodness-of-Fit Diagnostics on a Exponential Family Random Graph
#' Model fit to Egocentrically Sampled Data
#'
#' \code{\link{gof.ergm.ego}} implements the \code{\link[ergm]{gof}} method for
#' \code{\link{ergm.ego}} fit objects.
#' [gof.ergm.ego()] implements the [gof()] method for
#' [`ergm.ego`] fit objects.
#'
#'
#' @param object An \code{\link{ergm.ego}} fit.
#' @param object An [`ergm.ego`] fit.
#' @param ... Additional arguments. Unused by [gof.ergm.ego()], passed to
#' [ergm::plot.gof()] by [plot.gof.ergm.ego()]
#' @param GOF A string specifying the statistics whose goodness of fit is to be
#' evaluated. Currently, only \dQuote{degree}, \dQuote{espartners} and \dQuote{model} are
#' implemented; see \code{\link[ergm]{gof}} documentation for details.
#' implemented; see [gof()] documentation for details.
#' @param control A list to control parameters, constructed using
#' \code{\link{control.gof.formula}} or \code{\link{control.gof.ergm}} (which
#' [control.gof.formula()] or [control.gof.ergm()] (which
#' have different defaults).
#' @param verbose Provide verbose information on the progress of the
#' simulation.
#' @return An object of class [`gof.ergm.ego`], inheriting from \code{\link[ergm:gof.ergm]{gof.ergm}}.
#' @return An object of class [`gof.ergm.ego`], inheriting from [gof.ergm()].
#' @author Pavel N. Krivitsky
#' @seealso For examples, see \code{\link{ergm.ego}}.
#' @seealso For examples, see [ergm.ego()].
#' @keywords models
#' @examples
#' \donttest{
Expand Down
23 changes: 11 additions & 12 deletions R/simulate.ergm.ego.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
################################################################################


#' Simulate from a \code{\link{ergm.ego}} fit.
#' Simulate from a [ergm.ego()] fit.
#'
#' A wrapper around \code{\link[ergm]{simulate.formula}} to simulate networks
#' from an ERGM fit using \code{\link{ergm.ego}}.
#'
#'
#' @param object An \code{\link{ergm.ego}} fit.
#' A wrapper around [simulate.formula()] to simulate networks
#' from an ERGM fit using [ergm.ego()].
#'
#'
#' @param object An [`ergm.ego`] fit.
#' @param nsim Number of realizations to simulate.
#' @template seed
#' @param popsize,basis A network size to which to scale the model for
Expand All @@ -24,23 +24,22 @@
#' actors; or a [`network`] object to use as is. `basis` is provided
#' for consistency with [ergm()], [ergm.ego()], [simulate.ergm()],
#' and others. If both are specified, `popsize` overrules.
#' @param control A \code{\link{control.simulate.ergm.ego}} control list.
#' @param control A [control.simulate.ergm.ego()] control list.
#' @param output one of `"network"`, `"stats"`, `"edgelist"`,
#' `"pending_update_network"`, or, for future compatibility,
#' `"ergm_state"`. See help for [simulate.ergm()] for explanation.
#'
#' @param constraints,\dots Additional arguments passed to \code{\link[ergm]{san}} and
#' \code{\link[ergm]{simulate.formula}}.
#' @param constraints,\dots Additional arguments passed to [san()] and
#' [simulate.formula()].
#' @template verbose
#' @return The ouput has the same format (with the same options) as
#' \code{\link[ergm]{simulate.formula}}. If \code{output="stats"} is passed, an
#' [simulate.formula()]. If \code{output="stats"} is passed, an
#' additional attribute, \code{"ppopsize"} is set, giving the actual size of
#' the network reconstructed, when the \code{pop.wt} control parameter is set
#' to \code{"round"} and \code{"popsize"} is not a multiple of the egocentric
#' sample size or the sampling weights.
#' @author Pavel N. Krivitsky
#' @seealso \code{\link[ergm]{simulate.formula}},
#' \code{\link[ergm]{simulate.ergm}}
#' @seealso [simulate.formula()], [simulate.ergm()]
#' @references
#'
#' * Pavel N. Krivitsky and Martina Morris (2017). "Inference for social network models from egocentrically sampled data, with application to understanding persistent racial disparities in HIV prevalence in the US." *Annals of Applied Statistics*, 11(1): 427–455. \doi{10.1214/16-AOAS1010}
Expand Down
Loading

0 comments on commit 945a413

Please sign in to comment.