I looked in the manual and on previous post on the forum but have not find the solution to my question.
I was wondering where I could find any indices of model fit (AIC) per subject glm and whether it is possible to get an overall index of model fit across subjects after runing a glm for skin conductance as we want to compare three different model with increasing complexity . I only found the function pspm.predval but I'm not sure how to use it for this end.
Many thanks in advance.
Jonas Zaman
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for you reply. I think I found the solution to my question but just wanted to double check.
So using Y and Yhat I get RSS which I can use to calculate AIC per subject. If I now want to compare three different models across all subjects is it correct that I use the average AIC (across subjects) and compare the averaged AIC's between my three models to compare models?
For i=1:60 % nr of subjects
% with k = number of parameters, n = number of trials
k = length(glm.stats);
n = sum(isnan(glm.Y) == 0);
% get residual sum of squares
RSS = nansum(glm.Y - glm.Yhat)^2;
% Get AIC for a subject
AIC(i) = 2k + n(log(2(pi)RSS/(n))+1);
% Get average AIC across subjects
Average_AIC = mean(AIC);
Many thanks in advance for all the effort and time you spend on helping us.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Dominik,
I looked in the manual and on previous post on the forum but have not find the solution to my question.
I was wondering where I could find any indices of model fit (AIC) per subject glm and whether it is possible to get an overall index of model fit across subjects after runing a glm for skin conductance as we want to compare three different model with increasing complexity . I only found the function pspm.predval but I'm not sure how to use it for this end.
Many thanks in advance.
Jonas Zaman
H Jonas
For a start, please have a look here:
https://sourceforge.net/p/pspm/discussion/help/thread/addfd37e/#5d96
Do update me if you want me to expand on this, or have further questions.
Best
Dominik
Hi Domink,
Thanks for you reply. I think I found the solution to my question but just wanted to double check.
So using Y and Yhat I get RSS which I can use to calculate AIC per subject. If I now want to compare three different models across all subjects is it correct that I use the average AIC (across subjects) and compare the averaged AIC's between my three models to compare models?
For i=1:60 % nr of subjects
% with k = number of parameters, n = number of trials
k = length(glm.stats);
n = sum(isnan(glm.Y) == 0);
% get residual sum of squares
RSS = nansum(glm.Y - glm.Yhat)^2;
% Get AIC for a subject
AIC(i) = 2k + n(log(2(pi)RSS/(n))+1);
% Get average AIC across subjects
Average_AIC = mean(AIC);
Many thanks in advance for all the effort and time you spend on helping us.
This is correct although I'm not entirely sure about the AIC equation, but that is an issue outside PsPM. Dominik