Skip to content

Instantly share code, notes, and snippets.

#------------------------------------------------------------------------------#
# RRB DATA ANALYSIS
#
#RRB: Raw dataset containing restricted and repetitive behavioural data from the ADIR1 taken from the AGRE database
# cRRB: Cleaned dataset containing all RRB variables, with duplicates and NA values removed
# RRB_subscales: Character vector listing the names of RRB variables only (not overall score)
# RRB_exp: Dataset derived from cRRB including only the RRB subscale variables defined in RRB_subscales
#
#
#
#------------------------------------------------------------------------------#
# RRB DATA ANALYSIS
#
#RRB: Raw dataset containing restricted and repetitive behavioural data from the ADIR1 taken from the AGRE database
# cRRB: Cleaned dataset containing all RRB variables, with duplicates and NA values removed
# RRB_subscales: Character vector listing the names of RRB variables only (not overall score)
# RRB_friedman: Dataset derived from cRRB including only the RRB subscale variables defined in RRB_subscales
# RRB_demo: A dataset derived from cRRB that includes RRB subscales and the overall RRB score
#
#
#------------------------------------------------------------------------------#
# RRB data analysis
#
#
#
#------------------------------------------------------------------------------#
setwd("~/Desktop/My project")
RRB <- read.csv("RRB.ADIR1.csv")
Medical_data <- read.csv("AffChild1.csv")
# Pearson correlation heatmap
corr_matrix <- cor(
cRRB[, EXPsubscore_columns],
use = "pairwise.complete.obs",
method = "pearson"
)
# Hierarchical clustering using correlation distance
dist_mat <- as.dist(1 - corr_matrix)
hc <- hclust(dist_mat, method = "average")
setwd("~/Desktop/My project")
RRB <- read.csv("RRB.ADIR1.csv")
Medical_data <- read.csv("AffChild1.csv")
Medical_data2 <- read.csv("AffChild2.csv")
Medical_data3 <- read.csv("AffChild3.csv")
# Loading libraries
library(ggplot2)
library(tidyverse)