nrm is used to fit multi-edge network regression models.

nrm(
  w,
  adj,
  xi = NULL,
  pval = 0.01,
  directed = TRUE,
  selfloops = TRUE,
  regular = FALSE,
  ...
)

# S3 method for default
nrm(
  w,
  adj,
  xi = NULL,
  pval = 0.01,
  directed = FALSE,
  selfloops = FALSE,
  regular = FALSE,
  ci = TRUE,
  significance = FALSE,
  null = FALSE,
  init = NULL,
  ...
)

# S3 method for nrm
print(x, suppressCall = FALSE, ...)

Arguments

w

an object of class 'list' containing the predictors layers (explanatory variables/covariates) of the multiplex, passed as adjacency matrices. The entries of the list can be named.

adj

matrix. The adjacency matrix of the response network (dependent variable).

xi

optional matrix. Passes a non-standard \(\Xi\) matrix.

pval

the significance level used to compute confidence intervals of the parameters. Per default, set to 0.01.

directed

logical. If TRUE the response variable is considered the adjacency matrix of directed graph. If FALSE only the upper triangular of adj is considered. Default set to FALSE.

selfloops

logical. Whether selfloops are allowed. Default set to FALSE.

regular

logical. Whether the gHypEG regression should be performed with correction of combinatorial effects (TRUE) or without (FALSE).

...

optional arguments to print or plot methods.

ci

logical. Whether to compute confidences for the parameters. Defaults to TRUE.

significance

logical. Whether to test the model significance against the null by means of lr-test.

null

logical. Is this a null model? Used for internal routines.

init

numeric. Vector of initial values used for numerical MLE. If only a single value is passed, this is repeated to match the number of predictors in w.

x

object of class 'nrm'

suppressCall

logical, indicating whether to print the call that generated x

Value

nrm returns an object of class 'nrm'.

The function summary is used to obtain and print a summary and analysis of the results. The generic accessory functions coefficients, etc, extract various useful features of the value returned by nrm.

An object of class 'nrm' is a list containing at least the following components:

coef

a named vector of coefficients.

confint

a named matrix with confidence intervals and standard deviation for each coefficient.

omega

the estimated propensity matrix.

xi

the matrix of possibilities.

loglikelihood

log-likelihood of the estimated model.

AIC

AIC of the estimated model.

R2

Mc Fadden pseudo R-squared

csR2

Cox and Snells pseudo R-squared

significance

the p-value of the likelihood-ratio test for the estimated model against the null.

Methods (by class)

  • nrm(default): Default method for nrm

Methods (by generic)

  • print(nrm): Print method for elements of class 'nrm'.

References

Casiraghi, Giona. 'Multiplex Network Regression: How do relations drive interactions?.' arXiv preprint arXiv:1702.02048 (2017).

See also

nrm

Author

Giona Casiraghi

Examples


## For a complete example see the vignette

data('highschool.predictors')

highschool.m <- nrm(w=highschool.predictors[1], adj=contacts.adj, directed=FALSE,
  selfloops=FALSE)

highschool.m
#> Call:
#> nrm.default(w = highschool.predictors[1], adj = contacts.adj, 
#>     directed = FALSE, selfloops = FALSE)
#> 
#> Coefficients:
#>         Estimate   Std.Err t value    Pr(>t)    
#> gender 0.3160804 0.0021095  149.84 < 2.2e-16 ***
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> R2:
#>  McFadden R2 Cox Snell R2 
#>   0.01717056   0.11851816 

# \donttest{
data('highschool.predictors')

highschool.m <- nrm(w=highschool.predictors, adj=contacts.adj, directed=FALSE,
  selfloops=FALSE)

highschool.m
#> Call:
#> nrm.default(w = highschool.predictors, adj = contacts.adj, directed = FALSE, 
#>     selfloops = FALSE)
#> 
#> Coefficients:
#>              Estimate    Std.Err t value    Pr(>t)    
#> gender      0.0773066  0.0021205  36.456 < 2.2e-16 ***
#> class       1.3920467  0.0047051 295.862 < 2.2e-16 ***
#> topic       0.9996831  0.0089452 111.757 < 2.2e-16 ***
#> friendship  0.6958169  0.0024252 286.905 < 2.2e-16 ***
#> facebook   -0.0886211  0.0023652  37.469 < 2.2e-16 ***
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> R2:
#>  McFadden R2 Cox Snell R2 
#>    0.5474069    0.9800463 
# }