monanDataCreate: monanDataCreate

View source: R/3b_wrapperFunctions.R

monanDataCreateR Documentation

monanDataCreate

Description

A function to create a monan process state, i.e., a MoNAn object that stores all information about the data that will be used in the estimation. This includes the outcome variable (edgelist), the nodesets, and all covariates.

Usage

monanDataCreate(..., fixedEffectDummies = FALSE)

Arguments

...

The monan objects to be included in the process State. This must include exactly one edgelist (dependent variable) and the two nodesets associated with the edgelist. Further allowed elements are (monadic or dyadic) covariates of locations and people

fixedEffectDummies

Add dummy variable for each location (minus the first) in the process state (data object), so that fixed effects to control the indegree of every location can be modelled directly. The dummies are named "dummy2", "dummy3", etc., and can be added to the model with addDummyEffects() (or its alias addFixedEffects()).

Value

An object of class "processState.monan".

Examples

# create objects (which are later combined to the process state)
transfers <- createEdgelist(mobilityEdgelist,
  nodeSet = c("organisations", "organisations", "people")
)
people <- createNodeSet(1:nrow(mobilityEdgelist))
organisations <- createNodeSet(1:length(orgRegion))
sameRegion <- outer(orgRegion, orgRegion, "==") * 1
sameRegion <- createNetwork(sameRegion,
  nodeSet = c("organisations", "organisations")
)
region <- createNodeVariable(orgRegion, nodeSet = "organisations")
size <- createNodeVariable(orgSize, nodeSet = "organisations", addSim = TRUE)
sex <- createNodeVariable(indSex, nodeSet = "people")

monanDataCreate(transfers, people, organisations, 
                sameRegion, region, size, sex)

MoNAn documentation built on Oct. 11, 2026, 5:09 p.m.