Menu

indices of model fit

Help
2019-01-16
2019-03-01
  • Jonas Zaman

    Jonas Zaman - 2019-01-16

    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

     
  • Dominik Bach

    Dominik Bach - 2019-01-21

    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

     
  • Jonas Zaman

    Jonas Zaman - 2019-02-22

    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.

     
  • Dominik Bach

    Dominik Bach - 2019-03-01

    This is correct although I'm not entirely sure about the AIC equation, but that is an issue outside PsPM. Dominik

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.