Displaying 20 results from an estimated 10000 matches similar to: "GLM: order of terms in model"
2006 Mar 31
1
add1() and glm
Hello,
I have a question about the add1() function and quasilikelihoods for GLMs.
I am fitting quasi-Poisson models using glm(, family = quasipoisson).
Technically, with the quasilikelihood approach the deviance does not have
the interpretation as a likelihood-based measure of sample information.
Functions such as stepAIC() cannot be used. The function add1() returns
the change in the scaled
2006 Oct 22
2
"glm" function question
I am creating a model attempting to predict the probability someone will
reoffend after being caught for a crime. There are seven total inputs and I
planned on using a logistic regression. I started with a null deviance of
182.91 and ended up with a residual deviance of 83.40 after accounting for
different interactions and such. However, I realized after that my code is
different from that in
2005 May 23
1
comparing glm models - lower AIC but insignificant coefficients
Hello,
I am a new R user and I am trying to estimate some generalized linear
models (glm). I am trying to compare a model with a gaussian
distribution and an identity link function, and a poisson model with
a log link function. My problem is that while the gaussian model has
significantly lower (i.e. "better") AIC (Akaike Information
Criterion) most of the coefficients are not
2012 May 07
1
Can't find the error in a Binomial GLM I am doing, please help
Hi all,
I can't find the error in the binomial GLM I have done. I want to use that
because there are more than one explanatory variables (all categorical) and
a binary response variable.
This is how my data set looks like:
> str(data)
'data.frame': 1004 obs. of 5 variables:
$ site : int 0 0 0 0 0 0 0 0 0 0 ...
$ sex : Factor w/ 2 levels "0","1": NA NA NA
2009 Jul 10
1
generalized linear model (glm) and "stepAIC"
Hi,
I'm a very new user of R and I hope not to be too "basic" (I tried to
find the answer to my questions by other ways but I was not able to).
I have 12 response variables (species growth rates) and two
environmental factors that I want to test to find out a possible
relation.
The sample size is quite small: (7<n<12, depending on each species-case).
I performed a
2000 Oct 18
1
AIC in glm()
Hi all,
I am trying to understand how is calculated the AIC returned by glm(). I
have a model object m1 which fitting results are:
> summary(m1)
[...]
(Dispersion parameter for gaussian family taken to be 3.735714)
Null deviance: 1439.8 on 15 degrees of freedom
Residual deviance: 52.3 on 14 degrees of freedom
AIC: 70.357
Since there are 2 parameters, I would naively compute: AIC
2009 May 08
1
glm fit
Hi, I try to ask here, because I hope someone will help me understand this
problem-
I have fittet a glm in R with the results
> glm1 <-
> glm(log(claims)~log(sum)*as.factor(grp),family=gaussian(link="identity"))
> summary(glm1)
Call:
glm(formula = log(claims) ~ log(sum) * as.factor(grp), family =
gaussian(link = "identity"))
Deviance Residuals:
Min 1Q
2010 Jan 26
1
AIC for comparing GLM(M) with (GAM(M)
Hello
I'm analyzing a dichotomous dependent variable (dv) with more than 100
measurements (within-subjects variable: hours24) per subject and more
than 100 subjects. The high number of measurements allows me to model
more complex temporal trends.
I would like to compare different models using GLM, GLMM, GAM and
GAMM, basically do demonstrate the added value of GAMs/GAMMs relative
to
2012 Feb 28
1
Interpreting the Results of GLM
Hi, I'm wondering if you can help me, this is a really simple query but I
keep getting confused. I have run a GLM to see how boldness varies over
time following a particular treatment. The results are as follows...
Call: glm(formula = boldtwentyfour ~ treatment + boldcontrol)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7577 -0.5469 0.0456 0.5515 1.5327
2001 Aug 21
2
Problem using GLM in a loop
Hello,
I am try to perform a modeling which is relevant in a strongly
heteroscedastic context.
So I perform a dual modeling (modeling of both mean and variance of a
response) in using the following loop:
jointmod <- function(formula, data, itercrit=10,devcrit=0.0001)
{
#
# Init step
#
init <- glm(formula=formula,family=gaussian, data=data)
response <-
2006 Jul 21
2
glm cannot find valid starting values
glm(S ~ -1 + Mdif, family=quasipoisson(link=identity), start=strt, sdat)
gives error:
> Error in glm.fit(x = X, y = Y, weights = weights, start = start, etastart
> =
> etastart, :
> cannot find valid starting values: please specify some
strt is set to be the coefficient for a similar fit
glm(S ~ -1 + I(Mdif + 1),...
i.e. (Mdif + 1) is a vector similar to Mdif.
The error
2011 Jun 13
1
glm with binomial errors - problem with overdispersion
Dear all,
I am new to R and my question may be trivial to you...
I am doing a GLM with binomial errors to compare proportions of species in
different categories of seed sizes (4 categories) between 2 sites.
In the model summary the residual deviance is much higher than the degree
of freedom (Residual deviance: 153.74 on 4 degrees of freedom) and even
after correcting for overdispersion by
2008 Nov 12
1
Understanding glm family documentation: dev.resids
Hi all
Consider the family function, as used by glm. The help page says the value of the family object is a list, one element of which is the following:
dev.resids function giving the deviance residuals as a function of (y, mu, wt).
But reading any of the family functions (eg poisson) shows that dev.resids is a function that computes the *square* of the deviance residuals (at least, by
2013 Jun 25
1
F statistic in add1.lm vs add1.glm
Should the F statistic be the same when using add1() on models created by lm and glm(family=gaussian)?
They are in the single-degree-of-freedom case but not in the multiple-degree-of-freedom case.
MASS:addterm shows the same discrepancy. It looks like the deviance (==residual sum of squares) gets
divided by the number of degrees of freedom for the term twice in add1.glm. Using anova() on the
2012 Mar 03
1
interpreting the output of a glm with an ordered categorical predictor.
Greetings.
I'm a Master's student working on an analysis of herbivore damage on plants.
I have a tried running a glm with one categorical predictor (aphid
abundance) and a binomial response (presence/absence of herbivore damage).
My predictor has four categories: high, medium, low, and none. I used the
"ordered" function to sort my categories for a glm.
ah <-
2004 Mar 16
2
glm questions --- saturated model
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of David Firth
> Sent: Tuesday, March 16, 2004 1:12 PM
> To: Paul Johnson
> Cc: r-help at r-project.org
> Subject: Re: [R] glm questions
>
>
> Dear Paul
>
> Here are some attempts at your questions. I hope it's of some help.
2006 Mar 27
1
Glm poisson
Hello,
I am using the glm model with a poisson distribution. The model runs
just fine but when I try to get the null deviance for the model of the
null degrees of freedom I get the following errors:
> null.deviance(pAmeir_1)
Error: couldn't find function "null.deviance"
> df.null(pAmeir_1)
Error: couldn't find function "df.null"
When I do:
>
2006 Mar 16
2
DIfference between weights options in lm GLm and gls.
Dear R-List users,
Can anyone explain exactly the difference between Weights options in lm glm
and gls?
I try the following codes, but the results are different.
> lm1
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
0.1183 7.3075
> lm2
Call:
lm(formula = y ~ x, weights = W)
Coefficients:
(Intercept) x
0.04193 7.30660
> lm3
Call:
2007 Dec 07
1
Adding a subset to a glm messes up factors?
Hi everyone,
I have a problem with running a glm using a subset of my data. Whenever I choose a subset, in the summary the factors arent shown (as if the variable was a continuous variable). If I dont use subsets then all the factors are shown. I have copied the output from summary for both cases.
Thanks for the help,
Muri
> model<-glm(log(cpue)~year,family=gaussian)
Call:
glm(formula =
2005 Feb 02
1
anova.glm (PR#7624)
There may be a bug in the anova.glm function.
deathstar[32] R
R : Copyright 2004, The R Foundation for Statistical Computing
Version 2.0.1 (2004-11-15), ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project