Skip to content

Commit

Permalink
Merge pull request #237 from mingujo/min-multi
Browse files Browse the repository at this point in the history
on progress. need to plot now
  • Loading branch information
mingujo committed Dec 13, 2015
2 parents 30c0bb0 + ee7c129 commit 86d810f
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions code/utils/scripts/multi_comparison_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,42 +38,46 @@

#load all of them
for x in range(1,17):
temp = np.loadtxt(dirs[0]+'/ds005_sub'+str(x).zfill(3)+'_t1r1_beta_task.txt')
task[x] = temp.reshape(91,109,91)
task[x] = np.loadtxt(dirs[0]+'/ds005_sub'+str(x).zfill(3)+'_t1r1_beta_task.txt')

for x in range(1,17):
temp = np.loadtxt(dirs[0]+'/ds005_sub'+str(x).zfill(3)+'_t1r1_beta_gain.txt')
gain[x] = temp.reshape(91,109,91)
gain[x] = np.loadtxt(dirs[0]+'/ds005_sub'+str(x).zfill(3)+'_t1r1_beta_gain.txt')

for x in range(1,17):
temp = np.loadtxt(dirs[0]+'/ds005_sub'+str(x).zfill(3)+'_t1r1_beta_loss.txt')
loss[x] = temp.reshape(91,109,91)
loss[x] = np.loadtxt(dirs[0]+'/ds005_sub'+str(x).zfill(3)+'_t1r1_beta_loss.txt')

for x in range(1,17):
temp = np.loadtxt(dirs[0]+'/ds005_sub'+str(x).zfill(3)+'_t1r1_beta_dist.txt')
dist[x] = temp.reshape(91,109,91)
dist[x] = np.loadtxt(dirs[0]+'/ds005_sub'+str(x).zfill(3)+'_t1r1_beta_dist.txt')

#calculate mean and plot (let's try for task)
task_sum = task[1]
for x in range(2,17):
task_sum +=task[x]

task_mean = task_sum/16
beta_plot = present_3d(task_mean) ##this does not work...
plt.imshow(beta_plot,interpolation='nearest', cmap='seismic')

# plot task_mean

#calculate variance and plot
stdlst = []
for x in range(1,17):
stdlst.append(task[x])
stdarray = np.array(stdlst)
task_std = stdarray.std(axis=0)
# plot task_std


#will use sem here (standard error across 16 subjects)


#calculate t-test and plot
#calculate t-stat and plot
task_tstat = task_mean/task_std
#plot task_tstat


#calculate p-value and plot

task_pval = t_dist.cdf(abs(task_tstat), 15)
1-task_pval
#plot task



Expand Down

0 comments on commit 86d810f

Please sign in to comment.