Skip to content

Commit

Permalink
correct AIC in scr_predval, clean up manual versions
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/pspm/svn/trunk@92 23ec9670-3a1e-4a12-9187-a0ba8bce340d
  • Loading branch information
Dominik Bach committed Jun 5, 2015
1 parent 2435f93 commit 16431e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Binary file not shown.
6 changes: 4 additions & 2 deletions scr_predval.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
%
% with X: a 2-column vector for paired tests, a 2-element cell
% array for unpaired tests
% AIC: computed from RSS of the predictive model
% AIC: computed from RSS of the predictive model, up to a
% constant (i. e. only AIC comparisons are meaningful)
% T: t-value of the associated t-test
% df: df of the associated t-test
%__________________________________________________________________________
Expand Down Expand Up @@ -64,7 +65,8 @@
[b, dev, stat] = glmfit(X, Y);
T = stat.t(2); % first column is intercept
RSS = sum(stat.resid(:).^2);
AIC = n * log(RSS/n);
% number of parameters: number of columns in X, plus intercept
AIC = n * log(RSS/n) + 2 * (1 + size(X, 2));



Expand Down

0 comments on commit 16431e1

Please sign in to comment.