Comments (17)
++++++1 :)
from mne-python.
... won't be 0.5. however ;-)
from mne-python.
I have a basic implementation of ANOVA capability for balanced and completely specified models at https://github.com/christianmbrodbeck/Eelbrain/blob/master/eelbrain/analyze/glm.py . Model specification is done with the factors I described in Issue #133, but that could be modified.
from mne-python.
To be more specific:
- for univariate dependent variables, I have implemented incremental f-tests for fixed effects models which can include scalar and categorial predictors example.
- For balanced models I have also implemented random effects models example.
- For the latter method I have added a class that can fit the model to several data points simultaneously, which can then be used for a cluster permutation test example. Here the ndvar object is useful because you can submit data with an arbitrary dimensions (time, sensor, source, ....) and get the result map of F- or p-values (or cluster extent) back with the same dimensions (minus the 'case' dimension).
from mne-python.
Hi chris,
thanks! let's get back and see how we can interface / support integrate your efforts as the anova issue will transform into a WIP PR. Maybe we can setup that up together. From my side however not before 0.5
Best,
Denis
On 06.12.2012, at 00:50, Christian Brodbeck [email protected] wrote:
I have a basic implementation of ANOVA capability for balanced and completely specified models at https://github.com/christianmbrodbeck/Eelbrain/blob/master/eelbrain/analyze/glm.py . Model specification is done with the factors I described in Issue #133, but that could be modified.
—
Reply to this email directly or view it on GitHub.
from mne-python.
Addressed by #580. Closing.
from mne-python.
hey there, so does mne-python
have a repeated measures anova? if so what's the name of the function - and are there any docs?
I'd also be willing to provide a more general package atom (ebuild) for my distribution (gentoo) if I can use your software.
from mne-python.
hi,
look at this diff:
https://github.com/mne-tools/mne-python/pull/580/files
you'll see the example and the function of interest to you is : f_twoway_rm
the rendered example is at :
if some doc or function is missing don't hesitate to send us a pull request to help us making MNE-Python better.
Regarding gentoo packaging that would be great. Maybe @mluessi can give a hand too as a gentoo user.
Hope this helps,
Alex
from mne-python.
Hi @TheChymera , now @agramfort was faster. Two things to add. First, this is optimized for mass-univariate use cases (estimate thousands of models at once), the interface is hence more Matlab-like, matrix oriented an allows for passing large matrices with thousands of observations per person. Functionality is tested against R and SPSS and of course you can also pass behavioral data with one observation per subject. Second currently we only have 2-way repeated measures ANOVA. Extending the code is relatively easy though, e.g. supporting more factors, non-repeated factors (e.g. groups) and covariates. However I did not have a real use case for this since simple 2-way ANOVA models are already quite complex in an MEG context. From my point of view adding groups support, a third factor and a covariate would make sense. From your post records across different projects (Psychopy, statsmodels) it seems you're looking for standard functionality / sth. for behavioural data. Why not R then? Gentoo packaging is of course a nice idea ;-) and of course if you're interested in extending our ANOVA support contributions are always welcome.
from mne-python.
@dengemann Well, I want to keep all of my data post-processing and analysis in python instead of switching between programs. I tried Rpy but for some reason I have issues formatting my pandas dataframe for R...
Anyway, do you have a one-way repeated measure ANOVA? or cam I use f_twoway_rm
for that as well? I have 5 conditions presented to 10 participants with 100 trials each - I'm only interested in the variance of the conditions, not of the participants etc.
from mne-python.
Here is some pseudo code / snippet thatdemonstrates how I use Rpy (for 'small' data / when it comes to standard analyses I always do this at some point --- I guess Python will never, at least not in the next 5-10 years catch up with all the general stats provided in R -- it's strength is in particular and advanced packages. Python makes tackling difficult / new problems fun, so many developers / scientists choose it to start a new project rather than reimplementing what's e.g. in R. People simply want to work on new stuff ;-). I can see that Rpy does not come with a self-evident API and you need to know both R and Python to take full advantage of it. But given my prediction it's worth the effort, and actually it works nicely.)
import pandas.rpy.common as com
import pandas as pd
base = com.importr('base')
stats = com.importr('stats')
# .... read data and stuff, a few lines omitted
aggfunc = np.mean # how to aggregegate
agglist = ['subject', 'A', 'B', 'C'] # splitby
fml = 'latency ~ A * B * C + Error(subject/ (A * B * C))' # formula string
df_ = df.groupby(agglist).agg(aggfunc).reset_index() # final structure to be tested
dfr = com.convert_to_r_dataframe(df_, True) # convert from pandas to R and make string columns factors
fml_ = Formula(fml) # make a formula obect
print str(base.summary(stats.aov(fml_, dfr)))
As to the one-way in mne-python.... I don't know whether the implemented version accepts 1-factor only input, I never tried. You would need to setup a matrix with 5 columns (one for each level) and try to pass [5] as factor_levels
argument.
from mne-python.
Btw. you can also take a look at Roger Lew's pyvttbl package https://pypi.python.org/pypi/pyvttbl/0.4.1.0, I think this the most comprehensive collection of ANOVA models in Python. I drew from there and we actually had discussions at statsmodels to refactor his code and add it there. But no one including himself or myself had time for it.
from mne-python.
@TheChymera having mne-python in the gentoo science overlay would be perfect. I will be happy to assist with making an ebuild :).
from mne-python.
@mluessi I'm caught up quite a bit in my master thesis until the start of december, so since I won't be using the mne-python ANOVA function, I'll only get to the ebuild after that. There are a number of high-profile neuroscience packages still not merged into gentoo-sci - there's a list with them (as well as some info on neuro~gentoo) in this neurogentoo guide. If you have any provisorial ebuild for mne-python I can add it to the listing, maybe someone will notice it even before I get more time.
from mne-python.
@TheChymera btw I took a look at running one-way repeated measures with our ANOVA. The contrast coding as is implemented right now prevents such a model, adding support for it should not be too difficult though. I just won't have time for it, unless an urgent use case emerges on my end which I don't see coming.
from mne-python.
@TheChymera thanks for the link. I will look into making an mne-python ebuild, it should be terribly simple, unlike e.g. packing for Debian ;). Good luck with your thesis.
from mne-python.
+1
from mne-python.
Related Issues (20)
- BUG: Wrong output for adjacency=False
- bad colormap behavior when brain vlim sliders crossover
- Eyelink: Accept blank recording dates? HOT 3
- Release workflow HOT 16
- The PyQt6 dependency HOT 14
- Logging issue in jupyter kernel when logs are issued in a Thread HOT 4
- Add an SSVEP classification algorithm as a new feature HOT 3
- ValueError: Points have to be provided as one dimensional arrays of length 3. HOT 2
- Request for Sensor Labeling Check in Child-Customized MEG System HOT 2
- Depend on `h5io` and `pymatreader` by default HOT 3
- Tracking issue for (implicit) MNE dependencies still lacking binary wheels for `aarch64` (ARM Linux) HOT 3
- small security upgrade to our upload action
- MAINT: Switch to *_array instead of *_matrix for sparse
- RuntimeWarning for channels with different filter settings on import HOT 12
- Cannot build HTML docs HOT 1
- Export EDF using `mne.export.export_raw`: Signal range error when original data range does not include zero AND data is not equal-length HOT 10
- Add the possibility to provide custom color mapping for channels in raw.plot() HOT 2
- Add reader for annotations in MIT format HOT 3
- Remove average parameter from CSP and SPoC plotting methods HOT 3
- Backward compatibility and numpy 2.0 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mne-python.