Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ergm.ego to use statnet.data #71

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,22 @@ Imports:
dplyr,
survey,
stats,
methods
methods,
statnet.data
Suggests:
testthat (>= 2.1.1),
covr (>= 3.2.1)
Description: Utilities for managing egocentrically sampled network data and a wrapper around the 'ergm' package to facilitate ERGM inference and simulation from such data. See Krivitsky and Morris (2017) <doi:10.1214/16-AOAS1010>.
License: GPL-3 + file LICENSE
URL: https://statnet.org
BugReports: https://github.com/statnet/ergm.ego/issues
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
Remotes:
github::statnet/rle@master,
github::statnet/statnet.common@master,
github::statnet/network@master,
github::statnet/ergm@master,
github::tilltnet/egor
github::tilltnet/egor,
github::statnet/statnet.data
2 changes: 1 addition & 1 deletion R/EgoStat.node.attr.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ NULL
#' combination.
#'
#' @examples
#' data(florentine)
#' data(flomarriage, package="statnet.data")
#' flomego <- as.egor(flomarriage)
#' ergm.ego_get_vattr("priorates", flomego)
#' ergm.ego_get_vattr(~priorates, flomego)
Expand Down
4 changes: 2 additions & 2 deletions R/degreedist.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#' \code{\link[ergm:summary_formula]{summary}}
#' @examples
#'
#' data(faux.mesa.high)
#' data(faux.mesa.high, package="statnet.data")
#' fmh.ego <- as.egor(faux.mesa.high)
#'
#' degreedist(fmh.ego,by="Grade",brgmod=TRUE)
Expand Down Expand Up @@ -177,7 +177,7 @@ degreedist.egor <- function(object, freq = FALSE, prob = !freq,
#' \code{\link[ergm.ego]{summary}} method for egocentric data
#' @examples
#'
#' data(faux.mesa.high)
#' data(faux.mesa.high, package="statnet.data")
#' fmh.ego <- as.egor(faux.mesa.high)
#'
#' (mm <- mixingmatrix(faux.mesa.high,"Grade"))
Expand Down
4 changes: 2 additions & 2 deletions R/egor.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ as.egor.network<-function(x,special.cols=c("na"),...){
#' @examples
#'
#'
#' data(faux.mesa.high)
#' data(faux.mesa.high, package="statnet.data")
#' summary(faux.mesa.high, print.adj = FALSE)
#'
#' fmh.ego <- as.egor(faux.mesa.high)
Expand Down Expand Up @@ -211,7 +211,7 @@ na.omit.egor <- function(object, relevant=TRUE, ...){
#'
#' @examples
#'
#' data(faux.mesa.high)
#' data(faux.mesa.high, package="statnet.data")
#' fmh.ego <- as.egor(faux.mesa.high)
#'
#' # Create a tiny weighted sample:
Expand Down
2 changes: 1 addition & 1 deletion R/ergm.ego.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#' @seealso \code{\link[ergm]{ergm}()}
#' @examples
#' \donttest{
#' data(faux.mesa.high)
#' data(faux.mesa.high, package="statnet.data")
#' fmh.ego <- as.egor(faux.mesa.high)
#'
#' head(fmh.ego)
Expand Down
2 changes: 1 addition & 1 deletion R/fmhfit.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#'
#' @examples
#' \dontrun{
#' data(faux.mesa.high)
#' data(faux.mesa.high, package="statnet.data")
#' fmh.ego <- egor::as.egor(faux.mesa.high)
#' fmhfit <- ergm.ego(
#' fmh.ego ~ edges + degree(0:3) +
Expand Down
2 changes: 1 addition & 1 deletion R/gof.ergm.ego.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
#' @keywords models
#' @examples
#' \donttest{
#' data(faux.mesa.high)
#' data(faux.mesa.high, package="statnet.data")
#' fmh.ego <- as.egor(faux.mesa.high)
#'
#' head(fmh.ego)
Expand Down
2 changes: 1 addition & 1 deletion R/simulate.ergm.ego.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#' @keywords models
#' @examples
#'
#' data(faux.mesa.high)
#' data(faux.mesa.high, package="statnet.data")
#' fmh.ego <- as.egor(faux.mesa.high)
#' data(fmhfit)
#' colMeans(egosim <- simulate(fmhfit, popsize=300,nsim=50,
Expand Down
2 changes: 1 addition & 1 deletion R/summary.statistics.egor.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#'
#' @examples
#'
#' data(faux.mesa.high)
#' data(faux.mesa.high, package="statnet.data")
#' fmh.ego <- as.egor(faux.mesa.high)
#' (nw.summ <- summary(faux.mesa.high~edges+degree(0:3)+nodematch("Race")+
#' nodematch("Sex")+absdiff("Grade")+nodemix("Grade")))
Expand Down
2 changes: 1 addition & 1 deletion data-raw/fmhfit.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library(ergm.ego)

data(faux.mesa.high)
data(faux.mesa.high, package="statnet.data")
fmh.ego <- egor::as.egor(faux.mesa.high)
fmhfit <- ergm.ego(
fmh.ego ~ edges + degree(0:3) +
Expand Down
2 changes: 1 addition & 1 deletion man/degreedist.egor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/ergm.ego.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/fmhfit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/gof.ergm.ego.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mixingmatrix.egor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/nodal_attributes-API.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/sample.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/simulate.ergm.ego.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/summary_formula.egor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/template_network.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-boot_jack.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Copyright 2015-2021 Statnet Commons
################################################################################

data(faux.mesa.high)
data(faux.mesa.high, package="statnet.data")
fmh.ego <- as.egor(faux.mesa.high)


Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-coef_recovery.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
test_that("complete ERGM and ergm.ego() give similar coef estimates",{
ergm.ego:::long_test()

data(faux.mesa.high)
data(faux.mesa.high, package="statnet.data")
fmh.ego <- egor::as.egor(faux.mesa.high)

fit <- ergm(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-degreedist.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test_that("degreedist() works on egor::egor32 data with `by=sex` (a factor)", {

# Tests using ergm::faux.mesa.high data -----------------------------------

data(faux.mesa.high, package="ergm")
data(faux.mesa.high, package="statnet.data")
fmh.ego <- as.egor(faux.mesa.high)

test_that("degreedist() works on data based on faux.mesa.high", {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-gof.ergm.ego.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ test_that("GOF='espartners' works", {


test_that("GOF='espartners' works if `esp` term is in the model", {
data("faux.mesa.high", package="ergm")
data("faux.mesa.high", package="statnet.data")
edata <- as.egor(faux.mesa.high)
fit <- ergm.ego(
edata ~ edges + esp(1),
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-mixingmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ for ( v in varnames ) {
# })

test_that("mixing matrices for FMH and egoFMH are equivalent", {
data("faux.mesa.high")
data("faux.mesa.high", package="statnet.data")
fmh.ego <- as.egor(faux.mesa.high)
expect_equal(
{
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-netsize.adj.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# Copyright 2015-2021 Statnet Commons
################################################################################
data(sampson, package="ergm")
data(samplike, package="statnet.data")

for(i in 1:10) {
set.seed(i)
Expand All @@ -30,7 +30,7 @@ for(i in 1:10) {
})
}

data(faux.mesa.high, package="ergm")
data(faux.mesa.high, package="statnet.data")

for(i in 1:10) {
set.seed(i)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-predict.ergm.ego.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
library(ergm.ego)

test_that("it just works for model without offsets", {
data(faux.mesa.high, package="ergm")
data(faux.mesa.high, package="statnet.data")
fmh.ego <- as.egor(faux.mesa.high)
egofit <- ergm.ego(
fmh.ego~edges+degree(0:3)+nodefactor("Race")+nodematch("Race")
Expand All @@ -26,7 +26,7 @@ test_that("it just works for model without offsets", {


test_that("it just works for model with offsets", {
data("faux.mesa.high", package="ergm")
data("faux.mesa.high", package="statnet.data")
fmhego <- as.egor(faux.mesa.high)
fit <- ergm.ego(
fmhego ~ edges
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-table_ppop.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_that("estimation works", {

skip("Not yet fixed")

data(faux.mesa.high)
data(faux.mesa.high, package="statnet.data")
fmh.ego <- as.egor(faux.mesa.high)
ppop <- rbind(fmh.ego, fmh.ego)
ppop$.alts <- NULL
Expand Down