Displaying 20 results from an estimated 20000 matches similar to: "Log likelihood from glm"
2007 Mar 19
1
likelihoods in SAS GENMOD vs R glm
List: I'm helping a colleague with some Poisson regression modeling. He
uses SAS proc GENMOD and I'm using glm() in R. Note on the SAS and R
output below that our estimates, standard errors, and deviances are
identical but what we get for likelihoods differs considerably. I'm
assuming that these must differ just by some constant but it would be nice
to have some confirmation
2005 Jan 25
3
GLM function with poisson distribution
Hello all,
I found a weird result of the GLM function that seems
to be a bug.
The code:
a=c(rep(1,8),rep(2,8))
b=c(rep(0,8),rep(3,8))
cbind(a,b)
model=glm(b~a, family=poisson)
summary(model)
generates a dataset with two groups. One group
consists entirely of zeros, the other of 3's (as
happened in a dataset I’m analyzing right now). Since
they are count data, one should apply a
2007 May 02
1
Log-likelihood function
I've computed a loglinear model on a categorical dataset. I would like to
test whether an interaction can be dropped by comparing the log-likelihoods
from two models(the model with the interaction vs. the model without).
Since R does not immediately print the log-likelihood when I use the "glm"
function, I used SAS initially. After searching for an extracting function,
I found one
2004 Apr 17
1
accessing log likelihood of poison model
Could someone tell me how to access the log likelihood
of a poisson model? I've done the following....
<BEGIN R STUFF>
freq.mod <- glm(formula = nfix ~ gls.gls + pol.gls + pol.rel + rac.gls +
rac.pol + rac.rac + rac.rel + white + gls.gls.w + pol.gls.w + pol.rel.w
+ rac.gls.w + rac.pol.w + rac.rac.w + rac.rac.w + rac.rel.w, family =
poisson, data = Complex2.freq, offset = lnoffset)
2001 Feb 09
1
default data= arg to glm() (PR#844)
Full_Name: Peter Perkins
Version: 1.2.1
OS: LinuxPPC
Submission from: (NULL) (24.4.89.36)
the lines
if (missing(data))
data <- environment(formula)
in glm() seem to contradict the documentaton:
data: an optional data frame containing the variables in the model.
By default the variables are taken from the environment from
which `glm' is called.
actually,
2008 Jan 25
1
Poisson Maximum Likelihood Estimation
Hi
I am trying to carry out some maximum likelihood estimation and I'm not
making much headway, and I'm hoping that someone will be able to point me in
the right direction.
I am modelling mortality statistics. One way to do this is to model the
mortality rate (or, more accurately, log of the mortality rate, log_m) as
(say) a constant plus a proportion of age, plus time, so:
r_1 <-
2000 May 09
4
Dispersion in summary.glm() with binomial & poisson link
Following p.206 of "Statistical Models in S", I wish to change
the code for summary.glm() so that it estimates the dispersion
for binomial & poisson models when the parameter dispersion is
set to zero. The following changes [insertion of ||dispersion==0
at one point; and !is.null(dispersion) at another] will do the trick:
"summary.glm" <-
function(object, dispersion =
2006 Jan 18
4
negative predicted values in poisson glm
Dear R helpers,
running the following code of a glm model of the family poisson, gives
predicted values < 0. Why?
library(MASS)
library(stats)
library(mvtnorm)
library(pscl)
data(bioChemists)
poisson_glm <- glm(art ~ fem + mar + kid5 + phd + ment, data = bioChemists,
family = poisson)
predicted.values = predict(poisson_glm)
range(predicted.values)
Thank you in advance for any hints.
2008 Mar 18
1
glm poisson, method='ML' (PR#10985)
Full_Name: saraux
Version: 2.6.1
OS: Windows vista
Submission from: (NULL) (193.157.180.37)
I would like to compute a glm with a distribution of poisson, using a maximum of
likelihood method. But it seems not to work with a distribution of poisson. The
same code with another distrubution (binomial for example) works.
Here is the command I typed:
2006 Sep 13
3
unexpected result in glm (family=poisson) for data with an only zero response in one factor
Dear members,
here is my trouble: My data consists of counts of trapped insects in different attractive traps. I usually use GLMs with a poisson error distribution to find out the differences between my traitments (and to look at other factor effects). But for some dataset where one traitment contains only zeros, GLM with poisson family fail to find any difference between this particular traitment
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
2004 Feb 02
1
glm.poisson.disp versus glm.nb
Dear list,
This is a question about overdispersion and the ML estimates of the
parameters returned by the glm.poisson.disp (L. Scrucca) and glm.nb
(Venables and Ripley) functions. Both appear to assume a negative binomial
distribution for the response variable.
Paul and Banerjee (1998) developed C(alpha) tests for "interaction and main
effects, in an unbalanced two-way layout of counts
2013 May 29
1
quick question about glm() example
I don't have a copy of Dobson (1990) from which the glm.D93 example is
taken in example("glm"), but I'm strongly suspecting that these are
made-up data rather than real data; the means of the responses within
each treatment are _identical_ (equal to 16 2/3), so two of the
parameters are estimated as being zero (within machine tolerance). (At
this moment I don't understand
2003 Nov 04
1
glm offset and interaction bugs (PR#4941)
Full_Name: Charles J. Geyer
Version: 1.8.0
OS: i686-pc-linux-gnu (Suse 8.2)
Submission from: (NULL) (134.84.86.22)
Two bugs (perhaps related, perhaps independent) revealed by the same
Poisson regression with offset
mydata <- read.table(url("http://www.stat.umn.edu/geyer/5931/mle/seeds.txt"))
out.fubar <- glm(seedlings ~ burn01 + vegtype * burn02 +
offset(log(totalseeds)),
2004 Mar 16
2
glm questions
Greetings, everybody. Can I ask some glm questions?
1. How do you find out -2*lnL(saturated model)?
In the output from glm, I find:
Null deviance: which I think is -2[lnL(null) - lnL(saturated)]
Residual deviance: -2[lnL(fitted) - lnL(saturated)]
The Null model is the one that includes the constant only (plus offset
if specified). Right?
I can use the Null and Residual deviance to
2003 Apr 08
1
truncated poisson in glm / glmmPQL
Hi
I'm a postgrad in ecology, and have recently started to use R. I'm planning
to model various sets of animal abundance (i.e. count) data in relation to
habitat data using glm's and/or glmmPQL's. However, some of my potential
response variables have many zeros. From what I gather the "family = ..."
option in the command line does not allow for the direct
2005 Jan 20
5
glm and percentage data with many zero values
Dear all,
I am interested in correctly testing effects of continuous environmental
variables and ordered factors on bacterial abundance. Bacterial
abundance is derived from counts and expressed as percentage. My problem
is that the abundance data contain many zero values:
Bacteria <-
2012 Oct 22
1
glm.nb - theta, dispersion, and errors
I am running 9 negative binomial regressions with count data.
The nine models use 9 different dependent variables - items of a clinical
screening instrument - and use the same set of 5 predictors. Goal is to
find out whether these predictors have differential effects on the items.
Due to various reasons, one being that I want to avoid overfitting models,
I need to employ identical types of
2009 Mar 17
2
bigglm() results different from glm()
Dear all,
I am using the bigglm package to fit a few GLM's to a large dataset (3
million rows, 6 columns). While trying to fit a Poisson GLM I noticed
that the coefficient estimates were very different from what I obtained
when estimating the model on a smaller dataset using glm(), I wrote a
very basic toy example to compare the results of bigglm() against a
glm() call. Consider the
2008 Mar 27
1
dreaded p-val for d^2 of a glm / gam
OK,
I really dread to ask that .... much more that I know some discussion about p-values and if they are relevant for regressions were already on the list. I know to get p-val of regression coefficients - this is not a problem. But unfortunately one editor of a journal where i would like to publish some results insists in giving p-values for the squared deviance i get out from different glm and