Displaying 20 results from an estimated 24 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:
extrac...

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...

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)...

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).
--...

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...

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]]

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]]

2017 Oct 16

1

survival analysis - predict function

...Here is the definition of loglogistic_na and following that
the syntax used for the predict function. But upon execution I don't get
any output. Not sure what I'm doing wrong:
loglogistic_na <- survreg(Surv(time_na,event_na) ~ t_na, dist="loglogistic")
summary(loglogistic_na)
extractAIC(weibull_na)
extractAIC(loglogistic_na)
# first way
l.pred <- predict(loglogistic_na, train1_model)
l.pred.q <- predict(loglogistic_na, train1_model,
type="quantile"p=pct,se=TRUE)
result <- cbind(data.frame(train1_model, l.pred), l.pred.q)
names(result) <- c("Actual"...

2009 Apr 29

12

Una pregunta de estadística (marginalmente relacionada con R)

Hola, ¿qué tal?
Tengo una pregunta de esta

2010 Sep 22

2

speeding up regressions using ddply

...)
log.glm <- (glm(status ~ value1+ value2 , family=binomial(link=logit),
na.action=na.omit)) #What I can't figure out is how to specify 2
different variables (I've put value1 and value2 as placeholders) from
the xm to include in the model
glm.summary<-summary(log.glm)
aic <- extractAIC(log.glm)
coef <- coef(glm.summary)
list(Est1=coef[1,2], Est2=coef[3,2], AIC=aic[2]) #or whatever other
output here
}
And then I'd like to use ddply to speed up the computations.
require(pplyr)
output<-dddply(xm, .(variable), as.data.frame.function(h))
output
I can easily do this us...

2011 Oct 25

2

Logistic Regression - Variable Selection Methods With Prediction

...iables. My goal is to compare different variable selection methods
like Forward, Backward, All possible subsests. I am using
misclassification rate to pick the winner method.
This is what i have as of now,
Reg <- glm (Graduation ~., DFtrain,family=binomial(link="logit"))
step <- extractAIC(Reg, direction="forward")
pred <- predict(Reg, DFtest,type="response")
mis <- mean({pred > 0.5} != {DFtest[,"Graduation"] == "Y"})
This program actually works but I needed to check to make sure am
doing this right. Also, I am getting the same mis...

2004 Apr 02

2

How canI convert date-time to Julian date?

Hello!!
I need some help! I tried everything, but nothing worked!
I have a vector c with dates in it, in the format "2004-04-01" and i need to
convert it in the form
"04/01/2004" or "01/04/2004" !
How can i do that??
Thanks
Bye Martina
--

2000 Oct 18

1

AIC in glm()

...idual deviance: 52.3 on 14 degrees of freedom
AIC: 70.357
Since there are 2 parameters, I would naively compute: AIC = Dev + 2*2 =
56.3, or possibly scaling the deviance by the dispersion parameter: AIC =
Dev/3.735 + 2*2 = 18.00. I do not see how is computed the value 70.357. I
have read ?extractAIC and looked in the base package, but did not find a clue.
Any help appreciated.
Emmanuel Paradis
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",...

2005 May 09

1

question about k in step

>?step
....
'step' uses 'add1' and 'drop1' repeatedly; it will work for any
method for which they work, and that is determined by having a
valid method for 'extractAIC'. When the additive constant can be
chosen so that AIC is equal to Mallows' Cp, this is done and the
tables are labelled appropriately.
so my question is :what constant should i choose so i can get Mallows' Cp instead of AIC?

2010 Feb 10

1

using step() with package geepack

I'm using the package geepack to fit GEE models.
Does anyone know of methods for add1 and drop1 for a 'geeglm' model object, or perhaps a method for extractAIC based on the QIC of Pan 2001? I see there has been some mention of this on R-help a few years ago (RSiteSearch("QIC")).
The package does provide an anova method for its model objects, and update() seems to work:
library(geepack)
data(dietox) # the example from ?geeglm
# GEE model, u...

2017 Oct 16

0

survival analysis - predict function

...ion of loglogistic_na and following that the syntax used for the predict function. But upon execution I don't get any output. Not sure what I'm doing wrong:
>
> loglogistic_na <- survreg(Surv(time_na,event_na) ~ t_na, dist="loglogistic")
> summary(loglogistic_na)
> extractAIC(weibull_na)
> extractAIC(loglogistic_na)
>
> # first way
> l.pred <- predict(loglogistic_na, train1_model)
> l.pred.q <- predict(loglogistic_na, train1_model, type="quantile"p=pct,se=TRUE)
> result <- cbind(data.frame(train1_model, l.pred), l.pred.q)
> names...

2010 Aug 27

1

step

Hi,
how can I change the significance level in test F to select
variable in step command?
I used
step(model0, ~x1+x2+x3+x4, direction=c("forward"), test='F',
alpha=.05)
but it does't work.
--------------------------------------
Silvano Cesar da Costa
Departamento de Estat?stica
Universidade Estadual de Londrina
Fone: 3371-4346

2002 May 28

1

constrained regression

I want to do a linear regression where the coefficients
obey two linear constraints, and also are all non-negative.
What is the best way to do this? Computational speed is a
consideration as I must do it many times.
When this question was asked previously on the list, quadprog
was suggested - is this the best solution?
(I may have missed something obvious in the documentation,
but I have

2013 Nov 04

1

How to plot results of clmm()?

Dear list,
I'd like to create a visual plot of a clmm() I've fitted using the
'ordinal' package in R. It's possible to do this with a glm() by using
the 'effects' package. For example:
library(effects)
data(BEPS)
mod <- lm(political.knowledge ~ age + gender + vote, data=BEPS)
eff <- effect("age", mod, default.levels=100)
plot(eff,

2002 Apr 01

0

something confusing about stepAIC

Folks, I'm using stepAIC(MASS) to do some automated, exploratory, model
selection for binomial and Poisson glm models in R 1.3. Because I wanted to
experiment with the small-sample correction AICc, I dug around in the code
for the functions
glm.fit
stepAIC
dropterm.glm
addterm.glm
extractAIC.glm
and came across something I just don't understand.
stepAIC() passes dropterm.glm() a model object. dropterm.glm() then fits a
number of submodels, computing for each some measure DeltaFit of the
relative change in goodness of fit. It then returns to stepAIC() with some
indication of which...