Digging into the R-code behind AIC for gaussian family models, I see: AIC = nobs * (log(dev/nobs * 2 * pi) + 1) + 2 - sum(log(wt)) + 2 * p dev = sum(wt * (y - mean(y))^2 For the unweighted case, this translates directly to -2LL with the penalty number of parameters including both intercept and error term (as represented by the constant + 2) and the unknown sigma-squared = sum((y - mean(y)^2)/ nobs (rather than nobs-1). However, with weights, I am at a loss to understand the expression, because, given -2LL = nobs * (log(2 * pi * sigma^2) + sum(wt * (y - mean(y))^2/sigma^2 if sigma^2 = sum(wt * (y - mean(y))/sum(wt) then -2LL = nobs * (log(2 * pi *dev/nobs) + log(nobs) - log(sum(wt)) + sum(wt) so if wt = 1 all is fine because -2LL = nobs * (log(2 * pi * dev/nobs) + 1) What am I missing? Thanks!
-joe yarmus ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.