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

LMM cluster permutation #6

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

LMM cluster permutation #6

wants to merge 9 commits into from

Conversation

behinger
Copy link
Member

@behinger behinger commented Apr 22, 2024

Initial code to run UnfoldMixedModel statistics via permutation testing and ClusterDepth.

Right now, no real interface exist, I used pvalues as the outfacing one. EDIT: This Is what I used in unfold for single-subject LMM pvalues.

pvalue is the official StatsAPI one.

Also the interface to select a statistical test via type is up for discussion.

Next there is a difference between permutation-test, clustercorrection-type / multiple-test-correction etc. E.g. you could use the permutation-scheme but want to use TFCE instead of ClusterDepth. You might not want to use permutations but FDR (but then you wouldnt use cluster correction). You might want to use bootstrapping and clusterdepth... so we have to come up with a good interface. Probably best to mirror some other toolbox (either HypothesisTests.jl or MNE probably)

Next, I didnt want everyone to need to load MixedModels etc. when they install UnfoldStats. So I generated a new extension. But unfortunately, extensions are not allowed to have dependencies themselves, so one has to run using MixedModelsPermutations,ClusterDepth for now in order to activate the extension.

Finally, I havent actually tested the code, so it very likely wont run yet!
Edit: Code seems to do something at least. Haven't added unittests yet

coefficient;
n_permutations = 10,
clusterforming_threshold = 1.8,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
)
)

) = throw(
"The `extract_coefs` function is currently not implemented for mixed-effects models.",
)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
end

# tvals = abs.(r.estimate ./ r.stderror)
# return tvals
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
end

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

Successfully merging this pull request may close these issues.

1 participant