|
1 | | -%Calculate the Greenhouse-Geisser or Hyunh-Feldt estimate of epsilon at all |
2 | | -%time points and electrodes |
| 1 | +%Calculate the Greenhouse-Geisser, Hyunh-Feldt, or lower bound estimate |
| 2 | +%of epsilon at all time points and electrodes |
3 | 3 | % |
4 | 4 | %EXAMPLE USAGE |
5 | 5 | % >> epsilon = estimate_epsilon(data, [], 3, 'gg'); |
|
19 | 19 | % calculate the main effect of A, dims = 3. If you want to |
20 | 20 | % calculate the AxB interaciton, dims = [3, 4]. |
21 | 21 | % method - 'gg': Greenhouse-Geisser, 'hf':Hyunh-Feldt, or 'lb': |
22 | | -% lower bound |
| 22 | +% lower bound {default: 'gg'} |
23 | 23 | % |
24 | 24 | %OUTPUT |
25 | | -% epsilon - electrode x time point array of GG estimate of epsilon |
| 25 | +% epsilon - electrode x time point array of epsilon estimate |
26 | 26 | % |
27 | 27 | % |
28 | | -%VERSION DATE: 9 June 2020 |
| 28 | +%VERSION DATE: 11 June 2020 |
29 | 29 | %AUTHOR: Eric Fields |
30 | 30 | % |
31 | 31 | %NOTE: This function is provided "as is" and any express or implied warranties |
|
50 | 50 | %Get data reduced for analysis |
51 | 51 | reduced_data = reduce_data(data, dims); |
52 | 52 |
|
53 | | - %Get some useful numbers |
54 | | - assert(ndims(reduced_data)==4); |
55 | | - [n_electrodes, n_time_pts, n_conds, n_subs] = size(reduced_data); |
56 | | - df_effect = n_conds - 1; |
57 | | - |
58 | 53 | %This function currently only works for one-way fully repeated measures designs |
59 | 54 | if ~isempty(cond_subs) && ~isequal(cond_subs, 0) && length(cond_subs) > 1 |
60 | 55 | error('estimate_epsilon curently only implemented for fully repetaed measures ANOVA'); |
|
63 | 58 | error('estimate_epsilon currently does not support more than one factor with more than 2 levels'); |
64 | 59 | end |
65 | 60 |
|
| 61 | + %Get some useful numbers |
| 62 | + [n_electrodes, n_time_pts, n_conds, n_subs] = size(reduced_data); |
| 63 | + df_effect = n_conds - 1; |
| 64 | + |
66 | 65 | if strcmpi(method, 'lb') |
67 | 66 |
|
68 | 67 | %Lower bound on epsilon |
|
0 commit comments