Neural mechanisms of awareness of action.
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 456 lines · 20 KB · no license
- load('Y:\HNCT_AoA_Study\AoA_Subjects\allSessionRunAccuracyAwarenessConfidence.mat')
- load('Y:\HNCT_AoA_Study\AoA_Subjects\allSessionRunAccuracyUnawarenessConfidence.mat')
- % Example data with missing values
- timepoints = {'Run 1', 'Run 2', 'Run 3', 'Run 4', 'Run 5', 'Run 6'};
- std_calc_data = allSessionRunsUnawareness;
- % for row = 1:length(allSessionRunsConfidence)
- % allSessionRunsConfidence(row,:) = allSessionRunsConfidence(row,:)-allSessionRunsConfidence(row,1);
- % end
- % for row = 1:length(allSessionRunsAccuracy)
- % allSessionRunsAccuracy(row,:) = allSessionRunsAccuracy(row,:)-allSessionRunsAccuracy(row,1);
- % end
- % for row = 1:length(allSessionRunsUnawareness)
- % allSessionRunsUnawareness(row,:) = allSessionRunsUnawareness(row,:)-allSessionRunsUnawareness(row,1);
- % end
- %%
- types = {'Unawareness','Accuracy','Confidence','Awareness'};
- ylabels = {'Percentage Point Change From Run 1','Percentage Point Change From Run 1','Percentile Point Change From Run 1','Percentage Point Change From Run 1'};
- for day = 2:3
- for graph = 1:4
- if day == 2
- if graph == 1
- data = allSessionRunsUnawareness(strcmp(allSessionRunsDays,'Day2'),:);
- elseif graph == 2
- data = allSessionRunsAccuracy(strcmp(allSessionRunsDays,'Day2'),:);
- elseif graph == 3
- data = allSessionRunsConfidence(strcmp(allSessionRunsDays,'Day2'),:);
- elseif graph == 4
- data = allSessionRunsAwareness(strcmp(allSessionRunsDays,'Day2'),:);
- end
- elseif day == 3
- if graph == 1
- data = allSessionRunsUnawareness(strcmp(allSessionRunsDays,'Day3'),:);
- elseif graph == 2
- data = allSessionRunsAccuracy(strcmp(allSessionRunsDays,'Day3'),:);
- elseif graph == 3
- data = allSessionRunsConfidence(strcmp(allSessionRunsDays,'Day3'),:);
- elseif graph == 4
- data = allSessionRunsAwareness(strcmp(allSessionRunsDays,'Day3'),:);
- end
- end
- % Perform pairwise paired t-tests with pairwise complete case analysis
- p_values = nan(numel(timepoints), numel(timepoints));
- for i = 1:numel(timepoints)
- for j = 1:numel(timepoints)
- if i == j
- continue; % Skip if comparing the same timepoint
- end
- % Perform pairwise complete case analysis
- valid_indices = ~isnan(data(:, i)) & ~isnan(data(:, j));
- if any(valid_indices)
- x = data(valid_indices, i);
- y = data(valid_indices, j);
- [~, p_values(i, j)] = ttest(x, y, 'Alpha', 0.05);
- else
- p_values(i, j) = NaN; % Assign NaN if no complete cases exist
- end
- end
- end
- % Apply Benjamini-Hochberg procedure to p-values
- p_values_vector = reshape(p_values, [], 1);
- valid_p_values = p_values_vector(~isnan(p_values_vector)); % Exclude NaN p-values
- adjusted_p_values = zeros(size(p_values));
- adjusted_p_values(~isnan(p_values)) = mafdr(valid_p_values, 'BHFDR', true); % Apply Benjamini-Hochberg procedure
- % Display adjusted p-values
- fprintf('Pairwise paired t-test adjusted p-values (Benjamini-Hochberg procedure):\n');
- disp(adjusted_p_values);
- p_values_compared_to_run1 = mafdr( p_values(1,2:6), 'BHFDR', true);
- disp(['Adjusted p-values for run 1 tests only, ' types{graph} ])
- disp(p_values_compared_to_run1)
- dataNoNaN = data(valid_indices == 1,:);
- dataNoNaN = data;
- dataSEM1 = nanstd(std_calc_data(:,1))/sqrt(length(std_calc_data));
- dataSEM2 = nanstd(std_calc_data(:,2))/sqrt(length(std_calc_data));
- dataSEM3 = nanstd(std_calc_data(:,3))/sqrt(length(std_calc_data));
- dataSEM4 = nanstd(std_calc_data(:,4))/sqrt(length(std_calc_data));
- dataSEM5 = nanstd(std_calc_data(:,5))/sqrt(length(std_calc_data));
- dataSEM6 = nanstd(std_calc_data(:,6))/sqrt(length(std_calc_data));
- figure;
- hold on
- plot(nanmean(dataNoNaN),'LineWidth',3)
- errorbar(nanmean(dataNoNaN),[dataSEM1 dataSEM2 dataSEM3 dataSEM4 dataSEM5 dataSEM6],'linestyle','none','LineWidth',2)
- title(['Run ' types{graph} ' N = ' num2str(length(dataNoNaN)) ' Sessions, Day ' num2str(day)]);
- xlim([1 6])
- set(gca,'FontSize',24)
- ax = gca;
- ax.XTick = unique( round(ax.XTick) );
- xlabel('Run')
- ylabel('Percentage')
- if strcmp(types{graph},'Unawareness')
- ylim([10 25])
- elseif strcmp(types{graph},'Confidence')
- ylim([45 55])
- elseif strcmp(types{graph},'Accuracy')
- ylim([60 72])
- elseif strcmp(types{graph},'Awareness')
- ylim([10 30])
- end
- end
- end
- %%
- allSubjectSessionWeighted = [unique(allSessionRunsSubject)'; cell(4,length(unique(allSessionRunsSubject)))];
- for session = 1:length(allSessionRunsAccuracy)
- for subject = 1:length(allSubjectSessionWeighted)
- if strcmp(allSessionRunsSubject{session},allSubjectSessionWeighted{1,subject})
- allSubjectSessionWeighted{2,subject} = [allSubjectSessionWeighted{2,subject}; allSessionRunsAccuracy(session,:)];
- allSubjectSessionWeighted{3,subject} = [allSubjectSessionWeighted{3,subject}; allSessionRunsConfidence(session,:)];
- allSubjectSessionWeighted{4,subject} = [allSubjectSessionWeighted{4,subject}; allSessionRunsUnawareness(session,:)];
- allSubjectSessionWeighted{5,subject} = [allSubjectSessionWeighted{5,subject}; allSessionRunsAwareness(session,:)];
- end
- end
- end
- twoDayMeanAccuracy = [];
- twoDayMeanConfidence = [];
- twoDayMeanUnawareness = [];
- twoDayMeanAwareness = [];
- for subject = 1:length(allSubjectSessionWeighted)
- if size(allSubjectSessionWeighted{2,subject},1) == 2
- twoDayMeanAccuracy = [twoDayMeanAccuracy; mean(allSubjectSessionWeighted{2,subject})];
- twoDayMeanConfidence = [twoDayMeanConfidence; mean(allSubjectSessionWeighted{3,subject})];
- twoDayMeanUnawareness = [twoDayMeanUnawareness; mean(allSubjectSessionWeighted{4,subject})];
- twoDayMeanAwareness = [twoDayMeanAwareness; mean(allSubjectSessionWeighted{5,subject})];
- elseif size(allSubjectSessionWeighted{2,subject},1) == 1
- twoDayMeanAccuracy = [twoDayMeanAccuracy; allSubjectSessionWeighted{2,subject}];
- twoDayMeanConfidence = [twoDayMeanConfidence; allSubjectSessionWeighted{3,subject}];
- twoDayMeanUnawareness = [twoDayMeanUnawareness; allSubjectSessionWeighted{4,subject}];
- twoDayMeanAwareness = [twoDayMeanAwareness; allSubjectSessionWeighted{5,subject}];
- end
- end
- confidence_level = 0.95;
- semRun1 = nanstd(twoDayMeanAccuracy(:,1))/sqrt(length(twoDayMeanAccuracy));
- semRun2 = nanstd(twoDayMeanAccuracy(:,2))/sqrt(length(twoDayMeanAccuracy));
- semRun3 = nanstd(twoDayMeanAccuracy(:,3))/sqrt(length(twoDayMeanAccuracy));
- semRun4 = nanstd(twoDayMeanAccuracy(:,4))/sqrt(length(twoDayMeanAccuracy));
- semRun5 = nanstd(twoDayMeanAccuracy(:,5))/sqrt(length(twoDayMeanAccuracy));
- semRun6 = nanstd(twoDayMeanAccuracy(:,6))/sqrt(length(twoDayMeanAccuracy));
- figure;
- hold on;
- plot(1:6,nanmean(twoDayMeanAccuracy),'LineWidth',3,'Color','blue')
- errorbar(nanmean(twoDayMeanAccuracy),[semRun1 semRun2 semRun3 semRun4 semRun5 semRun6],'linestyle','none','LineWidth',3,'Color','red')
- set(gca,'FontSize',24)
- xlim([1 6])
- ylim([60 72])
- ax = gca;
- ax.XTick = unique( round(ax.XTick) );
- xlabel(['Run'])
- ylabel('Correct Percentage')
- title(['Subject Session Accuracy Averages, N = ' num2str(length(twoDayMeanAccuracy))])
- semRun1 = nanstd(twoDayMeanConfidence(:,1))/sqrt(length(twoDayMeanConfidence));
- semRun2 = nanstd(twoDayMeanConfidence(:,2))/sqrt(length(twoDayMeanConfidence));
- semRun3 = nanstd(twoDayMeanConfidence(:,3))/sqrt(length(twoDayMeanConfidence));
- semRun4 = nanstd(twoDayMeanConfidence(:,4))/sqrt(length(twoDayMeanConfidence));
- semRun5 = nanstd(twoDayMeanConfidence(:,5))/sqrt(length(twoDayMeanConfidence));
- semRun6 = nanstd(twoDayMeanConfidence(:,6))/sqrt(length(twoDayMeanConfidence));
- critical_run1 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanConfidence(:,1)))-1);
- critical_run2 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanConfidence(:,2)))-1);
- critical_run3 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanConfidence(:,3)))-1);
- critical_run4 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanConfidence(:,4)))-1);
- critical_run5 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanConfidence(:,5)))-1);
- critical_run6 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanConfidence(:,6)))-1);
- ci95 = [critical_run1*semRun1 critical_run2*semRun2 critical_run3*semRun3 critical_run4*semRun4 critical_run5*semRun5 critical_run6*semRun6];
- figure;
- hold on;
- plot(1:6,nanmean(twoDayMeanConfidence),'LineWidth',3,'Color','b')
- % plot(1:6,nanmean(twoDayMeanConfidence)+ci95,'Color','b','LineStyle','--')
- % plot(1:6,nanmean(twoDayMeanConfidence)-ci95,'Color','b','LineStyle','--')
- % plot(1:6,nanmean(twoDayMeanConfidence)+[semRun1 semRun2 semRun3 semRun4 semRun5 semRun6],'Color','b','LineStyle','--')
- % plot(1:6,nanmean(twoDayMeanConfidence)-[semRun1 semRun2 semRun3 semRun4 semRun5 semRun6],'Color','b','LineStyle','--')
- errorbar(nanmean(twoDayMeanConfidence),[semRun1 semRun2 semRun3 semRun4 semRun5 semRun6],'linestyle','none','LineWidth',3,'Color','r')
- scatter([4 5 6], [52 52 52],256,'*','black','LineWidth',3)
- set(gca,'FontSize',24)
- xlim([1 6])
- ylim([45 55])
- ax = gca;
- ax.XTick = unique( round(ax.XTick) );
- xlabel(['Run'])
- ylabel('Confidence Percentile')
- title(['Subject Session Confidence Averages, N = ' num2str(length(twoDayMeanConfidence))])
- semRun1 = nanstd(twoDayMeanUnawareness(:,1))/sqrt(length(twoDayMeanUnawareness));
- semRun2 = nanstd(twoDayMeanUnawareness(:,2))/sqrt(length(twoDayMeanUnawareness));
- semRun3 = nanstd(twoDayMeanUnawareness(:,3))/sqrt(length(twoDayMeanUnawareness));
- semRun4 = nanstd(twoDayMeanUnawareness(:,4))/sqrt(length(twoDayMeanUnawareness));
- semRun5 = nanstd(twoDayMeanUnawareness(:,5))/sqrt(length(twoDayMeanUnawareness));
- semRun6 = nanstd(twoDayMeanUnawareness(:,6))/sqrt(length(twoDayMeanUnawareness));
- figure;
- hold on;
- plot(1:6,nanmean(twoDayMeanUnawareness),'LineWidth',3,'Color','b')
- errorbar(nanmean(twoDayMeanUnawareness),[semRun1 semRun2 semRun3 semRun4 semRun5 semRun6],'linestyle','none','LineWidth',3,'Color','r')
- scatter([5 6], [23 23],256,'*','black','LineWidth',3)
- set(gca,'FontSize',24)
- xlim([1 6])
- ylim([10 25])
- ax = gca;
- ax.XTick = unique( round(ax.XTick) );
- xlabel(['Run'])
- ylabel('Unawareness Percentage')
- title(['Subject Session Unawareness Averages, N = ' num2str(length(twoDayMeanUnawareness))])
- semRun1 = nanstd(twoDayMeanAwareness(:,1))/sqrt(length(twoDayMeanAwareness));
- semRun2 = nanstd(twoDayMeanAwareness(:,2))/sqrt(length(twoDayMeanAwareness));
- semRun3 = nanstd(twoDayMeanAwareness(:,3))/sqrt(length(twoDayMeanAwareness));
- semRun4 = nanstd(twoDayMeanAwareness(:,4))/sqrt(length(twoDayMeanAwareness));
- semRun5 = nanstd(twoDayMeanAwareness(:,5))/sqrt(length(twoDayMeanAwareness));
- semRun6 = nanstd(twoDayMeanAwareness(:,6))/sqrt(length(twoDayMeanAwareness));
- critical_run1 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanAwareness(:,1)))-1);
- critical_run2 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanAwareness(:,2)))-1);
- critical_run3 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanAwareness(:,3)))-1);
- critical_run4 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanAwareness(:,4)))-1);
- critical_run5 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanAwareness(:,5)))-1);
- critical_run6 = tinv((1+confidence_level)/2,sum(~isnan(twoDayMeanAwareness(:,6)))-1);
- ci95 = [critical_run1*semRun1 critical_run2*semRun2 critical_run3*semRun3 critical_run4*semRun4 critical_run5*semRun5 critical_run6*semRun6];
- figure;
- hold on;
- plot(1:6,nanmean(twoDayMeanAwareness),'LineWidth',3,'Color','b')
- % plot(1:6,nanmean(twoDayMeanAwareness)+ci95,'Color','b','LineStyle','--')
- % plot(1:6,nanmean(twoDayMeanAwareness)-ci95,'Color','b','LineStyle','--')
- % plot(1:6,nanmean(twoDayMeanAwareness)+[semRun1 semRun2 semRun3 semRun4 semRun5 semRun6],'Color','b','LineStyle','--')
- % plot(1:6,nanmean(twoDayMeanAwareness)-[semRun1 semRun2 semRun3 semRun4 semRun5 semRun6],'Color','b','LineStyle','--')
- errorbar(nanmean(twoDayMeanAwareness),[semRun1 semRun2 semRun3 semRun4 semRun5 semRun6],'linestyle','none','LineWidth',3,'Color','r')
- set(gca,'FontSize',24)
- xlim([1 6])
- ylim([15 30])
- scatter([2 4 6], [28 28 28],256,'*','black','LineWidth',3)
- ax = gca;
- ax.XTick = unique( round(ax.XTick) );
- xlabel(['Run'])
- ylabel('Awareness Percentage')
- title(['Subject Session Awareness Averages, N = ' num2str(length(twoDayMeanAwareness))])
- %%
- pvalue_vector_awareness = [];
- pvalue_vector_awareness_signrank = [];
- for test = 2:6
- [h,p] = ttest(twoDayMeanAwareness(:,1),twoDayMeanAwareness(:,test));
- pvalue_vector_awareness = [pvalue_vector_awareness p];
- p = signrank(twoDayMeanAwareness(:,1),twoDayMeanAwareness(:,test));
- pvalue_vector_awareness_signrank = [pvalue_vector_awareness_signrank p];
- end
- pvalues_to_run_1_awareness = mafdr( pvalue_vector_unawareness, 'BHFDR', true)
- pvalues_to_run_1_signrank_awareness = mafdr( pvalue_vector_awareness_signrank, 'BHFDR', true)
- %%
- pvalue_vector_unawareness = [];
- pvalue_vector_unawareness_signrank = [];
- for test = 2:6
- [h,p] = ttest(twoDayMeanUnawareness(:,1),twoDayMeanUnawareness(:,test));
- pvalue_vector_unawareness = [pvalue_vector_unawareness p];
- p = signrank(twoDayMeanUnawareness(:,1),twoDayMeanUnawareness(:,test));
- pvalue_vector_unawareness_signrank = [pvalue_vector_unawareness_signrank p];
- end
- pvalues_to_run_1 = mafdr( pvalue_vector_unawareness, 'BHFDR', true)
- pvalues_to_run_1_signrank_unawareness = mafdr( pvalue_vector_unawareness_signrank, 'BHFDR', true)
- %%
- pvalue_vector_confidence = [];
- pvalue_vector_unawareness_signrank = [];
- for test = 2:6
- [h,p] = ttest(twoDayMeanConfidence(:,1),twoDayMeanConfidence(:,test));
- pvalue_vector_confidence = [pvalue_vector_confidence p];
- p = signrank(twoDayMeanConfidence(:,1),twoDayMeanConfidence(:,test));
- pvalue_vector_unawareness_signrank = [pvalue_vector_unawareness_signrank p];
- end
- pvalues_to_run_1_confidence = mafdr( pvalue_vector_confidence, 'BHFDR', true)
- pvalues_to_run_1_signrank_confidence = mafdr( pvalue_vector_unawareness_signrank, 'BHFDR', true)
- %%
- pvalue_vector_accuracy = [];
- pvalue_vector_accuracy_signrank = [];
- for test = 2:6
- [h,p] = ttest(twoDayMeanAccuracy(:,1),twoDayMeanAccuracy(:,test));
- pvalue_vector_accuracy = [pvalue_vector_accuracy p];
- p = signrank(twoDayMeanAccuracy(:,1),twoDayMeanAccuracy(:,test));
- pvalue_vector_accuracy_signrank = [pvalue_vector_accuracy_signrank p];
- end
- pvalues_to_run_1_accuracy = mafdr( pvalue_vector_accuracy, 'BHFDR', true)
- pvalues_to_run_1_signrank_accuracy = mafdr( pvalue_vector_accuracy_signrank, 'BHFDR', true)
- %%
- allSessionRunPearsonsAccuracy = [];
- for session = 1:128
- currentCoeff = corrcoef(1:6,allSessionRunsAccuracy(session,:));
- allSessionRunPearsonsAccuracy = [allSessionRunPearsonsAccuracy currentCoeff(2)];
- end
- figure
- histogram(allSessionRunPearsonsAccuracy)
- title('Accuracy')
- xlabel('Pearson correlation coefficient')
- allSessionRunPearsonsAwareness = [];
- for session = 1:128
- currentCoeff = corrcoef(1:6,allSessionRunsAwareness(session,:));
- allSessionRunPearsonsAwareness = [allSessionRunPearsonsAwareness currentCoeff(2)];
- end
- figure
- histogram(allSessionRunPearsonsAwareness)
- title('Awareness')
- xlabel('Pearson correlation coefficient')
- allSessionRunPearsonsConfidence = [];
- for session = 1:128
- currentCoeff = corrcoef(1:6,allSessionRunsConfidence(session,:));
- allSessionRunPearsonsConfidence = [allSessionRunPearsonsConfidence currentCoeff(2)];
- end
- figure
- histogram(allSessionRunPearsonsConfidence)
- title('Confidence')
- xlabel('Pearson correlation coefficient')
- allSessionRunPearsonsUnawareness = [];
- for session = 1:128
- currentCoeff = corrcoef(1:6,allSessionRunsUnawareness(session,:));
- allSessionRunPearsonsUnawareness = [allSessionRunPearsonsUnawareness currentCoeff(2)];
- end
- figure
- histogram(allSessionRunPearsonsUnawareness)
- title('Unawareness')
- xlabel('Pearson correlation coefficient')
- %%
- full_table = [];
- for subject = 1:length(allSubjectSessionWeighted)
- currentSubjectUnawareness = twoDayMeanUnawareness(subject,:);
- currentSubjectAwareness = twoDayMeanAwareness(subject,:);
- currentSubjectConfidence = twoDayMeanConfidence(subject,:);
- currentSubjectAccuracy = twoDayMeanAccuracy(subject,:);
- for run = 1:6
- if ~isnan(twoDayMeanAccuracy(subject,run))
- currentRow = [twoDayMeanAccuracy(subject,run) twoDayMeanConfidence(subject,run) twoDayMeanAwareness(subject,run) twoDayMeanUnawareness(subject,run) run subject];
- end
- full_table = [full_table; currentRow];
- end
- end
- full_table = array2table(full_table);
- full_table.Properties.VariableNames = {'Accuracy','Confidence','Awareness','Unawareness','Run','Subject'};
- % % Convert 'subject' and 'run' to categorical if they are not already
- % full_table.Subject = categorical(full_table.Subject);
- % full_table.Run = categorical(full_table.Run);
- %
- % % Fit the repeated measures model
- % rm = fitrm(full_table, 'Unawareness ~ Run', 'WithinDesign', full_table.Run, 'WithinModel', 'Run');
- %
- % % Run the repeated measures ANOVA
- % ranovatbl = ranova(rm);
- %
- % % Display the results
- % disp(ranovatbl);
- %%
- dataTable = array2table(twoDayMeanUnawareness);
- dataTable.Properties.VariableNames = {'Run_1','Run_2','Run_3','Run_4','Run_5','Run_6'};
- rm = fitrm(dataTable,'Run_1-Run_6')
- rm_coeffs_unawareness = rm.Coefficients;
- ranovaResultsUnawareness = ranova(rm)
- dataTable = array2table(twoDayMeanAwareness);
- dataTable.Properties.VariableNames = {'Run_1','Run_2','Run_3','Run_4','Run_5','Run_6'};
- rm = fitrm(dataTable,'Run_1-Run_6~1')
- rm_coeffs_awareness = rm.Coefficients;
- ranovaResultsAwareness = ranova(rm)
- dataTable = array2table(twoDayMeanConfidence);
- dataTable.Properties.VariableNames = {'Run_1','Run_2','Run_3','Run_4','Run_5','Run_6'};
- rm = fitrm(dataTable,'Run_1-Run_6~1')
- rm_coeffs_confidence = rm.Coefficients;
- ranovaResultsConfidence = ranova(rm)
- dataTable = array2table(twoDayMeanAccuracy);
- dataTable.Properties.VariableNames = {'Run_1','Run_2','Run_3','Run_4','Run_5','Run_6'};
- rm = fitrm(dataTable,'Run_1-Run_6~1')
- rm_coeffs_accuracy = rm.Coefficients;
- ranovaResultsAccuracy = ranova(rm)
- %%
- [RHO,PVAL] = corr([nanmean(twoDayMeanAccuracy(:,1)) nanmean(twoDayMeanAccuracy(:,2)) nanmean(twoDayMeanAccuracy(:,3)) nanmean(twoDayMeanAccuracy(:,4)) nanmean(twoDayMeanAccuracy(:,5)) nanmean(twoDayMeanAccuracy(:,6))]',[1 2 3 4 5 6]','Type','Spearman')
- accuracyColumn = [nanmean(twoDayMeanAccuracy)'; RHO; PVAL];
- [RHO,PVAL] = corr([nanmean(twoDayMeanConfidence(:,1)) nanmean(twoDayMeanConfidence(:,2)) nanmean(twoDayMeanConfidence(:,3)) nanmean(twoDayMeanConfidence(:,4)) nanmean(twoDayMeanConfidence(:,5)) nanmean(twoDayMeanConfidence(:,6))]',[1 2 3 4 5 6]','Type','Spearman')
- confidenceColumn = [nanmean(twoDayMeanConfidence)'; RHO; PVAL];
- [RHO,PVAL] = corr([nanmean(twoDayMeanAwareness(:,1)) nanmean(twoDayMeanAwareness(:,2)) nanmean(twoDayMeanAwareness(:,3)) nanmean(twoDayMeanAwareness(:,4)) nanmean(twoDayMeanAwareness(:,5)) nanmean(twoDayMeanAwareness(:,6))]',[1 2 3 4 5 6]','Type','Spearman')
- awarenessColumn = [nanmean(twoDayMeanAwareness)'; RHO; PVAL];
- [RHO,PVAL] = corr([nanmean(twoDayMeanUnawareness(:,1)) nanmean(twoDayMeanUnawareness(:,2)) nanmean(twoDayMeanUnawareness(:,3)) nanmean(twoDayMeanUnawareness(:,4)) nanmean(twoDayMeanUnawareness(:,5)) nanmean(twoDayMeanUnawareness(:,6))]',[1 2 3 4 5 6]','Type','Spearman')
- unawarenessColumn = [nanmean(twoDayMeanUnawareness)'; RHO; PVAL];
- master_column = round([accuracyColumn confidenceColumn awarenessColumn unawarenessColumn],2);
- master_column = array2table(master_column);
- master_column.Properties.VariableNames = {'Accuracy','Confidence','Awareness','Unawareness'}
- % Assuming you have a table T
- % Display table within a figure window
- figure;
- uitable('Data', master_column{:,:}, 'ColumnName', master_column.Properties.VariableNames,'RowName',{'Run 1','Run 2','Run 3','Run 4','Run 5','Run 6','ρ','p-value'}, 'Units', 'Normalized', 'Position', [0, 0, 1, 1]);
- title('Table Visualization');
analyze_run_changes_stats.m at commit 8a9aa7a, no license · at the source
Overview
- Department of Neurology, Yale University School of Medicine, New Haven, CT 06520, USA
- Interdepartmental Neuroscience Program, Yale University, New Haven, CT 06520, USA
- Child Study Center, Yale University School of Medicine, New Haven, CT 06519, USA
- Department of Neuroscience, Yale University School of Medicine, New Haven, CT 06520, USA
- Department of Neurosurgery, Yale University School of Medicine, New Haven, CT 06520, USA
Abstract
Awareness of action (AoA), or conscious awareness of an action just performed, is an important part of daily experience with major practical and ethical relevance, yet the neural mechanisms of AoA remain largely unknown. The main barrier to studying AoA is a lack of experimental paradigms to directly compare neural activity in aware versus unaware actions. Borrowing from the field of perceptual awareness, where exciting progress has been made by contrastive analysis of aware versus unaware stimuli, we developed a game where participants repeatedly perform nearly identical moves while engaged in a distractor task, and the participants then report awareness or unawareness of the moves they just performed. We found that on short timescales, aware actions had larger neurophysiological signals both preceding and following movement. The differences included both volitional and perceptual event-related potentials (premovement positivity, N140, and P300), as well as frontal midline theta, event-related alpha/
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
BlumenfeldLab/Jin-et-al_2026
8a9aa7a594d1ff89398980f183f74bcdbea26b73, 4 June 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
83 files
- BehavioralQuizAnalysis/
analyze_run_changes_stat , MATLAB, 456 liness.m - BehavioralQuizAnalysis/
aoa_analyze_centered_tra , MATLAB, 269 linesnsitions.m - BehavioralQuizAnalysis/
aoa_analyze_centered_tra , MATLAB, 273 linesnsitions_awares_to_n_plu s_6.m - BehavioralQuizAnalysis/
aoa_analyze_centered_tra , MATLAB, 276 linesnsitions_unawares_to_n_p lus_6.m - BehavioralQuizAnalysis/
aoa_analyze_per_session_ , MATLAB, 638 linesaware_unaware.m - BehavioralQuizAnalysis/
aoa_analyze_quizzes.m , MATLAB, 123 lines - BehavioralQuizAnalysis/
aoa_analyze_quizzes_make , MATLAB, 288 lines_figs.m - BehavioralQuizAnalysis/
aoa_analyze_unawareness_ , MATLAB, 448 linesconfidence_accuracy_age_ and_sex.m - BehavioralQuizAnalysis/
aoa_designate_middle_qua , MATLAB, 77 linesrtiles.m - BehavioralQuizAnalysis/
aoa_plot_disappearance_a , MATLAB, 263 linesware_unaware.m - BehavioralQuizAnalysis/
aoa_run_by_run_confidenc , MATLAB, 174 linese_accuracy_awareness_una wareness.m - EEGERPAnalysis/
CorrectIncorrect/ , MATLAB, 65 linesaoa_hpc_make_mean_erp_co rrect_incorrect.m - EEGERPAnalysis/
CorrectIncorrect/ , MATLAB, 171 linesaoa_hpc_plot_mean_erp_co rrect_incorrect.m - EEGERPAnalysis/
CorrectIncorrect/ , MATLAB, 121 linesaoa_make_voltage_png_fil es_correct_incorrect.m - EEGERPAnalysis/
CorrectIncorrect/ , MATLAB, 152 linesaoa_present_voltage_time courses_spatiotemporal_f ilter_accuracy.m - EEGERPAnalysis/
CounterbalanceTrials/ , MATLAB, 50 linesaoa_build_group_erp_mean s_counterbalance.m - EEGERPAnalysis/
CounterbalanceTrials/ , MATLAB, 235 linesaoa_cluster_permutation_ v2_voltage_parallel_coun terbalance.m - EEGERPAnalysis/
CounterbalanceTrials/ , MATLAB, 71 linesaoa_make_mean_erp_counte rbalance_trials.m - EEGERPAnalysis/
DelayComparison/ , MATLAB, 237 linesaoa_cluster_permutation_ v2_voltage_parallel_earl y_late.m - EEGERPAnalysis/
DelayComparison/ , MATLAB, 108 linesaoa_hpc_make_mean_erp_sp lit_designations_raw.m - EEGERPAnalysis/
DelayComparison/ , MATLAB, 180 linesaoa_hpc_plot_mean_erp_sp lit_designations_raw_ear ly.m - EEGERPAnalysis/
DelayComparison/ , MATLAB, 181 linesaoa_hpc_plot_mean_erp_sp lit_designations_raw_lat e.m - EEGERPAnalysis/
DelayComparison/ , MATLAB, 129 linesaoa_make_voltage_png_fil es_early_late.m - EEGERPAnalysis/
DelayComparison/ , MATLAB, 187 linesaoa_present_voltage_time courses_spatiotemporal_f ilter_v2_ea_lat.m - EEGERPAnalysis/
HiConfLoConf/ , MATLAB, 65 linesaoa_hpc_make_mean_erp_hi Conf_loConf.m - EEGERPAnalysis/
HiConfLoConf/ , MATLAB, 172 linesaoa_hpc_plot_mean_erp_hi Conf_loConf.m - EEGERPAnalysis/
HiConfLoConf/ , MATLAB, 122 linesaoa_make_voltage_png_fil es_hiConf_loConf.m - EEGERPAnalysis/
HiConfLoConf/ , MATLAB, 152 linesaoa_present_voltage_time courses_spatiotemporal_f ilter_conf.m - EEGERPAnalysis/
RunAnalysis/ , MATLAB, 237 linesaoa_cluster_permutation_ v2_voltage_parallel_earl y_late.m - EEGERPAnalysis/
RunAnalysis/ , MATLAB, 109 linesaoa_hpc_make_mean_erp_sp lit_designations_runs.m - EEGERPAnalysis/
RunAnalysis/ , MATLAB, 176 linesaoa_hpc_plot_mean_erp_sp lit_designations_runs_ea rly.m - EEGERPAnalysis/
RunAnalysis/ , MATLAB, 176 linesaoa_hpc_plot_mean_erp_sp lit_designations_runs_la te.m - EEGERPAnalysis/
RunAnalysis/ , MATLAB, 129 linesaoa_make_voltage_png_fil es_early_late.m - EEGERPAnalysis/
RunAnalysis/ , MATLAB, 187 linesaoa_present_voltage_time courses_spatiotemporal_f ilter_v2_ea_lat.m - EEGERPAnalysis/
analyze_average_cluster_ , MATLAB, 228 linessize_voltage.m - EEGERPAnalysis/
aoa_cluster_permutation_ , MATLAB, 253 linesv2_voltage_parallel.m - EEGERPAnalysis/
aoa_eeg_epoch_level_proc , MATLAB, 193 linesessing_with_designations _g07.m - EEGERPAnalysis/
aoa_eeg_epoch_level_proc , MATLAB, 192 linesessing_with_designations _nl09.m - EEGERPAnalysis/
aoa_eeg_pca_ica_on_volta , MATLAB, 74 linesge_key_epochs_all_quizze s_then_choose.m - EEGERPAnalysis/
aoa_eeg_pca_ica_on_volta , MATLAB, 29 linesge_long.m - EEGERPAnalysis/
aoa_eeg_session_level_pr , MATLAB, 157 linesocessing_from_raw_one_se ssion.m - EEGERPAnalysis/
aoa_eeg_session_level_pr , MATLAB, 161 linesocessing_from_raw_two_se ssions.m - EEGERPAnalysis/
aoa_hpc_cut_long_epochs. , MATLAB, 65 linesm - EEGERPAnalysis/
aoa_hpc_make_mean_erp.m , MATLAB, 51 lines - EEGERPAnalysis/
aoa_hpc_plot_mean_erp.m , MATLAB, 203 lines - EEGERPAnalysis/
aoa_make_voltage_png_fil , MATLAB, 120 lineses.m - EEGERPAnalysis/
aoa_present_voltage_time , MATLAB, 167 linescourses_spatiotemporal_f ilter_v2.m - EEGERPAnalysis/
aoa_recut_weights_long_e , MATLAB, 51 linespochs.m - EEGERPAnalysis/
aoa_set_key_epoch.m , MATLAB, 83 lines - EEGERPAnalysis/
clicks/ , MATLAB, 225 linesanalyze_average_cluster_ size_clicks.m - EEGERPAnalysis/
clicks/ , MATLAB, 71 linesaoa_hpc_cut_click_epochs _from_confirm.m - EEGERPAnalysis/
clicks/ , MATLAB, 146 linesaoa_present_voltage_time courses_spatiotemporal_f ilter_v2_clicks.m - EEGERPAnalysis/
moveNminus1/ , MATLAB, 101 linesaoa_eeg_epoch_level_proc essing_spreadsheet_confi rm_n_minus_1.m - EEGERPAnalysis/
moveNminus1/ , MATLAB, 522 linesaoa_erp_plotting_mean_tr aces_confirm_nMinus1_v2. m - EEGERPAnalysis/
moveNminus1/ , MATLAB, 76 linesaoa_set_key_epoch_confir m_n_minus_1.m - EEGWaveletAnalysis/
analyze_average_cluster_ , MATLAB, 194 linessize_wavelet.m - EEGWaveletAnalysis/
aoa_cluster_permutation_ , MATLAB, 225 linesv2_wavelet.m - EEGWaveletAnalysis/
aoa_hpc_stdev_reject_wav , MATLAB, 48 lineselet.m - EEGWaveletAnalysis/
aoa_make_mean_spectrogra , MATLAB, 310 linesm_on_trials.m - EEGWaveletAnalysis/
aoa_make_wavelet_png_fil , MATLAB, 121 lineses.m - EEGWaveletAnalysis/
aoa_mean_wavelet_hpc.m , MATLAB, 349 lines - EEGWaveletAnalysis/
aoa_perform_wavelet.m , MATLAB, 148 lines - EEGWaveletAnalysis/
aoa_present_wavelet_time , MATLAB, 321 linescourses_spatiotemporal_f ilter.m - PupillometryBlinkSaccade
/ , MATLAB, 53 linesGetMicrosaccadesEK.m - PupillometryBlinkSaccade
/ , MATLAB, 35 linesStublinks60.m - PupillometryBlinkSaccade
/ , MATLAB, 228 linesaoa_build_blink_epochs.m - PupillometryBlinkSaccade
/ , MATLAB, 233 linesaoa_build_saccade_epochs .m - PupillometryBlinkSaccade
/ , MATLAB, 2,740 linesaoa_eye_metric_plotting_ only_v6.m - PupillometryBlinkSaccade
/ , MATLAB, 401 linesaoa_pupil_diameter_calcu lation.m - PupillometryBlinkSaccade
/ , MATLAB, 22 linesaoa_pupil_diameter_wrapp er_zscore.m - PupillometryBlinkSaccade
/ , MATLAB, 219 linesaoa_pupil_timecourse_per mutation_all_blink.m - PupillometryBlinkSaccade
/ , MATLAB, 241 linesaoa_pupil_timecourse_per mutation_sac_rate_rebase line.m - PupillometryBlinkSaccade
/ , MATLAB, 228 linesaoa_pupil_timecourse_per mutation_zscore_run.m - PupillometryBlinkSaccade
/ , MATLAB, 351 linesaoa_saccade_analysis.m - PupillometryBlinkSaccade
/ , MATLAB, 154 linesaoa_zscore_pupil_average .m - PupillometryBlinkSaccade
/ , MATLAB, 137 linesaoa_zscore_pupil_non_qui z.m - PupillometryBlinkSaccade
/ , MATLAB, 151 linesaoa_zscore_pupil_non_qui z_halves.m - PupillometryBlinkSaccade
/ , MATLAB, 672 linesfunc_aoa_eye_plotting_me an_traces_v2.m - PupillometryBlinkSaccade
/ , MATLAB, 639 linesplot_pupil_by_run.m - Puzzle_Complexity_Analys
is/ , MATLAB, 208 linesaoa_block_color_averages .m - Puzzle_Complexity_Analys
is/ , MATLAB, 461 linesaoa_generate_moves_and_t imes_v2.m - Video_Engagement_Familia
rity/ , MATLAB, 826 linesaoa_analyze_engagements_ with_full_slider_set.m - README, Text, 1 line
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 82 scripts, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability
All anonymized data created for the study are available in the Yale Dataverse: https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 18 authors, 5 keywords, 5 funders, 102 references.
Cite
This paper
Jin, D. S., Agdali, O., Yadav, T., Kronemer, S. I., Kunkler, S., Majumder, S., Khurana, M., McCusker, M., Fu, I., Siff, E. J., Khalaf, A., Christison-Lagay, K. L., Aerts, S. L., Xin, Q., Li, J.-J., McGill, S. H., Crowley, M. J., & Blumenfeld, H. (2026). Neural mechanisms of awareness of action. PNAS nexus, 5(7), pgag220. https://
BibTeX
@article{jin2026neural,
author = {Jin, David S and Agdali, Oumayma and Yadav, Taruna and Kronemer, Sharif I and Kunkler, Sydney and Majumder, Shweta and Khurana, Maya and McCusker, Marie and Fu, Ivory and Siff, Emily J and Khalaf, Aya and Christison-Lagay, Kate L and Aerts, Shanae L and Xin, Qilong and Li, Jing-Jing and McGill, Sarah H and Crowley, Michael J and Blumenfeld, Hal},
title = {{Neural mechanisms of awareness of action}},
journal = {PNAS nexus},
year = {2026},
month = jul,
volume = {5},
number = {7},
pages = {pgag220},
publisher = {Oxford University Press},
issn = {2752-6542},
doi = {10.1093/
url = {https://
pmid = {42416922},
pmcid = {PMC13340929}
}
RIS
TY - JOUR
AU - Jin, David S
AU - Agdali, Oumayma
AU - Yadav, Taruna
AU - Kronemer, Sharif I
AU - Kunkler, Sydney
AU - Majumder, Shweta
AU - Khurana, Maya
AU - McCusker, Marie
AU - Fu, Ivory
AU - Siff, Emily J
AU - Khalaf, Aya
AU - Christison-Lagay, Kate L
AU - Aerts, Shanae L
AU - Xin, Qilong
AU - Li, Jing-Jing
AU - McGill, Sarah H
AU - Crowley, Michael J
AU - Blumenfeld, Hal
TI - Neural mechanisms of awareness of action
T2 - PNAS nexus
J2 - PNAS Nexus
PY - 2026
DA - 2026/
VL - 5
IS - 7
SP - pgag220
SN - 2752-6542
PB - Oxford University Press
DO - 10.1093/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1093/
"type": "article-journal",
"title": "Neural mechanisms of awareness of action",
"container-title": "PNAS nexus",
"author": [
{
"family": "Jin",
"given": "David S"
},
{
"family": "Agdali",
"given": "Oumayma"
},
{
"family": "Yadav",
"given": "Taruna"
},
{
"family": "Kronemer",
"given": "Sharif I"
},
{
"family": "Kunkler",
"given": "Sydney"
},
{
"family": "Majumder",
"given": "Shweta"
},
{
"family": "Khurana",
"given": "Maya"
},
{
"family": "McCusker",
"given": "Marie"
},
{
"family": "Fu",
"given": "Ivory"
},
{
"family": "Siff",
"given": "Emily J"
},
{
"family": "Khalaf",
"given": "Aya"
},
{
"family": "Christison-Lagay",
"given": "Kate L"
},
{
"family": "Aerts",
"given": "Shanae L"
},
{
"family": "Xin",
"given": "Qilong"
},
{
"family": "Li",
"given": "Jing-Jing"
},
{
"family": "McGill",
"given": "Sarah H"
},
{
"family": "Crowley",
"given": "Michael J"
},
{
"family": "Blumenfeld",
"given": "Hal"
}
],
"container-title-short":
"volume": "5",
"issue": "7",
"page": "pgag220",
"DOI": "10.1093/
"PMID": "42416922",
"PMCID": "PMC13340929",
"ISSN": "2752-6542",
"publisher": "Oxford University Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
2
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1093/cercor/bhag108 [code]
- Action fluency and conscious intention: being aware of what we are about to do.Journal: Cerebral cortex (New York, N.Y. : 1991)In common: EEG, cognitive, 6 references
- [2] doi:10.1111/psyp.70280 [code]
- Spatial Distance and Temporal Attentional Focus Modulate Voluntary Action Preparation and Awareness.Journal: PsychophysiologyIn common: EEG, cognitive, 6 references
- [3] doi:10.1007/s00221-026-07304-y
- Anxiety disorders alter cognitive-motor integration during visuomotor adaptation and retention.Journal: Experimental brain researchIn common: EEG, cognitive, 6 references
- [4] doi:10.1007/s00221-026-07342-6 [code]
- A portable solution for simultaneous human movement and mobile EEG acquisition: readiness potential for basketball free-throw shooting.Journal: Experimental brain researchIn common: EEGLAB, Signal Processing Toolbox, Statistics and Machine Learning Toolbox, EEG, 3 references
- [5] doi:10.1523/eneuro.0316-25.2026 [code]
- Neural Mechanisms of Self-Generated Action Sequences.Journal: eNeuroIn common: EEGLAB, Statistics and Machine Learning Toolbox, EEG, cognitive, 3 references
- [6] doi:10.1371/journal.pbio.3003894
- Sequential neural dynamics underlie unconscious integration and conscious perception of visual stimuli.Journal: PLoS biologyIn common: EEG, cognitive, 4 references
- [7] doi:10.1093/nc/niag042
- Early correlates of visual awareness are affected by self-related information.Journal: Neuroscience of consciousnessIn common: EEG, cognitive, 4 references
- [8] doi:10.1038/s41586-026-10448-0 [code]
- Plasticity and language in the anaesthetized human hippocampus.Journal: NatureIn common: Image Processing Toolbox, Signal Processing Toolbox, Statistics and Machine Learning Toolbox, cognitive, 2 references
- [9] doi:10.1038/s41597-026-06616-6 [code]
- Sustained Attention Task (gradCPT) Dataset using simultaneous EEG-fMRI and DTI.Journal: Scientific dataIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, EEG, 1 reference
- [10] doi:10.1371/journal.pbio.3003938 [code]
- Theta oscillations tag episodic memories for sleep-dependent consolidation.Journal: PLoS biologyIn common: EEGLAB, Image Processing Toolbox, Signal Processing Toolbox, 1 other tool, EEG, cognitive
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 82 scripts, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:a89a69811cb49879…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
