Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dimension not match Error when bootstrapping Joint PDM #17

Open
hitrp opened this issue Dec 24, 2020 · 3 comments
Open

Dimension not match Error when bootstrapping Joint PDM #17

hitrp opened this issue Dec 24, 2020 · 3 comments

Comments

@hitrp
Copy link

hitrp commented Dec 24, 2020

There's one dimension not match error when running multivaraiteMediation function, and the error occurs in BootPDMJoint.m:
worig = worig.*repmat(sign(torig(3,:)),p,1);

Here, I am using 10 PDMs, the dimensions info are: worig=#voxles * 1, torig=5*10, p=10 * #voxels.
After this, I get worig=#voxels * 1 and repmat(sign(torig(3,:)),p,1)=#voxels * 10, they are not matched for . * indeed.
However, there's no error in previous steps, and I'm not sure about what happens here, and also not quite clear about the mathematics behind it, could you give me some idea?

@torwager
Copy link
Contributor

torwager commented Dec 26, 2020 via email

@hitrp
Copy link
Author

hitrp commented Dec 27, 2020

Dear Prof.Wager,

Sorry for the mistake in my original description, P surely equals #voxels, and the error comes from
worig = worig.*repmat(sign(torig(3,:)),p,1);

worig=#voxels * 1, however, repmat(sign(torig(3,:)),p,1)=#voxels * 10 cause sign(torig(3,:))=5 * 10.

I guess the original goal is to calculate the elementwise product between worig and each column of repmat(sign(torig(3,:)),p,1)=#voxels * 10, right? In this case, I find bsxfun(@times,worig,repmat(sign(torig(3,:)),p,1)) works.

Please forgive me if there's any mistake.

Best regards,
Peng

@hitrp
Copy link
Author

hitrp commented Dec 27, 2020

Dear Prof.Wager,

Just to make sure about the pipeline of Multivariate Mediation Analysis in your recent "Multiple Brain Networks Mediating Stimulus–Pain Relationships in Humans" article to avoid vital mistakes. These are the ideas I summarize from reading the article and emailing Prof.Lindquist. Any instruction would be much appreciated!

  1. make sure a significant path c before I conduct multivariate mediation with multivariateMediation() and then get the number of PDMs used with PDM_toolbox, also the distribution of the PDMs and the a, b path coefficient but not p values of the paths
  2. map the PDM to voxels using FDR correction
  3. conduct a secondary mediation test to figure out if a specific PDM plays as the mediator, with the evaluation of the significance of their paths with mediation().

Is this the case?
--The multivariateMediation() function seems to only find PDMs and a, b path, but not evaluate the significance of them. am I right?
--and why does the coefficient of the path a and b for PDM1 in the secondary analysis (with mediation() in 1st figure below) differs so much from that from the first analysis (multivaraiteMediation() in 2nd figure below), could you give me some ideas?
--What if I find no significant a and b path in secondary mediation analysis? Do I need to discard this PDM? just like in the 1st figure below.

image (1)
image (2)

Seasons Greeting,
Peng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants