Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hypothalamus_light_7TfMRI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GIGA-CRC Human Imaging
Public
FASST
Hypothalamus_light_7TfMRI
Commits
22b1a583
Commit
22b1a583
authored
8 months ago
by
Vandewalle Gilles
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
6887ea40
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Statistical_scripts/NBACK_Hypo_final.sas
+320
-0
320 additions, 0 deletions
Statistical_scripts/NBACK_Hypo_final.sas
with
320 additions
and
0 deletions
Statistical_scripts/NBACK_Hypo_final.sas
0 → 100644
+
320
−
0
View file @
22b1a583
** NBACK 5 AREAS **;
Data
NBack
;
infile
"C:\Users\gilles\Documents\EXPERIMENTS\gv19_HIGHLIGHT\results\Hypo 2023-2024\Hypo\Task_Mel_betas\Nback_hypo_Analysis_5areas_final.csv"
dlm
=
','
firstobs
=
2
;
input
Subj
Task
Hypo
Beta_NBack
SDBeta_NBack
Beta_EDI
SDBeta_EDI
;
run
;
* data need to be actively sorted before they can used - even if they appear rightly sorted already;
Proc
sort
data
=
NBack
;
by
task
;
run
;
proc
standard
data
=
NBack
out
=
NBack_Z
mean
=
0
std
=
1
;
var
Beta_NBack
Beta_EDI
;
by
task
;
run
;
data
NBack_Z
;
set
NBack_Z
;
if
abs
(
Beta_NBack
)
<
3
then
Beta_NBack
=
'.'
;
if
abs
(
Beta_EDI
)
<
3
then
Beta_EDI
=
'.'
;
run
;
Proc
sort
data
=
NBack_Z
out
=
NBack_Z
;
by
subj
;
run
;
data
NBack
;
set
NBack
;
if
hypo
=
1
then
size
=
49
;
if
hypo
=
2
then
size
=
69
;
if
hypo
=
3
then
size
=
283
;
if
hypo
=
4
then
size
=
368
;
if
hypo
=
5
then
size
=
284
;
run
;
Proc
sort
data
=
NBack
;
by
subj
;
run
;
Proc
means
data
=
NBack
;
var
age
BMI
;
output
out
=
NBack_mean
mean
=
age
BMI
stderr
=
SE_Age
SE_BMI
;
run
;
Proc
univariate
data
=
NBack
;
var
SDBeta_EDI
;
histogram
/
midpoints
=
-
0.02
to
0.02
by
0.001
lognormal
exponential
weibull
gamma
normal
beta
vaxis
=
axis1
name
=
'MyHist'
;
inset
n
mean
(
5.3
)
std
=
'Std Dev'
(
5.3
)
skewness
(
5.3
)
/
pos
=
ne
header
=
'Summary Statistics'
;
axis1
label
=
(
a=
90
r=
0
);
run
;
ODS
GRAPHICS
ON
;
PROC
GLIMMIX
data
=
NBack
PLOTS
=
all
;
CLASS
Subj
hypo
task
;
MODEL
Beta_NBack
=
hypo
task
age
sex
bmi
/
dist
=
normal
DDFM
=
KR
solution
;
random
intercept
/
subject
=
Subj
solution
;
* you can comment this line if model does not work;
random
hypo
/
type
=
ar
(
1
)
subject
=
subj
*
task
;
*to include repeated measures;
lsmeans
hypo
/
adjust
=
tukey
;
lsmeans
hypo
*
emo
/
slicediff
=
emo
adjust
=
tukey
;
lsmeans
emo
/
adjust
=
tukey
;
lsmeans
hypo
*
emo
/
slicediff
=
hypo
adjust
=
tukey
;
run
;
ODS
GRAPHICS
OFF
;
ODS
GRAPHICS
ON
;
PROC
GLIMMIX
data
=
NBack
PLOTS
=
all
;
CLASS
Subj
hypo
task
;
MODEL
Beta_EDI
=
hypo
task
age
sex
bmi
/
dist
=
normal
DDFM
=
KR
solution
;
random
intercept
/
subject
=
Subj
solution
;
* you can comment this line if model does not work;
random
hypo
/
type
=
ar
(
1
)
subject
=
subj
*
task
;
*to include repeated measures;
lsmeans
hypo
/
adjust
=
tukey
;
lsmeans
hypo
*
emo
/
slicediff
=
emo
adjust
=
tukey
;
lsmeans
emo
/
adjust
=
tukey
;
lsmeans
hypo
*
emo
/
slicediff
=
hypo
adjust
=
tukey
;
run
;
ODS
GRAPHICS
OFF
;
ODS
GRAPHICS
ON
;
TITLE
"GLM for cook's distance"
;
* you can assess Cook's distance if data are normal;
PROC
GLM
DATA
=
Emo
PLOTS
=
diagnostics
(
label
);
CLASS
Subj
sex
hypo
emo
;
MODEL
Beta_EDI
=
hypo
|
emo
age
sex
bmi
/
solution
;
RUN
;
ODS
GRAPHICS
OFF
;
proc
gplot
data
=
NBack
;
TITLE
'light x emo'
;
axis1
order
=
0
to
400
by
50
;
axis2
order
=
0
to
0.3
by
0.1
;
plot
SDBeta_EDI
*
size
/
haxis
=
axis1
vaxis
=
axis2
;
symbol1
i=
std14jmt
mode
=
include
w=
0.2
c=
red
v=
none
l=
0.1
;
run
;
quit
;
run
;
proc
gplot
data
=
NBack
;
TITLE
'light x emo'
;
axis1
order
=
0
to
6
by
1
;
axis2
order
=-
0.002
to
0.002
by
0.001
;
plot
Beta_EDI
*
hypo
=
task
/
haxis
=
axis1
vaxis
=
axis2
;
symbol1
i=
std14jmt
mode
=
include
w=
0.2
c=
red
v=
none
l=
0.1
;
symbol1
i=
std14jmt
mode
=
include
w=
0.2
c=
blue
v=
none
l=
0.1
;
run
;
quit
;
run
;
** NBACK 5 LIGHT ALL **;
Data
NB_ALL
;
infile
"C:\Users\gilles\Documents\EXPERIMENTS\gv19_HIGHLIGHT\results\Islay 2023\Hypo\Light_level_betas\NBack_Hypo_5Con_analysis_ALL.csv"
dlm
=
','
firstobs
=
2
;
input
Subj
Age
Sex
BMI
task
hypo
Beta_nback
light
;
if
light
=
0.2
then
light
=
0.16
;
run
;
Proc
sort
data
=
NB_ALL
;
by
hypo
task
;
run
;
proc
standard
data
=
NB_ALL
out
=
NB_ALL_Z
mean
=
0
std
=
1
;
var
Beta_nback
;
by
hypo
task
;
run
;
data
NB_ALL_Z
;
set
NB_ALL_Z
;
if
abs
(
Beta_nback
)
<
3
then
Beta_nback
=
'.'
;
run
;
Proc
sort
data
=
NB_ALL_Z
;
by
hypo
subj
task
light
;
run
;
Proc
univariate
data
=
NB_ALL
;
var
Beta_nback
;
histogram
/
midpoints
=
-
1
to
1
by
0.1
lognormal
exponential
weibull
gamma
normal
beta
vaxis
=
axis1
name
=
'MyHist'
;
inset
n
mean
(
5.3
)
std
=
'Std Dev'
(
5.3
)
skewness
(
5.3
)
/
pos
=
ne
header
=
'Summary Statistics'
;
axis1
label
=
(
a=
90
r=
0
);
run
;
Proc
sort
data
=
NB_ALL
;
by
hypo
task
;
run
;
proc
standard
data
=
NB_ALL
out
=
NB_ALL_Z
mean
=
0
std
=
1
;
var
Beta_nback
;
by
hypo
task
;
run
;
data
NB_ALL_Z
;
set
NB_ALL_Z
;
if
abs
(
Beta_nback
)
<
3
then
Beta_nback
=
'.'
;
run
;
Proc
sort
data
=
NB_ALL
;
by
hypo
subj
task
light
;
run
;
data
NB_ALL
;
set
NB_ALL
;
if
subj
=
24
then
delete
;
if
subj
=
76
then
delete
;
if
subj
>
84
then
delete
;
if
Beta_nback
<
-
2.1
then
Beta_nback
=
'.'
;
run
;
Proc
sort
data
=
NB_ALL
;
by
subj
;
run
;
ODS
GRAPHICS
ON
;
PROC
GLIMMIX
data
=
NB_ALL
PLOTS
=
all
;
CLASS
subj
sex
task
light
hypo
;
MODEL
Beta_nback
=
task
light
|
hypo
age
sex
bmi
/
dist
=
normal
DDFM
=
KR
solution
;
random
intercept
/
type
=
un
subject
=
Subj
solution
;
* you can comment this line if model does not work;
random
light
/
type
=
cs
subject
=
subj
*
hypo
*
task
;
*to include repeated measures;
*lsmeans light / adjust=tukey;
*lsmeans hypo / adjust=tukey;
*lsmeans light /slicediff=hypo adjust=tukey;
*lsmeans task / adjust=tukey;
*lsmeans light*hypo /slicediff=hypo adjust=tukey;
*lsmeans hypo*light /slicediff=light adjust=tukey;
*estimate 'light, hypo a' light 1 1 1 1 1 hypo 1 0 0 0 0 light*hypo 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0;
run
;
ODS
GRAPHICS
OFF
;
ODS
GRAPHICS
ON
;
PROC
GLIMMIX
data
=
NB_ALL
PLOTS
=
all
;
CLASS
subj
sex
task
light
;
MODEL
Beta_nback
=
task
light
age
sex
bmi
/
dist
=
normal
DDFM
=
KR
solution
;
random
intercept
/
type
=
un
subject
=
Subj
solution
;
* you can comment this line if model does not work;
random
_residual_
/
type
=
ar
(
1
)
subject
=
light
(
task
);
*to include repeated measures;
*lsmeans light / adjust=tukey;
*lsmeans light /slicediff=hypo adjust=tukey;
*lsmeans task / adjust=tukey;
*lsmeans light*hypo /slicediff=hypo adjust=tukey;
*lsmeans hypo*light /slicediff=light adjust=tukey;
run
;
ODS
GRAPHICS
OFF
;
proc
sort
data
=
NB_ALL
;
by
hypo
light
emo
;
run
;
proc
gplot
data
=
NB_ALL
;
TITLE
'light x emo'
;
axis1
order
=-
10
to
200
by
30
;
axis2
order
=-
0.25
to
0.25
by
0.05
;
plot
Beta_nback
*
light
=
hypo
/
haxis
=
axis1
vaxis
=
axis2
;
symbol1
i=
std14jmt
mode
=
include
w=
0.2
c=
blue
v=
none
l=
0.1
;
symbol2
i=
std14jmt
mode
=
include
w=
0.2
c=
red
v=
none
l=
0.1
;
symbol3
i=
std14jmt
mode
=
include
w=
0.2
c=
green
v=
none
l=
0.1
;
symbol4
i=
std14jmt
mode
=
include
w=
0.2
c=
cyan
v=
none
l=
0.1
;
symbol5
i=
std14jmt
mode
=
include
w=
0.2
c=
black
v=
none
l=
0.1
;
run
;
quit
;
run
;
proc
sort
data
=
NB_ALL
;
by
light
emo
;
run
;
proc
gplot
data
=
NB_ALL
;
TITLE
'light x emo'
;
axis1
order
=-
10
to
200
by
30
;
axis2
order
=-
1
to
1.5
by
0.5
;
plot
Beta_nback
*
light
/
haxis
=
axis1
vaxis
=
axis2
;
symbol1
i=
std14jmt
mode
=
include
w=
0.2
c=
red
v=
none
l=
0.1
;
run
;
quit
;
run
;
ODS
GRAPHICS
ON
;
TITLE
"test"
;
PROC
GLM
DATA
=
NB_ALL
PLOTS
=
all
;
CLASS
subj
sex
task
light
hypo
;
MODEL
Beta_nback
=
task
light
|
hypo
age
sex
bmi
;
random
subj
;
repeated
light
(
task
);
OUTPUT
OUT
=
stat
P=
pred
R=
Residual
RSTUDENT
=
r1
DFFITS
=
dffits
COOKD
=
cookd
H=
hatvalue
PRESS
=
res_del
;
RUN
;
ODS
GRAPHICS
OFF
;
PROC
CORR
pearson
spearman
data
=
NB_ALL
plots
=
scatter
(
alpha
=
.
20
.
30
);
var
theta_REM
diff_cube_odd
;
run
;
*you can put as many variables as you want;
ODS
GRAPHICS
OFF
;
** including performace;
***********************;
Data
Perf_NB
;
infile
"C:\Users\gilles\Documents\EXPERIMENTS\gv19_HIGHLIGHT\results\Islay 2023\Hypo\Performance\Hypo_5Con_Analysis_NBACK_average_38_RTs.csv"
dlm
=
','
firstobs
=
2
;
input
Subj
Age
Sex
BMI
task
Light
Betas_Nback
Accuracy
RT_Hits
RTs
;
keep
Subj
task
Light
Accuracy
RT_Hits
RTs
;
if
subj
=
59
then
delete
;
if
subj
=
64
then
delete
;
if
accuracy
<
0.6
then
delete
;
run
;
Proc
sort
data
=
Perf_NB
;
by
task
light
;
run
;
proc
standard
data
=
Perf_NB
out
=
Perf_NB_Z
mean
=
0
std
=
1
;
var
Accuracy
RT_Hits
RTs
;
by
task
;
run
;
data
Perf_NB_Z
;
set
Perf_NB_Z
;
if
abs
(
Accuracy
)
<
3
then
Accuracy
=
'.'
;
if
abs
(
RT_Hits
)
<
3
then
RT_Hits
=
'.'
;
if
abs
(
RTs
)
<
3
then
RTs
=
'.'
;
run
;
Proc
sort
data
=
Perf_NB_Z
;
by
subj
;
run
;
Proc
sort
data
=
NB_ALL
;
by
Subj
light
task
;
run
;
Proc
sort
data
=
Perf_NB
;
by
Subj
light
task
;
run
;
data
NB_ALL_perf
;
merge
NB_ALL
Perf_NB
;
by
Subj
light
task
;
run
;
Proc
sort
data
=
NB_ALL_Z
;
by
Subj
light
task
;
run
;
Proc
sort
data
=
Perf_NB_Z
;
by
Subj
light
task
;
run
;
data
NB_ALL_perf_Z
;
merge
NB_ALL_Z
Perf_NB_Z
;
by
Subj
light
task
;
run
;
data
hypo
;
set
NB_ALL_perf
;
if
hypo
NE
5
then
delete
;
if
task
=
0
then
delete
;
if
accuracy
<
0.6
then
delete
;
* subj 30 is low at times;
if
subj
=
65
&
light
=
0.16
&
task
=
1
then
accuracy
=
'.'
;
run
;
data
hypo_Z
;
set
NB_ALL_perf_Z
;
if
hypo
NE
1
then
delete
;
if
task
=
1
then
delete
;
if
subj
=
59
then
delete
;
run
;
Proc
univariate
data
=
hypo
;
var
RT_Hits
;
histogram
/
midpoints
=
800
to
1600
by
50
lognormal
exponential
weibull
gamma
normal
beta
vaxis
=
axis1
name
=
'MyHist'
;
inset
n
mean
(
5.3
)
std
=
'Std Dev'
(
5.3
)
skewness
(
5.3
)
/
pos
=
ne
header
=
'Summary Statistics'
;
axis1
label
=
(
a=
90
r=
0
);
run
;
Proc
univariate
data
=
hypo
;
var
accuracy
;
histogram
/
midpoints
=
0
to
1
by
0.1
lognormal
exponential
weibull
gamma
normal
beta
vaxis
=
axis1
name
=
'MyHist'
;
inset
n
mean
(
5.3
)
std
=
'Std Dev'
(
5.3
)
skewness
(
5.3
)
/
pos
=
ne
header
=
'Summary Statistics'
;
axis1
label
=
(
a=
90
r=
0
);
run
;
ODS
GRAPHICS
ON
;
PROC
GLIMMIX
data
=
hypo
PLOTS
=
all
;
CLASS
subj
sex
light
;
MODEL
accuracy
=
beta_nback
light
age
sex
bmi
/
dist
=
normal
DDFM
=
KR
solution
;
random
intercept
/
type
=
un
subject
=
Subj
solution
;
* you can comment this line if model does not work;
random
light
/
type
=
ar
(
1
)
subject
=
subj
*
light
;
*to include repeated measures;
*random light /type=ar(1) subject= subj*light;
*
to
include
repeated
measures
;
*lsmeans light / adjust=tukey;
*lsmeans light /slicediff=hypo adjust=tukey;
*lsmeans emo / adjust=tukey;
*lsmeans light*hypo /slicediff=hypo adjust=tukey;
*lsmeans light*hypo /slicediff=light adjust=tukey;
run
;
ODS
GRAPHICS
OFF
;
ODS
GRAPHICS
ON
;
PROC
GLIMMIX
data
=
hypo
PLOTS
=
all
;
CLASS
subj
sex
light
;
MODEL
RT_hits
=
beta_nback
light
age
sex
bmi
/
dist
=
normal
DDFM
=
KR
solution
;
random
intercept
/
type
=
un
subject
=
Subj
solution
;
* you can comment this line if model does not work;
*random light /type=ar(1) subject= subj*light;
*
to
include
repeated
measures
;
random
_residual_
/
type
=
ar
(
1
)
subject
=
light
;
*to include repeated measures;
*lsmeans light / adjust=tukey;
*lsmeans light /slicediff=hypo adjust=tukey;
*lsmeans emo / adjust=tukey;
*lsmeans light*hypo /slicediff=hypo adjust=tukey;
*lsmeans light*hypo /slicediff=light adjust=tukey;
run
;
ODS
GRAPHICS
OFF
;
proc
sort
data
=
hypo
;
by
task
light
subj
;
run
;
proc
gplot
data
=
hypo
;
TITLE
'light x emo'
;
axis1
order
=-
10
to
200
by
30
;
axis2
order
=
0.6
to
1
by
0.1
;
plot
accuracy
*
light
=
task
/
haxis
=
axis1
vaxis
=
axis2
;
symbol1
i=
std14jmt
mode
=
include
w=
0.2
c=
blue
v=
none
l=
0.1
;
symbol2
i=
std14jmt
mode
=
include
w=
0.2
c=
red
v=
none
l=
0.1
;
run
;
quit
;
run
;
proc
sort
data
=
hypo
;
by
task
light
subj
;
run
;
proc
gplot
data
=
hypo
;
TITLE
'light x emo'
;
axis1
order
=-
10
to
200
by
30
;
axis2
order
=
600
to
1500
by
100
;
plot
RT_hits
*
light
=
task
/
haxis
=
axis1
vaxis
=
axis2
;
symbol1
i=
std14jmt
mode
=
include
w=
0.2
c=
blue
v=
none
l=
0.1
;
symbol2
i=
std14jmt
mode
=
include
w=
0.2
c=
red
v=
none
l=
0.1
;
run
;
quit
;
run
;
PROC
CORR
pearson
spearman
data
=
hypo
plots
=
scatter
(
alpha
=
.
20
.
30
)
out
=
PearsonR
;
var
Accuracy
light
;
by
subj
;
run
;
*you can put as many variables as you want;
ODS
GRAPHICS
OFF
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment