gm.analysis {gmvalid} | R Documentation |
Graphical model selection by different selection strategies. The selected graph is plotted where line thickness corresponds to an optional edge measure.
gm.analysis(data, edge.measure = c("gamma.cond", "marg.gamma", "cor", "boot", "cov", "p.value"), program = c("mim", "coco"), strategy = c("backwards", "forwards", "eh"), plot.significant = TRUE, boot.N = 100, ...)
data |
Data frame or a table (array) with at least 2 denominated variables. |
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. |
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. The relative edge frequency will be plotted next to it.
"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.
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 with the result of the edge measure values. |
"variable names" |
Matrix that assigns a letter to each variable that is used in the model formulas. |
The option boot
may take some time depending on the size of boot.N
.
Fabian Sobotka, Marc Suling, Ronja Foraita
Bremen Institute for Prevention Research and Social Medicine
(BIPS) http://www.bips.uni-bremen.de
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) gm.analysis(wam,edge.measure="p",options="u")