# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .r
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: R
#     language: R
#     name: ir
# ---

# #pilot for the jupyter notebook

# +
require(Hmisc) #for rcorr
require(reshape2) #for melt
require(ggplot2)
require(psych) #for descriptive stats
require(Rmisc) #for summarySE
require(car) #for scatter plot matrix
require(GPArotation) #for factor analysis
source("R_functions_forJupyter.R")
###Configuration part

statsRD<-2 ##decimal place for means, std, etc
pvalRD<-3 ###decimal place for p value

###########
data<-read.csv("ASD_heterogeneity_SEM.csv")
###########
print(summary(data))
# -

# #create histograms to visualize the distribution of the data

hist_mat(data,3,"ASD_Hetero_FG") ##starting point of variables to be plotted is 3, and the file name is "" to save the pdf file

# #create table for t-test on variables between groups (ASD vs. TD)

mk_ttable(data,2,3,"ASD_hetero_FG",statsRD,pvalRD)

#  #create bar graphs to visualize the differences (Num_Ops) is excluded because of the scale is different

mk_grpbargraph(data,2,c(3:5,7),"ASD_hetero_FG",0,6,15)

# ###moderator models

# +
mod.mod1<-lm(Num_Ops ~ L_FG_Act*Dthreshold,data=data)
summary(mod.mod1)

mod.mod2<-lm(L_FG_Act ~ Num_Ops*Dthreshold,data=data)
summary(mod.mod2)

mod.asd<-lm(L_FG_Act ~ Num_Ops*Dthreshold,data=data[data$Group=="ASD",])
summary(mod.asd)
mod.td<-lm(L_FG_Act ~ Num_Ops*Dthreshold,data=data[data$Group=="TD",])
summary(mod.td)
# -



StarcoderdataJupyterScriptsDedupFiltered