# Possible to calculate AIC from $r^2$, $\sigma$ and/or p-value for $r^2$

As per the heading, is it possible to add AIC to some previously computed models based on the stats I have (which include $r^2$, its p-value, $\sigma$ for each variable individually)?

They are all bivariate models, though with some calibration parameters (I know the number of parameters in each model to feed into AIC).

(Footnote)

(If that's not enough I also have bivariate linear regression results (parameters for best fit line, including $F$ statistic, and $\sigma$ and $t$ for the gradient and intercept); though I don't think, for a bivariate model in which I don't care about the means, that fundamentally tells me anything different does it?)

• Oh dear, I'd better paste that again (can't find how to edit it!) Jun 23, 2014 at 14:22
• The current answers do not contain enough detail. Putting a bounty on this as I'd like to express AIC directly in terms of n, r2 and p(the number of parameters). Frank has given a good initial answer and what I want to know should be a simple variable substitution from that, except that it′s not clear what he means by 'degrees of freedom' − could be p or n-p. Jun 23, 2014 at 14:23
• $AIC = n \cdot ln \left( RSS/n \right) + 2 \cdot k$ where $n$ is number of data points, $RSS$ is residual sum of squares, and $K$ is the number of parameters in the model. This assumes that the inequality $n/K < 40$ is true, otherwise you want to use corrected AIC, or $AIC_c$. You can get RSS from ($R^2$) if you know the residual sum of squares to the mean, as well as to your fit function. $R^2=1-\frac {RSS_{fit}} {RSS_{mean}}$. Many fit programs provide RSS directly. Jun 23, 2014 at 14:32

I'm not sure how to exactly get AIC (i.e., which term to add) but you can use the likelihood ratio $\chi^2$ statistic minus twice the degrees of freedom as a substitute in many cases, and $\chi^{2} = - n \times \log(1 - R^{2})$ for a Gaussian model.
• So you are saying $AIC \approx -n log (1-R^2) - 2(DF)$ where $DF = n - p$ and $p$ is the number of parameters in the model? Jun 18, 2014 at 12:27
• Hang on - doesn't low $R^2$ therefore imply low $\chi^2$ and hence low AIC? Shouldn't low $R^2$ mean a worse (higher) AIC not better? Jun 18, 2014 at 13:29
• And do you mean $log$ or $ln$? Jun 18, 2014 at 13:31