This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| # FIML multilevel | |
| # Model described in https://psyarxiv.com/8ha93/ | |
| # See also http://statmodel.com/bmuthen/articles/Article_055.pdf | |
| # Load packages: | |
| library("lavaan") | |
| library("psychonetrics") | |
| library("bootnet") | |
| library("mvtnorm") | |
| library("qgraph") |
This file contains hidden or 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("psychonetrics") | |
| library("psychTools") | |
| library("dplyr") | |
| data("bfi") | |
| # Extraversion and Neuroticism items: | |
| data <- bfi[,11:20] | |
| # ggm model: | |
| mod_ggm <- ggm(data, estimator = "FIML") %>% |
This file contains hidden or 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("lavaan") | |
| library("psychonetrics") | |
| library("dplyr") | |
| # Generate data: | |
| mod <- ' | |
| F1 =~ X1 + X2 + X3 | |
| F2 =~ X4 + X5 + X6 | |
| F3 =~ X7 + X8 + X9 | |
| G =~ F1 + F2 + F3 |
This file contains hidden or 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(shiny) | |
| ui <- fluidPage( | |
| h4("Click on plot to start drawing, click again to pause. Draw from LEFT to RIGHT"), | |
| # sliderInput("mywidth", "width of the pencil", min=1, max=30, step=1, value=10), | |
| plotOutput("plot", width = "800px", height = "500px", | |
| hover=hoverOpts(id = "hover", delay = 100, delayType = "throttle", clip = TRUE, nullOutside = TRUE), | |
| click="click"), | |
| actionButton("reset", "RESET DRAWING"), | |
| textInput("userid","Write your participant ID"), | |
| downloadButton("downloadData", "Download data")) |
This file contains hidden or 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("shiny") | |
| library("psychonetrics") | |
| library("IsingFit") | |
| library("IsingSampler") | |
| library("qgraph") | |
| # Load networks: | |
| trueNetwork <- read.csv('http://sachaepskamp.com/files/weiadj.csv')[,-1] | |
| trueNetwork <- as.matrix(trueNetwork) | |
| Symptoms <- rownames(trueNetwork) <- colnames(trueNetwork) |
This file contains hidden or 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
| # This script contains some functions to automate things: | |
| cat("THIS FUNCTION IS OUTDATED, PLEASE SEE https://github.com/SachaEpskamp/RIVMgrowth") | |
| # Function to automize dummy encoding: | |
| rivm_lgc_dummy <- function( | |
| data, # Dataset | |
| design, # Design matrix, as in psychonetrics | |
| type = c("non-linear","linear"), # Type of analysis to do | |
| predictor_var, # Variable name of predictor (only one supported at the moment) |