Displaying 20 results from an estimated 6000 matches similar to: "logLik calculations"
2009 Jul 14
1
How does logLik(lm(...)) find the maximum log likelihoods
Hi. Thanks for your help with my previous question (comparing two lm() models with a maximum likelihood ratio test)
 
I had a look at lrtest from the package lmtest as it has been suggested to me, but I am not 100% sure if that is the right thing to do ...
 
lrtest uses the same log likelihoods as you can extract by hand from lm() with logLik - are this the maximum log likelihoods? How does R
2007 Jan 03
1
problem with logLik and offsets
Hi,
I'm trying to compare models, one of which has all parameters fixed 
using offsets.  The log-likelihoods seem reasonble in all cases except 
the model in which there are no free parameters (model3 in the toy 
example below).  Any help would be appreciated.
Cheers,
Jarrod
x<-rnorm(100)
y<-rnorm(100, 1+x)
model1<-lm(y~x)
logLik(model1)
sum(dnorm(y, predict(model1),
2004 Jul 01
2
Individual log likelihoods of nlsList objects.
Hello all.
I was wondering if the logLike.nls() and logLike.nlme() functions are still
being used. Neither function seems to be available in the most recent
release of R (1.9.1). The following is contained in the help file for
logLik(): "classes which already have methods for this function include:
'glm', 'lm', 'nls' and 'gls', 'lme' and others in
2011 Apr 11
1
pseudo-R by hand
hello dear list! since we want to do a model analysis and some people 
would like to see pseudo-R^2 values for different types of glm of a 
logistic regression, i've decided to write a function that computes 
either nagelkerkes normed pseudo-R or cox & snells pseudo-R. however, i 
am not clear as in the decisive step, i need to calculate the log of 
(maximum likelihood estimates of model
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 *
2005 Aug 03
1
glmmPQL error in logLik.reStruct
Dear R users,
I'm attempting to fit a GLM with random effects using the tweedie family
for the error structure.  I'm getting the error:
iteration 1 
Error in logLik.reStruct(object, conLin) : 
        NA/NaN/Inf in foreign function call (arg 3)
I'm running V2.1.0
I notice from searching the lists that the same error was reported in
May 2004 by Spencer Graves, but no-one was able to
2010 Jul 20
1
Servreg $loglik
Dear R-experts:
I am using survreg() to estimate the parameters of a Weibull density having
right-censored observations.  Some observations are weighted.  To do that I
regress the weighed observations against a column of ones.
When I enter the data as 37 weighted observations, the parameter estimates
are exactly the same as when I enter the data as the corresponding 70
unweighted observations. 
2003 Mar 12
2
quasipoisson, glm.nb and AIC values
Dear R users,
I am having problems trying to fit quasipoisson and negative binomials glm. 
My data set
contains abundance (counts) of a species under different management regimens.
First, I tried to fit a poisson glm:
 > summary(model.p<-glm(abund~mgmtcat,poisson))
       Call:
       glm(formula = abund ~ mgmtcat, family = poisson)
       .
       .
       .
       (Dispersion parameter
2003 Jan 15
2
Bug or Feature? LogLik.nls and non-central F distribution.
I have a dataset that I am running non-linear regression on via the
following code:
Hill <- function(E0,Em,C50,g,C){
  #
  # Hill is the hill interaction function.
  #
  # E0 Represents the minimum interaction Effect
  #
  # Em Represents the Maximum Interaction Effect
  #
  # C50 represents the concentration at which 50% of the effect occurs.
  #
  # gamma represents the cooperativity of the
2010 Mar 03
1
Zero inflated negative binomial
Hi all,
 I am running the following model:
> glm89.nb <- glm.nb(AvGUD ~ Year*Trt*Micro)
 where Year has 3 levels, Trt has 2 levels and Micro has 3 levels.
However when I run it has a zero inflated negative binomial (as I have lots
of zeros) I get the below error message:
> Zinb <- zeroinfl(AvGUD ~ Year*Trt*Micro |1, data = AvGUD89, dist =
"negbin")
Error in optim(fn =
2006 Mar 31
1
loglikelihood and lmer
Dear R users,
I am estimating Poisson mixed models using glmmPQL
(MASS) and lmer (lme4). We know that glmmPQL do not
provide the correct loglikelihood for such models (it
gives the loglike of a 'pseudo' or working linear
mixed model). I would like to know how the loglike is
calculated by lmer.
A minor question is: why do glmmPQL and lmer give
different degrees-of-freedom for the same
2005 Jun 02
1
glm with variance = mu+theta*mu^2?
How might you fit a generalized linear model (glm) with variance = 
mu+theta*mu^2 (where mu = mean of the exponential family random variable 
and theta is a parameter to be estimated)?
	  This appears in Table 2.7 of Fahrmeir and Tutz (2001) Multivariate 
Statisticial Modeling Based on Generalized Linear Models, 2nd ed. 
(Springer, p. 60), where they compare "log-linear model fits to
2025 Apr 30
1
Estimating regression with constraints in model coefficients
Hi Gregg,
Below I try to address
1) The sum constraint would apply for each set ?? and ?? i.e. sum(??)
= sum(??)   = 1.60
2) Just like 1) the lower and upper bounds will be applied for
individual set i.e. individual elements of ?? are subject to lower =
c(1, -1, 0) and upper = c(2, 1, 1) and  individual elements of ?? are
subject to lower = c(1, -1, 0) and upper = c(2, 1, 1)
I hope that I am
2006 May 06
2
How to test for significance of random effects?
Dear list members,
I'm interested in showing that within-group statistical dependence is  
negligible, so I can use ordinary linear models without including random  
effects. However, I can find no mention of testing a model with vs.  
without random effects in either Venable & Ripley (2002) or Pinheiro and  
Bates (2000). Our in-house statisticians are not familiar with this,  
either,
2008 Feb 25
0
logLik calculation in gls (nlme)
I'm getting some odd results computing log-likelihoods
with gls using splines with increasing degrees of freedom --
the deviance *increases* substantially with increasing df.
(Since spline models with increasing df aren't nested, it
need not decline monotonically but I would expect it to
have a decreasing trend!)
   I may just be confused, but I *think* the issue is somewhere
within the
2008 Dec 06
1
Questions on the results from glmmPQL(MASS)
Dear Rusers,
   I have used R,S-PLUS and SAS to analyze the sample data "bacteria" in
MASS package. Their results are listed below.
I have three questions, anybody can give me possible answers?
Q1:From the results, we see that R get 'NAs'for AIC,BIC and logLik, while
S-PLUS8.0 gave the exact values for them. Why? I had thought that R should
give the same results as SPLUS here.
2001 Sep 29
2
Optimized Likelihoods
R-Users,
I'm in the process of developing some notes on optimizing likelihoods
for a class I'm teaching next term. Can anyone offer examples showing
the optimization of a complex likelihood function that they wouldn't
mind sharing using optim(). I've adapted some of the S-plus likelihood
examplesfrom the ``Guide to Statistics" and  the Zip example from ``Statistical
Models in
2006 Nov 20
4
for help about logistic regression model
I have a dataset like this:
  p  aa 
index        x       y         z      sdx     sdy      sdz   delta     as 
  ms        cur       sc
1 821p MET     1 -5.09688 32.8830 -5.857620 1.478200 1.73998 0.825778 
13.7883 126.91 92.37 -0.1320180 111.0990
2 821p THR     2 -4.07357 28.6881 -4.838430 0.597674 1.37860 1.165780 
13.7207  64.09 50.72 -0.0977129  98.5319
3 821p GLU     3 -5.86733 30.4759
2023 Aug 29
1
logLIk(lme(...))?
Hello, all:
	  I have a dataset with 2 groups.  I want to estimate 2 means and 2 
standard deviations.  I naively think I should be able to use lme to do 
that, e.g., lme(y~gp, random=y~1|gp, method='ML').  I think I should get 
the same answer as from lm(y~1, ...) within each level of group.  I can 
get the same means, but I don't know how to extract the within-gp 
standard
2006 Feb 22
2
does multinomial logistic model from multinom (nnet) has logLik?
I want to get the logLik to calculate McFadden.R2 ,ML.R2 and
Cragg.Uhler.R2, but the value from multinom does not have logLik.So my
quetion is : is logLik meaningful to multinomial logistic model from
multinom?If it does, how can I get it?
Thank you!
ps: I konw  VGAM has function to get the multinomial logistic model
with  logLik,  but I prefer use the function from "official" R