canlab / MediationToolbox

Single-level and multi-level mediation analyses for any kind of data, with bootstrap-based significance testing. Neuroimaging-oriented functions allow for mediation effect parametric mapping (mapping of mediation effects across the brain) and multivariate mediation.
https://canlabweb.colorado.edu/wiki/doku.php/help/mediation/m3_mediation_fmri_toolbox
78 stars 28 forks source link

Problems with bootstrapping #10

Open cmorawe opened 4 years ago

cmorawe commented 4 years ago

Hi everyone, I try to run the mediation analysis with bootstrapping using the example scripts and get the following error message:

Error using normpdf (line 3) Not enough input arguments.

Error in Bneeded (line 47) g = normpdf(q);

Error in mediation>get_boot_samples_needed (line 1410) [B95, Be, alphaaccept] = Bneeded(max(.005, minp), targetu);

Error in mediation/add_boot_samples_needed (line 911) [Be, alphaaccept] = get_boot_samples_needed(stats.p, whpvals_for_boot, targetu, bootsamples, verbose);

Error in mediation (line 371) add_boot_samples_needed();

Error in mediation_search (line 143) [paths, stat] = mediation(X, Y, M(:,region), varargin{:}, 'persistent', extra_args{:}, 'pvals_for_boot', pvals_for_boot, 'arorder', arorder);

Error in mediation_brain/process_slice (line 314) slice_results = mediation_search('M', X, Y, M(:,whvox), varargin{:});

Error in mediation_brain (line 276) process_slice();

Error in mediation_testscript1 (line 64) results = mediation_brain(x,y,imgs,'names',names,'mask', mask_name,'boot','pvals',5, 'bootsamples', 1000);

Could anyone help me on this? Any help is very much appreciated.

Thanks a lot in advance. Best regards, Carmen

torwager commented 4 years ago

Carmen,

It looks like you might have a different version of normpdf.m on your path for some reason - Could you verify that you’re using Matlab’s version? e.g.,

which normpdf

MATLAB_R2018a.app/toolbox/stats/stats/normpdf.m

Best wishes, Tor


Tor Wager Diana L. Taylor Distinguished Professor Presidential Cluster in Neuroscience and Department of Psychological and Brain Sciences Dartmouth College


On May 15, 2020, at 9:10 AM, cmorawe notifications@github.com wrote:

Hi everyone, I try to run the mediation analysis with bootstrapping using the example scripts and get the following error message:

Error using normpdf (line 3) Not enough input arguments.

Error in Bneeded (line 47) g = normpdf(q);

Error in mediation>get_boot_samples_needed (line 1410) [B95, Be, alphaaccept] = Bneeded(max(.005, minp), targetu);

Error in mediation/add_boot_samples_needed (line 911) [Be, alphaaccept] = get_boot_samples_needed(stats.p, whpvals_for_boot, targetu, bootsamples, verbose);

Error in mediation (line 371) add_boot_samples_needed();

Error in mediation_search (line 143) [paths, stat] = mediation(X, Y, M(:,region), varargin{:}, 'persistent', extra_args{:}, 'pvals_for_boot', pvals_for_boot, 'arorder', arorder);

Error in mediation_brain/process_slice (line 314) slice_results = mediation_search('M', X, Y, M(:,whvox), varargin{:});

Error in mediation_brain (line 276) process_slice();

Error in mediation_testscript1 (line 64) results = mediation_brain(x,y,imgs,'names',names,'mask', mask_name,'boot','pvals',5, 'bootsamples', 1000);

Could anyone help me on this? Any help is very much appreciated.

Thanks a lot in advance. Best regards, Carmen

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/canlab/MediationToolbox/issues/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPY7LDYIBUELG5XBKB6VTLRRU5NFANCNFSM4NBSAR4Q.

cmorawe commented 4 years ago

Hi Tor,

Thanks for the quick reply.

Yes that’s true!

/Applications/spm12/spm12/toolbox/ledalab-349/main/util/normpdf.m

I guess, I need the stats toolbox for the bootstrapping?

I am using Matlab R2014a.

Thanks again and best wishes, Carmen

Dr. Carmen Morawetz Arbeitsbereich Biologische Psychologie und Kognitive Neurowissenschaft Raum JK25/221d Freie Universität Berlin Habelschwerdter Allee 45 14195 Berlin

+49 (0)30 838 - 55 749 carmen.morawetz@fu-berlin.demailto:carmen.morawetz@fu-berlin.de

Am 15.05.2020 um 17:20 schrieb Tor Wager notifications@github.com<mailto:notifications@github.com>:

Carmen,

It looks like you might have a different version of normpdf.m on your path for some reason - Could you verify that you’re using Matlab’s version? e.g.,

which normpdf

MATLAB_R2018a.app/toolbox/stats/stats/normpdf.m

Best wishes, Tor


Tor Wager Diana L. Taylor Distinguished Professor Presidential Cluster in Neuroscience and Department of Psychological and Brain Sciences Dartmouth College


On May 15, 2020, at 9:10 AM, cmorawe notifications@github.com<mailto:notifications@github.com> wrote:

Hi everyone, I try to run the mediation analysis with bootstrapping using the example scripts and get the following error message:

Error using normpdf (line 3) Not enough input arguments.

Error in Bneeded (line 47) g = normpdf(q);

Error in mediation>get_boot_samples_needed (line 1410) [B95, Be, alphaaccept] = Bneeded(max(.005, minp), targetu);

Error in mediation/add_boot_samples_needed (line 911) [Be, alphaaccept] = get_boot_samples_needed(stats.p, whpvals_for_boot, targetu, bootsamples, verbose);

Error in mediation (line 371) add_boot_samples_needed();

Error in mediation_search (line 143) [paths, stat] = mediation(X, Y, M(:,region), varargin{:}, 'persistent', extra_args{:}, 'pvals_for_boot', pvals_for_boot, 'arorder', arorder);

Error in mediation_brain/process_slice (line 314) slice_results = mediation_search('M', X, Y, M(:,whvox), varargin{:});

Error in mediation_brain (line 276) process_slice();

Error in mediation_testscript1 (line 64) results = mediation_brain(x,y,imgs,'names',names,'mask', mask_name,'boot','pvals',5, 'bootsamples', 1000);

Could anyone help me on this? Any help is very much appreciated.

Thanks a lot in advance. Best regards, Carmen

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/canlab/MediationToolbox/issues/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPY7LDYIBUELG5XBKB6VTLRRU5NFANCNFSM4NBSAR4Q.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/canlab/MediationToolbox/issues/10#issuecomment-629301716, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADLQQXKV3TI2CCDOZ53ESFTRRVMVTANCNFSM4NBSAR4Q.