Displaying 20 results from an estimated 400 matches similar to: "AIC and logLik for logistic regression in R and S-PLUS"
2007 Aug 17
0
(Ben Bolker) AIC and logLik for logistic regression in R and S-PLUS
Leandra Desousa <sousa <at> ims.uaf.edu> writes:
>> > 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:
>> >
>> > >summary(mydata.glm)
>> > Call:
>> > glm(formula = COMU ~
2009 Feb 02
2
logLik for poisson models
Dear all,
I have a very basic question:
how does the logLik function work for poisson models?
Example:
I simulate 20 observations from a Poisson distribution with mean 800.
y <- rpois(20,800)
model <- glm(y ~ 1, family=poisson())
logLik(model)
I would like to know what's the exact formula the function logLik uses.
I looked at ?extractAIC but I cannot sort it out.
Can you please
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
2017 Aug 23
0
MASS:::dropterm.glm() and MASS:::addterm.glm() should use ... for extractAIC()
Hi,
I have sent this message to this list the July, 7th. It was about a
problem in MASS package.
Until now there is no change in the devel version.
As the problem occurs in a package and not in the R-core, I don't know
if the message should have been sent here. Anyway, I have added a copy
to Pr Ripley.
I hope it could have been fixed.
Sincerely
Marc
Le 09/07/2017 ? 16:05, Marc Girondot via
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 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,
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
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
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 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).
--
View this message in context:
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 summary, and AICs.
Thank
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
2006 May 08
0
Inconsistency in AIC values for glm with family poisson (PR#8841)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--27464147-1557463723-1147085467=:8118
Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT
On Mon, 8 May 2006, x.sole at iconcologia.net wrote:
> Full_Name: Xavier Sol?
> Version: 2.3.0
> OS: Windows
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,
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 scale estimation as a parameter in the edf and extractAIC does
2009 May 05
0
stepAICc function (based on MASS:::stepAIC.default)
Dear all,
I have tried to modify the code of MASS:::stepAIC.default(), dropterm() and addterm() to use AICc instead of AIC for model selection.
The code is appended below. Somehow the calculations are still not correct and I would be grateful if anyone could have a look at what might be wrong
with this code...
Here is a working example:
##
require(nlme)
model1=lme(distance ~ age + Sex, data =
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))
I think extra null-checking
2012 Nov 02
0
stepAIC and AIC question
I have a question about stepAIC and extractAIC and why they can
produce different answers.
Here's a stepAIC result (slightly edited - I removed the warning
about noninteger #successes):
stepAIC(glm(formula = (Morbid_70_79/Present_70_79) ~ 1 + Cohort +
Cohort2, family = binomial, data = ghs_70_79, subset =
ghs_70_full),direction = c("backward"))
Start: AIC=3151.41
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
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 *