similar to: question regarding lm and logLik in R

Displaying 20 results from an estimated 10000 matches similar to: "question regarding lm and logLik in R"

2011 Mar 28
1
Degrees of freedom for lm in logLik and AIC
I have a question about the computation of the degrees of freedom in a linear model: x <- runif(20); y <- runif(20) f <- lm(y ~ x) logLik(f) 'log Lik.' -1.968056 (df=3) The 3 is coming from f$rank + 1. Shouldn't it be f$rank? This affects AIC(f). Thanks Frank ----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context:
2007 Aug 15
1
AIC and logLik for logistic regression in R and S-PLUS
Dear R users, 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: --------------------------------------------------------------------------- > mydata.glm<-glm(COMU~MeanPycUpT+MeanPycUpS, family=binomial, data=mydata)
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
2003 Jun 25
3
logLik.lm()
Hello, I'm trying to use AIC to choose between 2 models with positive, continuous response variables and different error distributions (specifically a Gamma GLM with log link and a normal linear model for log(y)). I understand that in some cases it may not be possible (or necessary) to discriminate between these two distributions. However, for the normal linear model I noticed a discrepancy
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 Jun 16
3
mgcv, testing gamm vs lme, which degrees of freedom?
Dear all, I am using the "mgcv" package by Simon Wood to estimate an additive mixed model in which I assume normal distribution for the residuals. I would like to test this model vs a standard parametric mixed model, such as the ones which are possible to estimate with "lme". Since the smoothing splines can be written as random effects, is it correct to use an (approximate)
2008 Mar 05
1
degrees of freedom extraction
Hello, II used the logLik() function to get the log-likelihood estimate of an object. The function also prints the degrees of freedom. How can I extract the degrees of freedom and assign it to a variable. Below is the output: > logLik(fit2pl) 'log Lik.' -4842.912 (df=36) Thanks, Davood Tofighi [[alternative HTML version deleted]]
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
2009 Sep 01
1
understanding the output from gls
I'd like to compare two models which were fitted using gls, however I'm having trouble interpreting the results of gls. If any of you could offer me some advice, I'd greatly appreciate it. Short explanation of models: These two models have the same fixed-effects structure (two independent, linear effects), and differ only in that the second model includes a corExp structure for
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
2007 Jul 11
2
p-value from survreg(), library(survival)
dear r experts: It seems my message got spam filtered, another try: i would appreciate advice on how to get the p-value from the object 'sr' created with the function survreg() as given below. vlad sr<-survreg(s~groups, dist="gaussian") Coefficients: (Intercept) groups -0.02138485 0.03868351 Scale= 0.01789372 Loglik(model)= 31.1 Loglik(intercept only)= 25.4
2011 Jan 24
2
how to get loglik parameter from splm package?
splm package is a r implemention of spatial panel data models. and the loglik paremeter is most important infomation for splm methods. but i found the loglik always been null ,it's craze to get right estimation in splm with null loglik. Any one knows the splm package and can get the right loglik ? please help me. thanks -- View this message in context:
2006 Apr 21
1
AIC and numbers of parameters
Hi. I'm fairly new to R and have a quick question regarding AIC, logLik and numbers of parameters. I see that there has been some correspondence on this in the past but none of the threads seem to have been satisfactorily resolved. I have been trying to use R to obtain AIC for fitted models and then to extrapolate to AICc. For example, using simple x-y regression data, I fitted a
2005 Apr 19
1
behaviour of logLik and lme
Dear all, when performing a meta analysis I have two results obtained with logLik and lme, which I do not quite understand. The results are based on these data: study or var 1 0.10436 0.299111 2 -0.03046 0.121392 3 0.76547 0.319547 4 -0.19845 0.025400 5 -0.10536 0.025041 6 -0.11653 0.040469 7 0.09531 0.026399 8 0.26236 0.017918 9 -0.26136 0.020901 10 0.45742 0.035877 11
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 ~
2007 Dec 05
4
coxme frailty model standard errors?
Hello, I am running R 2.6.1 on windows xp I am trying to fit a cox proportional hazard model with a shared Gaussian frailty term using coxme My model is specified as: nofit1<-coxme(Surv(Age,cen1new)~ Sex+bo2+bo3,random=~1|isl,data=mydat) With x1-x3 being dummy variables, and isl being the community level variable with 4 levels. Does anyone know if there is a way to get the standard error
2012 Jan 20
1
nobs() and logLik()
Dear all, I am studying a bit the various support functions that exist for extracting information from fitted model objects. From the help files it is not completely clear to me whether the number returned by nobs() should be the same as the "nobs" attribute of the object returned by logLik(). If so, then there is a slight inconsistency in the methods for 'nls' objects with
2009 Jul 15
1
GLM Gamma Family logLik formula?
Hello all, I was wondering if someone can enlighten me as to the difference between the logLik in R vis-a-vis Stata for a GLM model with the gamma family. Stata calculates the loglikelihood of the model as (in R notation) some equivalent function of -1/scale * sum(Y/mu+log(mu)+(scale-1)*log(Y)+log(scale)+scale*lgamma(1/scale)) where scale (or dispersion) = 1, Y = the response variable, and mu
2013 Jan 31
1
LogLik of nls
Hello there, Can anyone point me to the code for logLik of an nls object? I found the code for logLik of an lm but could not find exactly what function is used for calculating the logLik of nls function? I am using the nls to fit the following model to data - Model 1: y ~ Ae^(-mx) + Be^(-nx) +c and want to understand what is the likelihood function used by nls. Presumably it is using -
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