Re: [R] AIc and BIC in caret...

2023-04-19 Thread akshay kulkarni
--Original Message- From: R-help On Behalf Of Jeff Newmiller Sent: Wednesday, April 19, 2023 10:41 AM To: r-help@r-project.org; akshay kulkarni ; R help Mailing list Subject: Re: [R] AIc and BIC in caret... [External Email] This is a statistical question, not actually a question about R, and th

Re: [R] AIc and BIC in caret...

2023-04-19 Thread Ebert,Timothy Aaron
om: R-help On Behalf Of Jeff Newmiller Sent: Wednesday, April 19, 2023 10:41 AM To: r-help@r-project.org; akshay kulkarni ; R help Mailing list Subject: Re: [R] AIc and BIC in caret... [External Email] This is a statistical question, not actually a question about R, and thus not on topic. Usin

Re: [R] AIc and BIC in caret...

2023-04-19 Thread akshay kulkarni
Mailing list Subject: Re: [R] AIc and BIC in caret... This is a statistical question, not actually a question about R, and thus not on topic. Using too many variables leads to models that tend to have large errors on new data (not from your fitting sample). [1] [1] https://en.m.wikipedia.org/wiki

Re: [R] AIc and BIC in caret...

2023-04-19 Thread Jeff Newmiller
This is a statistical question, not actually a question about R, and thus not on topic. Using too many variables leads to models that tend to have large errors on new data (not from your fitting sample). [1] [1] https://en.m.wikipedia.org/wiki/Overfitting On April 19, 2023 6:50:44 AM PDT, aksha

Re: [R] AIC

2022-11-25 Thread Robert Knight
https://cran.r-project.org/web/packages/quantreg/quantreg.pdf Seems to be by the guy who has been writing about A1c and quantile regression since at least 1978. His work is cited in several papers on the subject. I would copy-paste his name here, but this from an iPhone. On Fri, Nov 25, 2022 at

Re: [R] AIC for robust GAM ?

2021-01-07 Thread varin sacha via R-help
Hi Bert, Many thanks for your response. Best, Le mercredi 6 janvier 2021 à 21:47:14 UTC+1, Bert Gunter a écrit : Per the posting guide linked below: "If the question relates to a contributed package , e.g., one downloaded from CRAN, try contacting the package maintainer first. You can

Re: [R] AIC for robust GAM ?

2021-01-06 Thread Bert Gunter
Per the posting guide linked below: "If the question relates to a *contributed package* , e.g., one downloaded from CRAN, try contacting the package maintainer first. You can also use find("functionname") and packageDescription("packagename") to find this information. *Only* send such questions to

Re: [R] AIC values with lmer and anova function

2012-12-29 Thread Bert Gunter
4th Question: Why have you not posted this on the R-sig-mixed-models list, where it clearly belongs, rather than here? -- Bert On Sat, Dec 29, 2012 at 12:47 PM, Diego Pujoni wrote: > Dear colleagues, > > I have a data from a repeated measures design that I'm analysing through a > mixed model. N

Re: [R] AIC for GAM models

2012-08-23 Thread ritapatricio
Thank you for the clarification, indeed the default Gaussian distribution gives me identical results and AIC values for simple model comparison. Best, Rita -- View this message in context: http://r.789695.n4.nabble.com/AIC-for-GAM-models-tp4640972p4641101.html Sent from the R help mailing lis

Re: [R] AIC for GAM models

2012-08-22 Thread Rui Barradas
Hello, For gam, try model1$aic. The returned value is an object of class "gam" as described in ?gamObject. For gamm, try model$gam$aic. The returned value is a list of two objects, a "gam" and the return value of "lme" or "|gammPQL". See ?gam and ?gamm, the Value section. Hope this helps, Rui

Re: [R] AIC for seasonal decomposition by stl

2012-04-13 Thread Prof Brian Ripley
On 13/04/2012 07:32, Joon-Taek Yoo wrote: Hello I have a question on the seasonal decomposition based on Loess smoothing (called "stl") for the R statistics package. I am wondering how to calculate value of AIC (Akaike Information Criterion) for the seasonal decomposition by stl in R. AIC is

Re: [R] AIC models are not all fitted to the same number of observation

2012-03-21 Thread Patrick Giraudoux
Le 21/03/2012 10:56, Patrick Giraudoux a écrit : Hi, Using lme from the package nlme 3.1-103, I meet a strange warning. I am trying to compare to models with: library(nlme) lmez6=lme(lepus~vulpes,random=~1|troncon/an,data=ika_z6_test) lmez60=lme(lepus~1,random=~1|troncon/an,data=ika_z6_test)

