[R] Need help with GLM on R

Jim Lemon drjimlemon at gmail.com
Sat Sep 19 22:33:15 CEST 2015

Hi Georgia,
In that case you are conducting an exploratory analysis, sometimes called a
fishing expedition, on the effect of location. The usual procedure is to
plot the populations by the areas and put the Mark I human eyeball to work.
If you see some pattern that you can plausibly defend, such as southern
areas have higher populations than northern ones, you can code your areas
accordingly and try it out. It is understandably difficult to get an
analysis like this accepted unless some causal factor just pops out in your
plot. Remember that you are now testing the effect of, say, latitude, not
"area numbers" which are just arbitrary names. Good luck.


On Sat, Sep 19, 2015 at 11:41 PM, Georgia Clack <georgialclack92 at outlook.com
> wrote:

> Hello
> The area number does refer to the area location, but I want to see if area
> number has an effect. The problem is I'm not sure how to look at this
> because whenever I run the glm it makes area 1 the intercept and I don't
> want it to
> I just wanted to know what code to use for it to produce the table I want
> Thanks
> Georgia
> On 18 Sep 2015, at 22:52, Jim Lemon <drjimlemon at gmail.com> wrote:
> Hi icelandic1992,
> If I am correct, the default model is comparing the first area with the
> rest. I assume that "area" does not refer to the physical area of the
> locations, but is a nominal order variable. If I am wrong, and there are
> actual "areas", that is probably what you want to have in the model, as one
> would expect that larger areas would have larger populations.
> Jim
> On Sat, Sep 19, 2015 at 2:03 AM, icelandic1992 <
> georgialclack92 at outlook.com> wrote:
>> I am using some data for a population count
>> This what my data is set out as
>> Area   Count    Year      DOY      Rain     Wind
>> all continuous effects except wind and rain and area are categorical
>> variables with 1 for rain and wind and 0 for no rain or wind and areas
>> 1-27
>> I am trying to do a GLM analysis of certain treatment effects on
>> Loge(total
>> count+1) to find out which factors significantly affect the count. I used
>> the formula glm.nb(Count~factor(Area)+Year+Rain+Wind+DOY)
>> However it does not work, and when I looked at it with the formula I was
>> given by someone else which was
>> glm.nb(Count~factor(Area)+Year+DOY+Year*DOY) it came up with intercept as
>> the first area and then areas 1-27 listed and then year and DOY.
>> I am unsure of what this means as i think it is comparing all the areas to
>> the first area. I really want it to come up with a table that looks like
>> this
>> Effect              Coefficient        SE      F-value
>> Area number
>> Year
>> Wind
>> Rain
>> Any help will be greatly appreciated as I have tried to understand how to
>> get this table but I am struggling to understand
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/Need-help-with-GLM-on-R-tp4712459.html
>> Sent from the R help mailing list archive at Nabble.com
>> <http://nabble.com>.
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list