This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("qgraph") | |
# https://twitter.com/EikoFried/status/1208502815099932685 | |
# Symposia: | |
Symposia <- list( | |
# 1. | |
centrality = c("Eiko Fried", "Ciaran O'Driscoll", "Joshua Buckman", "Donald Robinaugh", "Teague Henry", "Laura Bringmann"), | |
computational = c("Julian Burger", "Donald Robinaugh", "Lucy Robinson", "Jonas Haslbeck", "Teague Henry", "Sacha Epskamp"), | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage[ | |
paperwidth=27cm,paperheight=13cm, | |
margin=1cm, | |
]{geometry} | |
\usepackage{amsmath} | |
\usepackage{amsfonts} | |
\usepackage{amssymb} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("bootnet") | |
library("mvtnorm") | |
library("qgraph") | |
# Sample size: | |
n <- 40000 | |
# Generate 10-node chain graph with positive edges: | |
net <- genGGM(10, propPositive = 1, constant = 1.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("SEset") | |
library("qgraph") | |
library("pcalg") | |
# For true DAG: | |
A <- matrix(c( | |
0,0.25,0.25, | |
0,0,0, | |
0,0,0 | |
),3,3,byrow=TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("SEset") | |
library("qgraph") | |
library("pcalg") | |
# For true DAG: | |
A <- matrix(c( | |
0,0,0, | |
0.25,0,0, | |
0,0.25,0 | |
),3,3,byrow=TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("parSim") | |
parSim( | |
### SIMULATION CONDITIONS | |
# Vary sample size: | |
sampleSize = c(250, 500, 1000), | |
# Vary missingness: | |
missing = c(0, 0.1, 0.25), | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("parSim") | |
parSim( | |
### SIMULATION CONDITIONS | |
# Vary sample size: | |
sampleSize = c(250, 500, 1000), | |
# Vary missingness: | |
missing = c(0, 0.1, 0.25), | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compareNetworks <- function(true,est, directed = FALSE){ | |
cor0 <- function(x,y,...){ | |
if (sum(!is.na(x)) < 2 || sum(!is.na(y)) < 2 || sd(x,na.rm=TRUE)==0 | sd(y,na.rm=TRUE) == 0){ | |
return(0) | |
} else { | |
return(cor(x,y,...)) | |
} | |
} | |
bias <- function(x,y) mean(abs(x-y),na.rm=TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install from github: | |
devtools::install_github("sachaepskamp/qgraph") | |
library("qgraph") | |
# Example network to play with: | |
# Load data: | |
library("psychTools") | |
data(bfi) | |
# Compute polychoric correlations: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Packages needed: | |
library("qgraph") | |
library("dplyr") | |
# Create a deck: | |
createDeck <- function(){ | |
data.frame( | |
card = 1:60, | |
type = rep(c("land","spell","spell"), length = 60) | |
) |