Re: [R] AIC

2011-09-18 Thread B77S
This isn't a question about R; more appropriate for stackexchange. Here is one string that might interest you: http://stats.stackexchange.com/questions/4997/can-aic-compare-across-different-types-of-model Tania Sav wrote: > > Hello, > > I'm using AIC() to choose a better model. I have 3 o

Re: [R] AIC() vs. mle.aic() vs. step()?

2011-06-23 Thread Alexandra Thorn
The packages is wle. I'll put together some code that shows the behavior I'm talking about, and send it to the list. Alexandra On Thu, 2011-06-23 at 13:51 +0200, Rubén Roa wrote: > I don't find the mle.aic function. Thus it does not ship with R and it's in > some contributed package. > What pa

Re: [R] AIC on GLMM pscl package

2011-03-04 Thread Ben Bolker
Caribu gmail.com> writes: > > Hello, > > I'm using GLMM on the pscl package and i'm not getting the AIC on the > summary. > [snip] glmmPQL is in the MASS package, not the pscl package. Because it uses a quasi-likelihood approach, it does not provide an AIC value (which technically does n

Re: [R] AIC in bestglm, glm, and lm - why do they differ?

2010-10-15 Thread Bill.Venables
AIC is only defined up to an additive constant (as is log-likelihood). It should not surprise you that the values for AIC differ between packages. The real question is whether the change in AIC when going form one model to anoth is the same. If not, one is wrong (at least). -Original Mess

Re: [R] AIC for tweedie glm

2010-09-30 Thread eleadbeater
Many thanks! Using a fresh session didn't work, but I upgraded to R.2.11.1 and it runs fine now. bbolker wrote: > > eleadbeater sussex.ac.uk> writes: > >> Dear R-users, >> >> I'm trying to model some data using a tweedie GLM approach. My response >> variable is the number of pupae that are t

Re: [R] AIC for tweedie glm

2010-09-30 Thread Ben Bolker
eleadbeater sussex.ac.uk> writes: > Dear R-users, > > I'm trying to model some data using a tweedie GLM approach. My response > variable is the number of pupae that are the offspring of a subordinate wasp > on a wasp's nest. However, they're not count data- for each nest, I only > know the mean

Re: [R] AIC using nls function

2010-08-28 Thread Ben Bolker
Bert Gunter gene.com> writes: > > John: > > 1. As always, and as requested (see posting guide), a small > reproducible example might help. Bert is right that things aren't well defined. However, AIC is still *widely* used for nonlinear models. For the sloppy folks among us, here are some u

Re: [R] AIC using nls function

2010-08-27 Thread Bert Gunter
John: 1. As always, and as requested (see posting guide), a small reproducible example might help. 2. What is CLi in your model? 3. In general, AIC may not be particularly meaningful as a measure of fit quality penalized for model complexity in NON-linear models unless the different models are

Re: [R] AIC in MuMIn

2010-08-19 Thread Gavin Simpson
On Fri, 2010-08-20 at 06:31 +0800, elaine kuo wrote: > > > Oh, actually, I suppose you could automate this, so it will > return all > models with single variable: > > dd <- dredge(lm1) > parms <- !is.na(dd[, -c(1, (ncol(dd) - c(0:7

Re: [R] AIC in MuMIn

2010-08-19 Thread elaine kuo
> >> > > Please kindly advise if it is possible to show the singular model with > > only one certain variable using the command subset. (or maybe others) > > I tried the command "subset=X3" but it returned multiple models > > including X3. > > > > > > The above demand might look unnecessary when vi

Re: [R] AIC in MuMIn

2010-08-19 Thread Gavin Simpson
On Thu, 2010-08-19 at 04:42 +0800, elaine kuo wrote: > Yes, I tried the example in the ?dredge and agreed that something else > caused the mistake. > > > Aside from the cause which takes time to clarify (16 explanatory > variables in the model), > I would like to ask another question. > > > Pl

Re: [R] AIC in MuMIn

2010-08-18 Thread elaine kuo
Yes, I tried the example in the ?dredge and agreed that something else caused the mistake. Aside from the cause which takes time to clarify (16 explanatory variables in the model), I would like to ask another question. Please kindly advise if it is possible to show the singular model with only on

Re: [R] AIC in MuMIn

2010-08-18 Thread Gavin Simpson
On Wed, 2010-08-18 at 21:11 +0800, elaine kuo wrote: > A cause other than data based on standardized regression > was identified. > It is that the manual command added with target <- at the left hand > side. > C1 did not work but C2 did. > C1 target<-dredge(mig.stds, subset = temp_max) > > >

Re: [R] AIC in MuMIn

2010-08-18 Thread elaine kuo
A cause other than data based on standardized regression was identified. It is that the manual command added with target <- at the left hand side. C1 did not work but C2 did. C1 target<-dredge(mig.stds, subset = temp_max) C2 dredge(mig.stds, subset = temp_max) Elaine On Wed, Aug 18, 2010

Re: [R] AIC in MuMIn

2010-08-18 Thread Gavin Simpson
On Wed, 2010-08-18 at 17:37 +0800, elaine kuo wrote: > => I posted it for help, after following the manual with the > command dredge but receiving an error message two days ago. > > command target<-dredge(mig.stds, subset = temp_max) >error in eval(expr, en

Re: [R] AIC in MuMIn

2010-08-18 Thread elaine kuo
> > > > > Please suggest how to define subset in my case > > How would I know? I still haven't seen your data. You seem to be > mistaken on what is and is not included in your model and you fitted it. > What hope do we have...? However, given the model 'mig.stds' from above > in this email: > > > m

Re: [R] AIC in MuMIn

2010-08-18 Thread elaine kuo
> Hmmm. Thinking some more, I might not have answered your (unstated) > question. What do your mean by GLM? > > => I meant generalized linear model as well. Thanks for the references. The first one was mentioned first in my life time after keeping asking the same question. > I mean the Genera

Re: [R] AIC in MuMIn

2010-08-18 Thread Gavin Simpson
On Wed, 2010-08-18 at 08:51 +0100, Gavin Simpson wrote: > On Wed, 2010-08-18 at 05:42 +0800, elaine kuo wrote: > > Thank you. > > Most of the answers solved the puzzles. > > => Please explain why fitted lm is better for GLM. > > Seriously? A GLM specified as glm(, family = gaussian) is the l

Re: [R] AIC in MuMIn

2010-08-18 Thread Gavin Simpson
On Wed, 2010-08-18 at 05:42 +0800, elaine kuo wrote: > Thank you. > Most of the answers solved the puzzles. > > > Q2 > > > > I tried to display sub-model with only temp_ran using the > code below but > > failed. > > Please kindly suggest the potential fa

Re: [R] AIC in MuMIn

2010-08-17 Thread elaine kuo
Thank you. Most of the answers solved the puzzles. Q2 > > I tried to display sub-model with only temp_ran using the code below but > > failed. > > Please kindly suggest the potential failure cause. > > > > code > > > > library(MuMIn) > > datam <-read.csv("c:/migration/Mig_ratio_20100817.csv",hea

Re: [R] AIC in MuMIn

2010-08-17 Thread Gavin Simpson
On Tue, 2010-08-17 at 16:05 +0800, elaine kuo wrote: > Hello, Why did you decide to post the exact same message from two different email addresses?? > I am using package MuMIn to calculate AIC for a full model with 10 > explanatory variables. > Thanks in advance in sharing your experience. > > Q

Re: [R] AIC for model selection in Package â??Mu MInâ??

2010-08-16 Thread Ben Bolker
That's really too big a question to do justice to in a mailing list reply. If possible, consult a local expert. To keep it very short, I would say: (1) when you are interested in maximizing expected predictive accuracy (rather than testing hypotheses); (2) when the parameters in the mode

Re: [R] AIC for model selection in Package â� �MuMInâ��

2010-08-16 Thread elaine kuo
Thanks for Ben. Model selection by AIC is feasible by the code below. One more question, when is it appropriate to carry out model averaging and parameter averaging? code library(MuMIn) data(Cement) lm1 <- lm(y ~ ., data = Cement) dd <- dredge(lm1, beta = TRUE, eval = TRUE, rank =

Re: [R] AIC for model selection in Package â� �MuMInâ��

2010-08-16 Thread Ben Bolker
elaine kuo gmail.com> writes: [re: MuMIn package] > However, the criteria in this package for model selection are AICc > (second-order AIC) and QAIC (quasi-AIC). > Please kindly share if it is possible to carry AIC rather than the metrics > above using this package. > Thank you. I think you'r

Re: [R] AIC for comparing GLM(M) with (GAM(M)

2010-01-27 Thread Simon Wood
This is tricky. gamm4 is basing AIC on the (approximate) marginal likelihood with the smooth terms treated as random effects and integrated out. The appropriate degrees of freedom are then the number of smoothing parameters + the number of fixed effects. This is completely conventional AIC. ga

Re: [R] AIC and goodness of prediction - was: Re: goodness of "prediction" using a model (lm, glm, gam, brt,

2009-09-11 Thread Kingsford Jones
Hi Corrado, Not being familiar with your research goals or data I can't make recommendations, but I can suggest a couple of places to look for information: Frank Harrell's Regression Modeling Strategies and his Design library available on CRAN, and Hastie et al's The Elements of Statistical Learn

Re: [R] AIC in time series

2009-07-05 Thread murilodoi
Try, > library("fGarch") > fitmodel = garchFit(formula=~ar(1)+~garch(1,1), data=garat) > fitmo...@fit$ics #is a vector with Information Criterion Statistics > fitmo...@fit$ics[1] #is the AIC Murilo Eiji Doi Ben Bolker wrote: > > Vasileios Ismyrlis gmail.com> writes: > >> >> library(

Re: [R] AIC in time series

2009-07-05 Thread murilodoi
Try, > library("fGarch") > fitmodel = garchFit(formula=~ar(1)+~garch(1,1), data=garat) > fitmo...@fit$ics #is a vector with Information Criterion Statistics > fitmo...@fit$ics[1] #is the AIC Ben Bolker wrote: > > Vasileios Ismyrlis gmail.com> writes: > >> >> library("fGarch") >> fit = garch

Re: [R] AIC function and Step function

2008-12-01 Thread Dana77
Thank you, Kingsford. Then I am wondering if there are other ways to write R codes to calculate the "weights" ? Thanks! Dana Kingsford Jones wrote: > > On Sun, Nov 30, 2008 at 5:05 PM, Dana77 <[EMAIL PROTECTED]> wrote: >> >> Thanks for kind help from Steven and Christos last time. Now I

Re: [R] AIC function and Step function

2008-11-30 Thread Kingsford Jones
On Sun, Nov 30, 2008 at 5:05 PM, Dana77 <[EMAIL PROTECTED]> wrote: > > Thanks for kind help from Steven and Christos last time. Now I got new > problem regarding the codes for calculating the "weights" (w) in "AIC () > function". > The original code is as below: > > getAnywhere("logLik.lm") > fu

Re: [R] AIC function and Step function

2008-11-30 Thread Dana77
Thanks for kind help from Steven and Christos last time. Now I got new problem regarding the codes for calculating the "weights" (w) in "AIC () function". The original code is as below: > getAnywhere("logLik.lm") function (object, REML = FALSE, ...) { res <- object$residuals p <- ob

Re: [R] AIC function and Step function

2008-11-27 Thread Steven McKinney
Hi Dana, Many thanks to Christos Hatzis who sent me an offline response, pointing out the new functions that make this much easier than my last suggestions: methods() and getAnywhere() > methods("extractAIC") [1] extractAIC.aov* extractAIC.coxph* extractAIC.glm* extractAIC.lm* ext

Re: [R] AIC function and Step function

2008-11-27 Thread Steven McKinney
Hi Dana, Of course the only true way to know what the AIC calculations are is to read the source code. From within R, what with namespaces, that is becoming increasingly difficult. The AIC() function is not too hard to find from R. > AIC function (object, ..., k = 2) UseMethod("AIC") So now

Re: [R] AIC value in lmer

2008-11-08 Thread Douglas Bates
On Fri, Nov 7, 2008 at 11:03 AM, <[EMAIL PROTECTED]> wrote: > Dear R Users, > May be this message should be directy send to Douglas Bates ... > I just want to know if I can use the AIC value given in the output of an lmer > model to classify my logistic models. > I heard that the AIC value given

Re: [R] AIC in time series

2008-11-04 Thread Ben Bolker
Vasileios Ismyrlis gmail.com> writes: > > library("fGarch") > fit = garchFit(formula=~ar(1)+~garch(1,1), data=garat) > > Now I want to count AIC for this model. How can I do it? I cannot do > it with the AIC function of stats package, because R tells me: > "Error in UseMethod("logLik") : no ap

Re: [R] AIC for quasipoisson link

2008-10-31 Thread Bonenfant Christophe
Ben, I think the reference you're searching for is the one below @ARTICLE{Lebreton1992, author = {Lebreton, J.-D. and Burnham, K. P. and Clobert, J. and Anderson, D. R.}, title = {Modeling survival and testing biological hypotheses using marked animals: a unified approach with

Re: [R] AIC for quasipoisson link

2008-10-31 Thread Ben Bolker
Marc Schwartz comcast.net> writes: > > on 10/31/2008 01:07 PM Antonio.Gasparrini lshtm.ac.uk wrote: > > I'm trying to extract the AIC statistic from a GLM model > >with quasipoisson link. > > The formula I'm referring to is > > > > AIC = -2(maximum loglik) + 2df * phi > > > > with phi t

Re: [R] AIC for quasipoisson link

2008-10-31 Thread Marc Schwartz
on 10/31/2008 01:07 PM [EMAIL PROTECTED] wrote: > Dear fellows, > > I'm trying to extract the AIC statistic from a GLM model with quasipoisson > link. > The formula I'm referring to is > > AIC = -2(maximum loglik) + 2df * phi > > with phi the overdispersion parameter, as reported in: > >

Re: [R] AIC score

2008-10-14 Thread John C Frain
Choosing the model with minimum AIC is just one consideration that might be used. If you look at books such as McQuarrie and Tsai (1998), Regression and Time Series Model Selection, World Scientific, you will find about 450 pages dealing mainly with the use of this and similar criteria to select a

Re: [R] AIC score

2008-10-14 Thread Michael Just
John, Thank you for those references. Cheers, Michael On Tue, Oct 14, 2008 at 8:27 AM, John C Frain <[EMAIL PROTECTED]> wrote: > Choosing the model with minimum AIC is just one consideration that > might be used. If you look at books such as McQuarrie and Tsai > (1998), Regression and Time Seri

Re: [R] AIC score

2008-10-14 Thread Dieter Menne
Michael Just gmail.com> writes: > I ran AIC for some competing models I created. I get df and an AIC score > from the AIC procedure. Can I use the models with the lowest AIC scores from > this procedure to choose my 'best' models? Depends. You told us nothing. Have you tried to search the list

Re: [R] AIC extract and comparison

2008-04-30 Thread Uwe Ligges
Lisa wrote: 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

Re: [R] AIC and anova, lme

2008-02-26 Thread Dieter Menne
Patrick Giraudoux univ-fcomte.fr> writes: > > 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) > >

Re: [R] AIC and anova, lme

2008-02-26 Thread Patrick Giraudoux
ian white a écrit : Patrick, The likelihoods of two models fitted using REML cannot be compared unless the fixed effects are the same in the two models. Many thanks for this reminder. Shame on me: it recalls me that this subject may have been already largely discussed on this list. Now, I

Re: [R] AIC and anova, lme

2008-02-26 Thread ian white
Patrick, The likelihoods of two models fitted using REML cannot be compared unless the fixed effects are the same in the two models. On Tue, 2008-02-26 at 14:38 +0100, Patrick Giraudoux wrote: > Dear listers, > > Here we have a strange result we can hardly cope with. We want to > compare a n

Re: [R] AIC and BIC in mixed effects model

2007-12-28 Thread Ben Bolker
Chuanjun Zhang umkc.edu> writes: > > Dear R Users: > > I am trying to compare several structures of the within-patient covariance > such as unstructured, Autoregressive, and spatial by using the MIXED effects > model. Can AIC, BIC be negative ? If yes, then in what situations they may > be nega

Re: [R] AIC v. extractAIC

2007-12-06 Thread Ben Bolker
Ryan Briscoe Runquist wrote: > > > 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 mod

Re: [R] AIC and model selection; not a R question

2007-11-24 Thread Ben Bolker
Lynnette Dagenais wrote: > > Hi, > > I was wondering if someone could help me answer a question that is bound > to come up in my Master's defense. I'm using AIC to select models and my > question is how do I know that the models I developed a priori contain the > 'best' models in the system.

Re: [R] AIC and model selection; not a R question

2007-11-24 Thread Charles C. Berry
On Sat, 24 Nov 2007, Lynnette Dagenais wrote: > Hi, > > I was wondering if someone could help me answer a question that is bound > to come up in my Master's defense. Lynnette, I expect you will get some opinions here, but you might get a better answer from your committee. Have you already ask

Re: [R] AIC questions

2007-09-27 Thread Joe Yarmus
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 err

Re: [R] AIC questions

2007-09-26 Thread Wensui Liu
joe, some procs in SAs calculates log likelihood differently than what it is supposed to be. try using proc nlmixed and specifying the LL explicitly. in your case, I has stronger faith in R result instead of SAS result. On 9/26/07, Joe Yarmus <[EMAIL PROTECTED]> wrote: > In accordance with Venable