Skip to content
Permalink
Browse files

added network regression functions

  • Loading branch information...
gi0na committed Sep 1, 2019
1 parent f360114 commit b9ac378560f3a261b3fc49d1b145161883f50424
Showing with 9,868 additions and 5 deletions.
  1. +1 −0 .gitignore
  2. +8 −4 DESCRIPTION
  3. +30 −0 NAMESPACE
  4. +82 −0 R/auxilliary.R
  5. +46 −0 R/createPredictors.R
  6. +375 −0 R/endogenousstats.R
  7. +52 −0 R/err.R
  8. +41 −0 R/nr.ci.R
  9. +42 −0 R/nr.significance.R
  10. +338 −0 R/nrm.R
  11. +260 −0 R/nrmSelection.R
  12. +124 −0 R/print.R
  13. 0 R/residuals.nrm.R
  14. +135 −0 R/stats.R
  15. +2 −0 README.md
  16. BIN data/cospons_mat.RData
  17. BIN data/dt.RData
  18. BIN data/dtcommittee.RData
  19. BIN data/highschool.multiplex.rda
  20. BIN data/highschool.predictors.rda
  21. BIN data/onlinesim_mat.RData
  22. +45 −0 man/Jn.Rd
  23. +26 −0 man/RMSE.Rd
  24. +26 −0 man/RMSLE.Rd
  25. +6 −1 man/as.ghype.Rd
  26. +17 −0 man/checkGraphtype.Rd
  27. +25 −0 man/coef.nrm.Rd
  28. +14 −0 man/cospons_mat.Rd
  29. +24 −0 man/coxsnellR2.Rd
  30. +22 −0 man/createPredictors.Rd
  31. +22 −0 man/createPredictors.list.Rd
  32. +18 −0 man/dt.Rd
  33. +15 −0 man/dtcommittee.Rd
  34. +19 −0 man/err.Rd
  35. +38 −0 man/findMDL.Rd
  36. +49 −0 man/fnM.Rd
  37. +46 −0 man/homophily_stat.Rd
  38. +34 −0 man/mcfaddenR2.Rd
  39. +38 −0 man/minAIC.Rd
  40. +43 −0 man/nr.ci.Rd
  41. +42 −0 man/nr.significance.Rd
  42. +89 −0 man/nrm.Rd
  43. +52 −0 man/nrmChoose.Rd
  44. +60 −0 man/nrmSelection.Rd
  45. +15 −0 man/onlinesim_mat.Rd
  46. +31 −0 man/predict.nrm.Rd
  47. +24 −0 man/print.nrm.Rd
  48. +25 −0 man/print.nrm.selection.Rd
  49. +42 −0 man/reciprocity_stat.Rd
  50. +30 −0 man/residuals.nrm.Rd
  51. +53 −0 man/sharedPartner_stat.Rd
  52. +19 −0 man/summary.nrm.Rd
  53. +19 −0 man/summary.nrm.selection.Rd
  54. +19 −0 man/vcov.nrm.Rd
  55. +687 −0 vignettes/Tutorial_NRM.Rmd
  56. +6,598 −0 vignettes/bibliography.bib
  57. BIN vignettes/images/tikz_nweffects.pdf
@@ -8,3 +8,4 @@ inst/doc
/vignettes/.gitignore
/hypernets.Rproj
/CRAN-RELEASE
/R/.DS_Store
@@ -1,12 +1,14 @@
Package: ghypernet
Type: Package
Title: R Implementation of the Generalised Hypergeometric Ensemble of Random Graphs
Version: 0.5.1
Date: 2019-02-15
Version: 0.8.999
Date: 2019-09-1
Authors@R: c(
person("Giona", "Casiraghi", email = "giona@ethz.ch",
role = c("aut", "cre"), comment = c(ORCID = "0000-0003-0233-5747")),
person("Vahan", "Nanumyan", email = "vahan@ethz.ch",
role = c('aut'), comment = c(ORCID = "0000-0001-9054-3217")),
person("Laurence", "Brandenberger", email = "lbrandenberger@ethz.ch",
role = c('aut'), comment = c(ORCID = "0000-0001-9054-3217"))
)
URL: http://ghyper.net
@@ -27,9 +29,11 @@ Imports: parallel,
purrr,
extraDistr,
dplyr,
reshape2
Suggests: BiasedUrn, igraph, knitr, rmarkdown
reshape2,
rootSolve
Suggests: BiasedUrn, igraph, knitr, rmarkdown, GGally, ggplot2, texreg
VignetteBuilder: knitr
Encoding: UTF-8
RoxygenNote: 6.1.1
Language: en-GB
LazyData: true
@@ -1,33 +1,63 @@
# Generated by roxygen2: do not edit by hand

