search for: extractaic

Displaying 20 results from an estimated 81 matches for "extractaic".

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 <- funct...
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 expected using extractAIC() but when I run stepAIC(), the first AIC shown in th...
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...
2017 Aug 23
0
MASS:::dropterm.glm() and MASS:::addterm.glm() should use ... for extractAIC()
...Ripley. I hope it could have been fixed. Sincerely Marc Le 09/07/2017 ? 16:05, Marc Girondot via R-devel a ?crit?: > Here is a change required from MASS:::dropterm.glm() and > MASS:::addterm.glm(). > > Thanks > > Marc > > > The stepAIC() function from package MASS uses extractAIC() to get the > AIC from a model. > Several methods exist: > extractAIC.glm() for example, some in MASS packages and some in stats > package. > > The parameters for extractAIC() are: > fit, scale, k = 2, ... > > The ... are not used in most of the extractAIC.xxx() method...
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, Ryan ~~~~~~~~~~~~~~~...
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 * edf, where L is the likelihood and edf the equivalent degrees of freedom (i.e., the number of free parameters for usual parametric models) of fit. For linear models with unknown scale (i.e., for lm and aov)...
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 in my email address...
2010 Dec 26
1
Calculation of BIC done by leaps-package
...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 is that I can't reproduce the calculation of these BIC values. I already tried to use extractAIC(...,k=log(n)), AIC(...,k=log(n)) and manual calculation using the RSS-vector but none matches the calculation done by the summary-function. I already checked for constants that could be the reason for the differences but i found out, that the values vary apart of adding a constant term. The s...
2011 Aug 04
0
extractAIC
Use extractAIC in frailty cox model (estimated with coxph function, gaussian random effect) i obtaided > extractAIC(fit.cox.f) [1] 11.84563 8649.11736 but I don't know why I can't use the classic formulation of the AIC where the degree of freedom are the number of the parameter (in my case 3). --...
2009 Sep 22
0
AIC vs. extractAIC
Dear list, I am confused about two functions in R: AIC(fm) and extractAIC(fm). What is the difference between two and when do I have to use one over the other? I have found the similar question previously and still not clear for me to understand. I also looked at '?AIC' and '?extractAIC' in R, which is also unclear. I pasted faked data set, fitting su...
2011 May 10
0
Help documentation in extractAIC
Hello. The sentence in extractAIC's help <http://www.stat.psu.edu/~dhunter/R/html/stats/html/extractAIC.html> which discusses AIC's estimate of -2logL from RSS reads: "AIC only handles unknown scale and uses the formula n log (RSS/n) - n + n log 2pi - sum(log w) where w are the weights. Further AIC counts the sca...
1998 Feb 04
0
[J.Lindsey: Re: glm(.) / summary.glm(.); [over]dispersion and returning AIC..]
..., ie that using the estimated dispersion parameter. The AIC for a fixed value of the dispersion parameter will always be poorer (except for the penalty of 2 perhaps). > BTW, V&R's MASS library contains the following functions > > apropos("[Aa][Ii][Cc]") > [1] "extractAIC" "extractAIC.aov" "extractAIC.coxph" > [4] "extractAIC.glm" "extractAIC.lm" "extractAIC.negbin" > [7] "extractAIC.survreg" "stepAIC" > > where "stepAIC" is the ma...
2017 Nov 24
0
extractAIC.coxph warning
Hi, It is not critical but in case of coxph.null model (~1) extractAIC function generates Warning message: In is.na(fit$coefficients) : is.na() applied to non-(list or vector) of type 'NULL' As I understand it happens because of absent coefficients attribute. Function stats:::extractAIC.coxph Line edf <- sum(!is.na(fit$coefficients))...
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 methods??? There are functions to get all the instances of a metho...
1998 Feb 03
2
glm(.) / summary.glm(.); [over]dispersion and returning AIC..
....glm(..., se = TRUE) ?]. As a consequence, glm(.) wouldn't (and shouldn't ??) have a `dispersion = ' argument, and print.glm(.) maybe also shouldn't print the AIC BTW, V&R's MASS library contains the following functions > apropos("[Aa][Ii][Cc]") [1] "extractAIC" "extractAIC.aov" "extractAIC.coxph" [4] "extractAIC.glm" "extractAIC.lm" "extractAIC.negbin" [7] "extractAIC.survreg" "stepAIC" where "stepAIC" is the main function, calling...
2012 Sep 29
1
Problems with stepAIC
...)~ Treatment+Pflanzenfrischmasse+aBodenfeuchte+bBodenfeuchte+Gfrischmasse+Ltrockenmasseanteil+KCN+I+Eindringtiefe, random=~1|Block/Treatment/Cluster/Patch, data=Test1,na.action = na.omit) Everytime I try stepAIC with different settings: >Modell2<- stepAIC(PModell1, method=lme) >Fehler in extractAIC.lme(fit, scale, k = k, ...) : AIC f?r REML-N?herung undefiniert englisch: Error in extractAIC.lme(fit, scale, k = k, ...) : AIC for REML-Approximation undefined Same when I do extractAIC: >extractAIC(PModell1) >Fehler in extractAIC.lme(PModell1) : AIC undefined for REML fit Can anybody...
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 deleted]]
2011 Feb 23
1
request for patch in "drop1" (add.R)
...tty certain will not break anything, as the original code basically mimicked the default methods anyway), it becomes possible to make drop1() work with mer objects (Doug Bates's new mixed model code) merely by defining: terms.mer <- function(x, ...) { attr(x at frame,"terms") } extractAIC.default <- function(fit, scale=0, k=2, ...) { L <- logLik(fit) edf <- attr(L,"df") c(edf,-2*L+2*edf) } Adding this definition of extractAIC.default also makes drop1() work with lme fits ... Comments? Should I submit to the bug database as "enhancement request&quo...
2007 Aug 15
1
AIC and logLik for logistic regression in R and S-PLUS
...39;R' ----------------- > AIC(mydata.glm) [1] 29.89986 > logLik(mydata.glm) 'log Lik.' -11.94993 (df=3) ----------------- 'S-PLUS' ----------------- > AIC(mydata.glm) [1] 71.03222 > logLik(mydata.glm) [1] -31.51611 ----------------- However, if I use the 'extractAIC' command in 'S-PLUS' the returned value is the same as the one in 'R'. 'R' ------------------------ > AIC(mydata.glm) [1] 29.89986 > extractAIC(mydata.glm) [1] 3.00000 29.89986 ------------------------- 'S-PLUS' ------------------------ > extract...