gm.analysis {gmvalid}R Documentation

Graphical model analysis

Description

Graphical model selection by different selection strategies. The selected graph is plotted where line thickness corresponds to an optional edge measure.

Usage

gm.analysis(data, edge.measure = c("gamma.cond", "marg.gamma", "cor", "boot",
            "cov", "p.value"), program = c("coco", "mim"),
            strategy = c("backwards", "forwards", "eh"), 
            plot.significant = TRUE, boot.N = 100, ...)

Arguments

data Data frame or array. Variables need to be discrete and should have names.
edge.measure One of "gamma.cond", "marg.gamma", "cor", "boot", "cov", "p.value". To be plotted in the graph. May be abbreviated. See details.
program Selects whether MIM or the CoCo package is used for model selection. Calls either the function gm.coco or gm.mim. May be abbreviated.
strategy See gm.coco or gm.mim.
plot.significant If TRUE only significant edges in the selected models are plotted (in solid lines). If FALSE also not significant edges are plotted as dashed lines.
boot.N Only required if edge.measure is "boot". Specifies the number of bootstrap replications.
... Further options of gm.coco or gm.mim can be given.

Details

Different edge measures:
"gamma.cond" - Conditional gamma coefficient, calls gm.gamma with type = conditional.
"marg.gamma" - Marginal gamma coefficient, calls gm.gamma with type = marginal.
"cor" - Pearson's correlation coefficient, calls cor.
"boot" - calls gm.boot.mim or gm.boot.coco depending on the choice of program. boot.N bootstrap replications will be done. Plots the relative edge frequency.
"cov" - Pearson's covariance, calls cov.
"p.value" - is only available if program choice was "mim". Then plot.significant is set to TRUE since the p-value is only available for edges present in the model. In this case the edges will be plotted thinner the smaller the p-value.

Value

A list containing:

"strategy" One of "backwards","forwards" and "eh".
"model" String vector of the accepted and plotted models.
"edge.measure" Character string indicating what type of edge measure was performed.
"analysis" Upper-tri matrix of the respective edge measures.
"variable names" Matrix that assigns a letter to each variable that is used in the model formulas.

Author(s)

Fabian Sobotka, Marc Suling, Ronja Foraita
Bremen Institute for Prevention Research and Social Medicine
(BIPS) http://www.bips.uni-bremen.de

See Also

gm.plot, gm.coco, gm.mim

Examples

  data(wam)
  gm.analysis(wam)
  
  ### showing various options in action
  gm.analysis(wam,program="c",strategy="f",edge.measure="b",
    boot.N=50,plot.significant=FALSE,recursive=TRUE,follow=TRUE,decomposable.mode=TRUE)
  ### Example works!
## Not run: 
              
  gm.analysis(wam,program="m",edge.measure="p",options="u")
  
## End(Not run)

[Package gmvalid version 1.2 Index]