# gmG: Graphical Model 8-Dimensional Gaussian Example Data In pcalg: Methods for Graphical Models and Causal Inference

## Description

These two data sets contain a matrix containing information on eight gaussian variables and the corresonding DAG model.

## Usage

 `1` ```data(gmG) ```

## Format

`gmG` and `gmG8` are each a `list` of two components

x:

a numeric matrix 5000 * 8.

g:

a graph, i.e., of formal `class` `"graphNEL"` from package graph with 6 slots
.. [email protected] nodes : chr [1:8] "1" "2" "3" "4" ...
.. [email protected] edgeL :List of 8
........

## Details

The data was generated as indicated below. First, a random DAG model was generated, then 5000 samples were drawn from “almost” this model, for `gmG`: In the previous version, the data generation `wgtMatrix` had the non-zero weights in reversed order for each node. On the other hand, for `gmG8`, the correct weights were used in all cases

## Source

The data set is `identical` to the one generated by

 ``` 1 2 3 4 5 6 7 8 9 10``` ``` ## Used to generate "gmG" set.seed(40) p <- 8 n <- 5000 ## true DAG: vars <- c("Author", "Bar", "Ctrl", "Goal", paste0("V",5:8)) gGtrue <- randomDAG(p, prob = 0.3, V = vars) gmG <- list(x = rmvDAG(n, gGtrue, back.compatible=TRUE), g = gGtrue) gmG8 <- list(x = rmvDAG(n, gGtrue), g = gGtrue) ```

## Examples

 ```1 2 3 4 5 6 7 8 9``` ```data(gmG) str(gmG, max=3) stopifnot(identical(gmG \$ g, gmG8 \$ g)) if(dev.interactive()) { ## to save time in tests round(as(gmG \$ g, "Matrix"), 2) # weight ("adjacency") matrix plot(gmG \$ g) pairs(gmG\$x, gap = 0, panel=function(...) smoothScatter(..., add=TRUE)) } ```

### Example output

```List of 2
\$ x: num [1:5000, 1:8] 0.181 0.354 0.504 0.701 -0.705 ...
\$ g:Formal class 'graphNEL' [package "graph"] with 6 slots
.. ..@ nodes     : chr [1:8] "Author" "Bar" "Ctrl" "Goal" ...
.. ..@ edgeL     :List of 8
.. ..@ edgeData  :Formal class 'attrData' [package "graph"] with 2 slots
.. ..@ nodeData  :Formal class 'attrData' [package "graph"] with 2 slots
.. ..@ renderInfo:Formal class 'renderInfo' [package "graph"] with 4 slots
.. ..@ graphData :List of 1
```

pcalg documentation built on June 5, 2018, 1:05 a.m.