gen.netglm: Simulate (generalized) linear network model data

View source: R/gen.netglm.R

gen.netglmR Documentation

Simulate (generalized) linear network model data

Description

Generates data based on a (generalized) linear network model, where the dependent variable can be either continuous or dichotomous. All the independent variables are dichotomous.

Usage

gen.netglm(
  n,
  m,
  family = "gaussian",
  intercept = FALSE,
  beta = NULL,
  red.var = NULL,
  seed = NULL,
  ...
)

Arguments

n

The size of the vertex set (|V(G)|) for the random graphs.

m

The number of graphs to generate.

family

Family of the generalized linear model used to generate the data. The available families are "gaussian" and "binomial".

intercept

Logical; should the intercept be simulated? FALSE by default.

beta

Values of the true coefficients used to generate the data. If intercept is TRUE, the first value in beta is considered to be the intercept. If not provided, the coefficients are randomly sampled from a standard normal distribution and the intercept is defined as the maximum between m/2 and the median of the beta coefficients. NULL by default.

red.var

Value of the residual variance used when the family is "gaussian". If not provided, the residual variance is set to 1.

seed

Integer used as the seed in the generation process. Allows the user to generate the same data consistently.

...

other arguments passed on to the function rgraph of the sna package.


timonelmer/netglm documentation built on Aug. 14, 2024, 9:39 p.m.