File: two_sample_mixed_effects.py

package info (click to toggle)
nipy 0.1.2%2B20100526-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 11,992 kB
  • ctags: 13,434
  • sloc: python: 47,720; ansic: 41,334; makefile: 197
file content (28 lines) | stat: -rw-r--r-- 552 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Demo two sample mixed effect models;
"""
print __doc__

import numpy as np
from nipy.neurospin.group import twosample

n1 = 8
n2 = 8

y1 = np.random.rand(n1)
v1 = .1*np.random.rand(n1)

y2 = np.random.rand(n2)
v2 = .1*np.random.rand(n2)

nperms = twosample.count_permutations(n1, n2)

magics = np.asarray(range(nperms))

t = twosample.stat_mfx(y1,v1,y2,v2,id='student_mfx',Magics=magics)

import pylab as pl
pl.hist(t, 101)
pl.show()