[R] type III effect from glm()

Mark Difford mark_difford at yahoo.co.uk
Thu Feb 19 13:58:15 CET 2009


Hi Simon,

>> [On my response] ...not really a sensible question until...

On reading through this...what I mean is that yours seems not to be a
"sensible approach," the question itself may be reasonable. What you want to
be doing is testing whether the interaction term (yrs:district) gets
dropped. Do it by comparing nested models (basically as you have done), or
use dropterm() or stepAIC() [both are in MASS].

Regards, Mark.


Mark Difford wrote:
> 
> Hi Simon,
> 
>>> I want to know if yrs (a continuous variable) has a significant unique
>>> effect in the model, 
>>> so I fit a simplified model with the main effect ommitted...
> 
> [A different approach...] This is not really a sensible question until you
> have established that there is no significant interaction between "yrs"
> and "district." If this interaction is significant then, ipso facto, the
> effect of "yrs" is not unique but depends on "district." So establish that
> first.
> 
> There is a good section on marginality in MASS (Venables & Ripley) and, as
> Mark has mentioned, in Prof Fox's texts. From what I can remember, some of
> these tests are reparametrized behind the scenes to enforce the
> marginality constraint.
> 
> Regards, Mark.
> 
> 
> Simon Pickett-4 wrote:
>> 
>> Hi all,
>> 
>> This could be naivety/stupidity on my part rather than a problem with
>> model output, but here goes....
>> 
>> I have fitted a fairly simple model 
>> 
>> m1<-glm(count~siteall+yrs+yrs:district,family=quasipoisson,weights=weight,data=m[x[[i]],])
>> 
>> I want to know if yrs (a continuous variable) has a significant unique
>> effect in the model, so I fit a simplified model with the main effect
>> ommitted...
>> 
>> m2<-glm(count~siteall+yrs:district,family=quasipoisson,weights=weight,data=m[x[[i]],])
>> 
>> then compare models using anova()
>> anova(m1,m1b,test="F")
>> 
>> Analysis of Deviance Table
>> 
>> Model 1: count ~ siteall + yrs + yrs:district
>> Model 2: count ~ siteall + yrs:district
>>   Resid. Df Resid. Dev   Df Deviance F Pr(>F)
>> 1      1936      75913                       
>> 2      1936      75913    0        0         
>>> 
>> 
>> The d.f.'s are exactly the same, is this right? Can I only test the
>> significance of a main effect when it is not in an interaction? 
>> 
>> Thanks in advance,
>> 
>> Simon.
>> 
>> 
>> 
>> 
>> 
>> 
>> Dr. Simon Pickett
>> Research Ecologist
>> Land Use Department
>> Terrestrial Unit
>> British Trust for Ornithology
>> The Nunnery
>> Thetford
>> Norfolk
>> IP242PU
>> 01842750050
>> 
>> 	[[alternative HTML version deleted]]
>> 
>> ______________________________________________
>> R-help at r-project.org mailing list
>> 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.
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/type-III-effect-from-glm%28%29-tp22097773p22099812.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list