S3method(as.ghype,list)
S3method(as.ghype,nrm)
S3method(coef,nrm)
S3method(createPredictors,list)
S3method(ghype,default)
S3method(ghype,igraph)
S3method(ghype,matrix)
S3method(logLik,ghype)
S3method(logl,ghype)
S3method(logl,matrix)
S3method(nrm,default)
S3method(nrmSelection,default)
S3method(nrmSelection,nrmpredictor)
S3method(predict,nrm)
S3method(print,bccm)
S3method(print,ghype)
S3method(print,nrm)
S3method(print,nrm.selection)
S3method(residuals,nrm)
S3method(summary,nrm)
S3method(summary,nrm.selection)
export(BootstrapProperty)
export(ComputeXi)
export(CreateIgGraphs)
export(FitOmega)
export(RMSE)
export(RMSLE)
export(adj2el)
export(as.ghype)
export(bccm)
export(conf.test)
export(coxsnellR2)
export(createPredictors)
export(el2adj)
export(ghype)
export(gof.test)
export(homophily_stat)
export(isNetwork)
export(linkSignificance)
export(logl)
export(loglratio)
export(lr.test)
export(mat2vec.ix)
export(mcfaddenR2)
export(nr.ci)
export(nr.significance)
export(nrm)
export(nrmChoose)
export(nrmSelection)
export(reciprocity_stat)
export(regularm)
export(rghype)
export(scm)
export(sharedPartner_stat)
export(vec2mat)
import(dplyr)
importFrom(stats,coef)
importFrom(stats,predict)
importFrom(stats,residuals)
importFrom(utils,setTxtProgressBar)
importFrom(utils,txtProgressBar)
@@ -93,3 +93,85 @@ check_specs.matrix <- function(object, ...){
#' @format a 34-vector with the assignment of nodes to faction 1 or 2
#' @source package `igraphdata`
"vertexlabels"

#' Swiss MPs committee similarity matrix.
#'
#' **onlinesim_mat**: a similarity matrix of how similar two MPs are in their online
#' social media presence (shared supportees).
#'
#' @docType data
#'
#' @usage data(onlinesim_mat)
#'
#' @format 163x163 similarity matrix
#'
#' @keywords datasets
#'
# #' @references
# #' (\href{}{})
#'
# #' @source \href{}{}
#'
"onlinesim_mat"

#' Swiss MPs committee affiliation data frame.
#'
#' **dtcommittee**: a list of committees each MP was part of during their stay in
#' parliament
#'
#' @docType data
#'
#' @usage data(dtcommittee)
#'
#' @format 163x2 data.frame
#'
#' @keywords datasets
#'
# #' @references
# #' (\href{}{})
#'
# #' @source \href{}{}
#'
"dtcommittee"

#' Swiss MPs attribute data frame.
#'
#' **dt**: contains different attributes of the 163 MPs, such as their names,
#' their party affiliation (variable: *party*), their parliamentary group
#' affiliation (variable: *parlGroup*), the Canton (or state) they represent
#' (variable: *canton*), their gender (variable: *gender*)
#' and date of birth (variable: *birthdate*).
#'
#' @docType data
#'
#' @usage data(dt)
#'
#' @format 163x8 data.frame
#'
#' @keywords datasets
#'
# #' @references
# #' (\href{}{})
#'
# #' @source \href{}{}
#'
"dt"

#' Swiss MPs network adjacency matrix
#'
#' **cospons_mat**: contains the adjacency matrix of 163 x 163 MPs.
#'
#' @docType data
#'
#' @usage data(cospons_mat)
#'
#' @format 163x163 adjacency matrix
#'
#' @keywords datasets
#'
# #' @references
# #' (\href{}{})
#'
# #' @source \href{}{}
#'
"cospons_mat"
@@ -0,0 +1,46 @@
#' Create a nrmpredictor object from passed argument
#'
#' @param predictors the dataframe or list of predictors for to apply nrm model selection
#'
#' @return nested list of nrmpredictor class
#' @export
#'
#' @examples
#' data('highschool.predictors')
#' predictors <- createPredictors(highschool.predictors)
#'
createPredictors <- function(predictors,
...) {
UseMethod("createPredictors")
}


#' Create a nrmpredictor object from list
#'
#' @param predictors the dataframe or list of predictors for to apply nrm model selection
#'
#' @return nested list of nrmpredictor class
#' @export
#'
#' @examples
#' data('highschool.predictors')
#' predictors <- createPredictors(highschool.predictors)
#'

createPredictors.list <- function(predictors,
...) {
cat("Creating predictors list...")
predictors <- lapply(X = predictors,
FUN = list)
for (i in 1:length(predictors)) names(predictors[[i]]) <- names(predictors)[i]
class(predictors) <- "nrmpredictor"
return(predictors)
}

# createPredictors.data.frame <-
# function(predictor, ...){
# ##TODO }

# createPredictors.matrix <-
# function(predictor, ...){
# ##TODO }

0 comments on commit b9ac378

Please sign in to comment.
You can’t perform that action at this time.