Description Usage Arguments Details Value Additional arguments Author(s) References Examples
Fit a Gaussian Graphical Model to continuous-valued dataset employing a subset of methods from stepwise AIC, stepwise BIC, stepwise significance test, partial correlation thresholding, edgewise significance test, or glasso. Also visualizes the fitted Graphical Model.
1 2 |
data |
A normalized dataframe or matrix with no missing data of continuous measurements. |
methods |
A string or list of strings indicate methods used to construct the model. See the details for more information. (default = "glasso") |
community |
A logical value to show if the node communities should be detected and colored in the returned graph. (default = TRUE) |
betweenness |
A logical value to show if the node betweenness measurements should be computed and returned from the function. (default = TRUE) |
plot |
A logical value to show if the graph should be plotted. (default = FALSE) |
levels |
An integer value indicating the maximum number of levels of a categorical variable. To be used to distinguish the categorical variable.
Defaults to NULL because it is supposed that |
... |
Any additional arguments. |
The function combines the methods to construct the model, that is, the edge set is the intersection of all edge sets each of which is found by a method. The package gRim is used to implement AIC, BIC, and stepwise significance test. The method glasso from the package glasso is used to provide a sparse estimation of the inverse covariance matrix.
A list in which each element is the details of a specific fitting method.
significance |
A data.frame containing edges with p.values. |
graph |
an igraph object of the graphical model. |
betweenness |
betweenness measurements of each node. |
network |
a visNetwork plot of the graph. |
communities |
a named vector indicating the community of each node. |
A threshold for partial correlation thresholding method (default = 0.05). To be used only when the method "threshold" is used.
A cutoff for edge significance (default = 0.05). To be used only when the method "significance" is used.
(Non-negative) regularization parameter for glasso (default = 0.1). To be used only when the method "glasso" is used.
Elyas Heidari
Højsgaard, S., Edwards, D., & Lauritzen, S. (2012). Graphical Models with R. Springer US. https://doi.org/10.1007/978-1-4614-2299-0
Friedman, J., Hastie, T., & Tibshirani, R. (2007). Sparse inverse covariance estimation with the graphical lasso. Biostatistics, 9(3), 432–441. https://doi.org/10.1093/biostatistics/kxm045
Abreu, G. C. G., Edwards, D., & Labouriau, R. (2010). High-Dimensional Graphical Model Search with thegRapHDRPackage. Journal of Statistical Software, 37(1). https://doi.org/10.18637/jss.v037.i01
1 2 3 4 5 6 7 8 9 10 | data("NHANES")
## Using raw data
## No need to choose the continuous variables (They will be detected automatically)
glasso_ggm <- ggm(data = NHANES[1:1000, ], methods = c("glasso"), levels = 15)
## Using preprocessed data
data <- data_preproc(NHANES, levels = 15)
data$SEQN <- NULL
glasso_sin_ggm <- ggm(data = data[1:1000, 1:74], methods = c("glasso", "sin"),
plot = TRUE, rho = 0.2, significance = 0.03)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.