Displaying 20 results from an estimated 2000 matches similar to: "AIC in glm()"
2007 Dec 07
1
AIC v. extractAIC
Hello,
I am using a simple linear model and I would like to get an AIC value. I
came across both AIC() and extractAIC() and I am not sure which is best to
use. I assumed that I should use AIC for a glm and extractAIC() for lm,
but if I run my model in glm the AIC value is the same if I use AIC() on an
lm object. What might be going on? Did I interpret these functions
incorrectly?
Thanks,
2008 Nov 28
2
AIC function and Step function
I would like to figure out the equations for calculating "AIC" in both
"step() function" and "AIC () function". They are different. Then I
just type "step" in the R console, and found the "AIC" used in "step()
function" is "extractAIC". I went to the R help, and found:
"The criterion used is
AIC = - 2*log L + k *
2008 Apr 29
1
AIC extract and comparison
Hi, I need to fit models and use AIC method to campare the best fitted model
manually.
When i extract AIC by using extractAIC, it gave me the df and AIC values.
Now the problem is, how can I compare the AIC values from two models?
is there anyway to extract AIC with no df so that I can compare directly?
Thank you!
> extractAIC(coxout)
[1] 1.000 1723.038
[[alternative HTML version
2007 Jun 01
1
AIC consistency with S-PLUS
Hello-
I understand that log-likelihoods are bound to differ by constants, but if i estimate AIC for a set of simple nested linear models using the following 4 methods, shouldn't at least two of them produce the same ordering of models?
in R:
extractAIC
AIC
in S-PLUS:
AIC
n*log(deviance(mymodel)/n) + 2*p
I find it troubling that these methods all give me different answers as to the best
1998 Feb 03
2
glm(.) / summary.glm(.); [over]dispersion and returning AIC..
I have been implementing a proposal of Jim Lindsey for glm(.)
to return AIC values, and
print.glm(.) and print.summary.glm(.) printing them....
however:
>>>>> "Jim" == Jim Lindsey <jlindsey@luc.ac.be> writes:
Jim> The problem still remains of getting the correct AIC when the user
Jim> wants the scale parameter to be fixed. (The calculation should
2007 Aug 15
1
AIC and logLik for logistic regression in R and S-PLUS
Dear R users,
I am using 'R' version 2.2.1 and 'S-PLUS' version 6.0; and I loaded the
MASS library in 'S-PLUS'.
I am running a logistic regression using glm:
---------------------------------------------------------------------------
> mydata.glm<-glm(COMU~MeanPycUpT+MeanPycUpS, family=binomial, data=mydata)
1998 Feb 04
0
[J.Lindsey: Re: glm(.) / summary.glm(.); [over]dispersion and returning AIC..]
--Multipart_Wed_Feb__4_12:25:40_1998-1
Content-Type: text/plain; charset=US-ASCII
Jim, I am relating your message to R-devel.
This should be discussed in a broader audience;
I am not an expert on GLM's, I know you are
and others on this group also...
R-develers, please CC to Jim Lindsey (on this topic), since he hasn't
been part of the R-devel list for a while..
BTW: I will be gone
2005 Jan 26
2
Source code for "extractAIC"?
Dear R users:
I am looking for the source code for the R function extractAIC. Type the
function name doesn't help:
> extractAIC
function (fit, scale, k = 2, ...)
UseMethod("extractAIC")
<environment: namespace:stats>
And when I search it in the R source code, the best I can find is in (R
source root)/library/stats/R/add.R:
extractAIC <- function(fit, scale, k = 2,
2005 Nov 29
1
saving AIC of intermediate models in step
Hi all,
I'm fitting GLM's using the step or stepAIC procedures and I would
like to save the AIC of the intermediate models. I would appreciate
very much information about how todo this.
Best wishes
Germ??n L??pez
2004 Mar 09
4
aic calculation
hello,
could somebody refer me to the reason R uses
-2*loglik + 2*(#param)+2
to calculate AIC?
thank you
--
Stoyan Iliev
2006 Aug 06
1
extractAIC using surf.ls
Although the 'spatial' documentation doesn't mention that extractAIC
works, it does seem to give an output.
I may have misunderstood, but shouldn't the following give at least
the same d.f.?
> library(spatial)
> data(topo, package="MASS")
> extractAIC(surf.ls(2, topo))
[1] 46.0000 437.5059
> extractAIC(lm(z ~ x+I(x^2)+y+I(y^2)+x:y, topo))
[1]
2005 Aug 08
2
AIC model selection
Hello All;
I need to run a multiple regression analysis and use Akaike's Information
Criterion for model selection. I understand that this command will give the
AIC value for specified models:
AIC(object, ..., k = 2)
with "..." meaning any other optional models for which I would like AIC
values. But, how can I specify (in the place of "...") that I want R to
2008 Feb 26
2
AIC and anova, lme
Dear listers,
Here we have a strange result we can hardly cope with. We want to
compare a null mixed model with a mixed model with one independent
variable.
> lmmedt1<-lme(mediane~1, random=~1|site, na.action=na.omit, data=bdd2)
> lmmedt9<-lme(mediane~log(0.0001+transat), random=~1|site,
na.action=na.omit, data=bdd2)
Using the Akaike Criterion and selMod of the package pgirmess
2004 May 24
1
bug in extractAIC.survreg (PR#6910)
Full_Name: Dave Ramsey
Version: 1.8.0
OS: win2000
Submission from: (NULL) (202.27.240.6)
there is a bug in extractAIC.survreg in library MASS.
A survreg model object has no component called "residuals". Hence
n <- length(fit$residuals)
returns 0 resulting in errors
workaround: replace
n <- length(fit$residuals)
with
n <- length(residuals(fit))
### sorry: error
2010 Dec 26
1
Calculation of BIC done by leaps-package
Hi Folks,
I've got a question concerning the calculation of the Schwarz-Criterion
(BIC) done by summary.regsubsets() of the leaps-package:
Using regsubsets() to perform subset-selection I receive an regsubsets
object that can be summarized by summary.regsubsets(). After this
operation the resulting summary contains a vector of BIC-values
representing models of size i=1,...,K.
My problem
2011 Dec 20
2
Extract BIC for coxph
Dear all,
is there a function similar to extractAIC based on which I can extract the
BIC (Bayesian Information Criterion) of a coxph model?
I found some functions that provide BIC in other packages, but none of them
seems to work with coxph.
Thanks,
Michael
[[alternative HTML version deleted]]
2018 Jun 26
3
list of methods
I recently got a request to add head() and tail() methods for Surv objects, which is quite
reasonable, but not unlike other requests for logLik,? vcov, extractAIC, ...?? What they
all have in common is that are methods added since creation of the survival package, and
that I didn't know they existed.
To try and get ahead of the curve, is there a way to list names of all of the default
2017 Jun 08
1
stepAIC() that can use new extractAIC() function implementing AICc
I would like test AICc as a criteria for model selection for a glm using
stepAIC() from MASS package.
Based on various information available in WEB, stepAIC() use
extractAIC() to get the criteria used for model selection.
I have created a new extractAIC() function (and extractAIC.glm() and
extractAIC.lm() ones) that use a new parameter criteria that can be AIC,
BIC or AICc.
It works as
2012 Sep 29
1
Problems with stepAIC
Dear help community,
I'm a R-beginner and use it for my master thesis.
I've got a mixed model and want to analyse it with lme. There are a lot
Cofactors that coult be relevant. To extract the important ones I want to do
the stepAIC, but always get an error warning.
Structure of my data:
data.frame': 72 obs. of 54 variables:
$ Block : Factor w/ 3 levels
2011 Feb 23
1
request for patch in "drop1" (add.R)
By changing three lines in drop1 from access based on $ to access
based on standard accessor methods (terms() and residuals()), it becomes
*much* easier to extend drop1 to work with other model types.
The use of $ rather than accessors in this context seems to be an
oversight rather than a design decision, but maybe someone knows better ...
In particular, if one makes these changes (which I am