Learn R Programming

MoNAn (version 1.1.0)

createProcessState: createProcessState

Description

Creates the "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

createProcessState(elements, dependentVariable)

Value

An object of class "processState.monan".

Arguments

elements

A named list of the outcome variable (edgelist), the nodesets, and all covariates that contain the information about the data that will be used in the estimation.

dependentVariable

The name of the outcome variable (edgelist) as specified under "elements". This indicates what outcome the researcher is interested in.

See Also

createEdgelist(), createNodeSet(), createNodeVariable(), createNetwork()

Examples

Run this code
# Create a process state out of the mobility data objects:
# 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")

# combine created objects to the process state
myState <- createProcessState(list(
    transfers = transfers,
    people = people,
    organisations = organisations,
    sameRegion = sameRegion,
    region = region,
    size = size,
    sex = sex),
  dependentVariable = "transfers")

Run the code above in your browser using DataLab