Displaying 20 results from an estimated 11000 matches similar to: "glm"
2000 Jan 08
2
MASS glm.nb: Offset fails
I came to R from GLIM and its glm. My data sets (ecological community data)
are severely over-dispersed, and so I was delighted to find out that the MASS
library has glm.nb which is an advancement from the GLIM macros I had used
(N.E.Breslow, Applied Statistics 33, 38--44; 1984). However, I need to use
offset, but that failed.
I am not (yet --- hopefully) fluent enough in R to be able to
2002 Mar 01
1
glm with binomial errors in R and GLIM
Hi all,
In my continuous transition of GLIM to R I try to make a glm with binomial
errors.
The data file have 3 vectors:
h -> the factor that is ajusted (have 3 levels)
d -> number of animais alive (the response)
n -> total number of animals
To test proportion of alive, make d/n.
In GLIM:
$yvar d$
$error binomial n$
$fit +h$
scale deviance = 25.730 (change = -9.138) at cycle 4
2000 Apr 19
1
scale factors/overdispersion in GLM: possible bug?
I've been poking around with GLMs (on which I am *not* an expert) on
behalf of a student, particularly binomial (standard logit link) nested
models with overdispersion.
I have one possible bug to report (but I'm not confident enough to be
*sure* it's a bug); one comment on the general inconsistency that seems to
afflict the various functions for dealing with overdispersion in GLMs
1998 Mar 20
1
R-beta: glm
I am new to R so may well have missed the point somewhere. I would like to
use an exponential error in my generalized linear model. It seems natural
to restrict the Gamma family to do this ( and as one might in GLIM) by
specifying the scale. This does not seem possible in R . Have I missed
something?
Sorry to raise such a trivial point but I am keen to specify the scale
G.Janacek
2002 Jan 15
2
returned values of glim() in S PLus and glm() in R
Dear Experts,
In glim() of S Plus, one of the returned values is "var", the estimated
variance matrix of coefficients. However, in glm() of R (there is no
glim() in R), "var" is not one of the returned values. Anyone know what
could I get the varience matrix of coefficients in glm() in R?
As a novice in R and S+, I'd appreciate your help
Sincerely,
Charlie Liu
2003 Dec 02
2
: GLIM PROBLEMS
Hi all
I have another GLIM question.
I have been using R as well as Genstat (version 6) in order to fit
GLIM models to the data (displayed below).
The same models are fitted but the answers supplied by the two
packages are not the same.
Why? Can anyone help?
A discription of the data and the type of model/s fitted can be found
below.
Regards
Allan
The
2003 Mar 17
1
glm -gamma errors
Dear list,
I am looking for a way to fix the scale parameter when fitting a
generalized linear model with gamma errors and log link.
Is there something like "SCALE" such as in GLIM?
As always thanks a lot.
Peter
2002 Jan 18
3
How do I know if the deviance of a glm fit was fixed?
I'm writing functions that need to behave differently for
GLMs like binomial and Poisson with fixed deviance, and those like
normal or gamma or quasi where the deviance is estimated from the
data. Given a glm object, is there a simple way to tell this
directly, or do I have to look at the name of the family?
Duncan Murdoch
2010 Nov 29
2
accuracy of GLM dispersion parameters
I'm confused as to the trustworthiness of the dispersion parameters
reported by glm. Any help or advice would be greatly appreciated.
Context: I'm interested in using a fitted GLM to make some predictions.
Along with the predicted values, I'd also like to have estimates of
variance for each of those predictions. For a Gamma-family model, I believe
this can be done as Var[y] =
2007 May 25
1
Estimation of Dispersion parameter in GLM for Gamma Dist.
Hi All,
could someone shed some light on what the difference between the
estimated dispersion parameter that is supplied with the GLM function
and the one that the 'gamma.dispersion( )' function in the MASS
library gives? And is there consensus for which estimated value to
use?
It seems that the dispersion parameter that comes with the summary
command for a GLM with a Gamma dist. is
2011 Jul 14
1
glm() scale parameters and predicted Values
In glm() you can use the summary() function to recover the shape parameter (the reciprocal of the dispersion parameter). How do you recover the scale parameter? Also, in the given example, how I estimate and save the geometric mean of the predicted values? For a simple model you can use fitted() or predicted() functions. I will appreciate any help.
?
?
?
#Call required R packages
require(plyr)?
2011 Oct 13
2
GLM and Neg. Binomial models
Hi userRs!
I am trying to fit some GLM-poisson and neg.binomial. The neg. Binomial
model is to account for over-dispersion.
When I fit the poisson model i get:
(Dispersion parameter for poisson family taken to be 1)
However, if I estimate the dispersion coefficient by means of:
sum(residuals(fit,type="pearson")^2)/fit$df.res
I obtained 2.4. This is theory means over-dispersion since
2012 Sep 25
1
appropriate test in glm when the family is Gamma
Dear R users,
Which test is most appropriate in glm when the family is Gamma?
In the help page of anova.glm, I found the following
?For models with known dispersion (e.g., binomial and Poisson fits) the chi-squared test is most appropriate, and for those with dispersion estimated by moments (e.g., gaussian, quasibinomial and quasipoisson fits) the F test is most appropriate.?
My questions :
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
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
2002 Aug 22
2
Calculating dispersion in glm
Hi all,
How is dispersion calculated within the glm function in R ?
Cheers
_________________________________________________________________
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body",
2004 Nov 15
3
glim in R?
After some futile searches, I decided to ask the list to see
if any of the sages out there would have an answer:
I have a function I wrote a few years ago in S, which calls
glim numerous times. I'd like to port it to R, but glm
works differently from glim, which takes as part of its
input an X design matrix. I probably could write a function
to convert glim to glm, but hope this
2002 Jan 17
1
weibull in R
Hi all
I try to make a weibull survival analysis on R.
I know make this on GLIM, and now I try to make the GLIM exercice GLEX8 on R
to learning and compare the test.
The variables are:
time censor group bodymass
In GLIM I make:
$calc %s=1 $ to fit weibull rather than exponential
$input %pcl weibull $
$macro model group*bodymass $endmac$
$use weibull t w %s $
Then, GLIM estimate an alpha for the
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 =
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