mgm (version 1.2-14)

showInteraction: Retrieving details of interactions

Description

Retrieves details of a specified interaction from mgm model objects.

Usage

showInteraction(object, int)

Value

variables

Integer vector returning the variables specified via the argument int

type

Character vector returning the type of the specified variables variables

level

Integer vector returning the number of levels of the specified variables variables

parameters

A list of length equal to the order k of the specified interaction. The entries contain the set of parameters obtained from the nodewise regressions on the k variables. Depending on the type of the variables in the interaction, these sets can obtain one or several parameters. For details see ?mgm or Haslbeck & Waldorp (2017).

Arguments

object

The output of one of the estimation functions mgm(), tvmgm(), mvar(), tvmvar().

int

An integer vector specifying the interaction. For mVAR models, this vector has length 2. For MGMs the vector can be larger to request details of interaction of order > 2.

Author

Jonas Haslbeck <jonashaslbeck@gmail.com>

Details

Currently the function only returns details of pairwise interactions from output objects of mgm().

References

Haslbeck, J. M. B., & Waldorp, L. J. (2020). mgm: Estimating time-varying Mixed Graphical Models in high-dimensional Data. Journal of Statistical Software, 93(8), pp. 1-46. DOI: 10.18637/jss.v093.i08

See Also

mgm, tvmgm, mvar, tvmvar

Examples

Run this code

if (FALSE) {


## We fit a pairwise and 3-order MGM to the mixed Autism dataset (?autism_data)

# 1) Fit Pairwise MGM

# Call mgm()
fit_d2 <- mgm(data = autism_data$data,
              type = autism_data$type,
              level = autism_data$lev,
              k = 2) # ad most pairwise interacitons

# Weighted adjacency matrix
fit_d2$pairwise$wadj # for instance, we see there is an interaction 1-2

# 2) Look at details of interaction 1-2
showInteraction(object = fit_d2, 
                int = c(1, 2))

# For more examples see https://github.com/jmbh/mgmDocumentation

}


Run the code above in your browser using DataLab