Skip to content

Commit

Permalink
fix extractions from fit object
Browse files Browse the repository at this point in the history
  • Loading branch information
martinamorris committed Jul 13, 2024
1 parent 56931aa commit e3ae138
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions inst/shiny/statnetWeb/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ cugstats <- function(x, term, directed, loops) {
# Takes an ergm object and gathers some of the information from
# summary.ergm, in preparation to be passed to the function
# coef.comparison.
# NOTE: this is not very robust to changes in the fit object structure
ergm.info <- function(object) {
coefs <- object$coef
terms <- names(object$coef)
coefmatrix <- summary(object)$coefs
pval <- coefmatrix[, 4]
coefs <- coef(object)
terms <- names(coefs)
coefmatrix <- summary(object)$coefficients
pval <- coefmatrix[, 5]
signif.stars <- symnum(pval, corr = FALSE, na = FALSE,
cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1),
symbols = c("***", "**", "*", ".", " "), legend = F)
Expand All @@ -90,8 +91,8 @@ ergm.info <- function(object) {
ans[i] <- starredcoef[count]
count <- count + 1
}
ans$AIC <- format(summary(object)$aic, digits = 3)
ans$BIC <- format(summary(object)$bic, digits = 3)
ans$AIC <- format(AIC(object)[1], digits = 3)
ans$BIC <- format(BIC(object)[1], digits = 3)
ans
}

Expand Down

0 comments on commit e3ae138

Please sign in to comment.