[R] Chi square value of anova(binomialglmnull, binomglmmod, test="Chisq")

David Winsemius dwinsemius at comcast.net
Tue Jun 5 00:02:19 CEST 2012


On Jun 4, 2012, at 11:31 AM, lincoln wrote:

> So sorry,
>
> My response variable is "site" (not "gender"!).
> The selection process was:
>

If there is a natural probability interpretation to "site"==1 being a  
sort of event, (say perhaps a non-lymphatic site for the primary site  
of a lymphoma)  then you can say that the log-odds for 'site' being 1  
compared to the log-odds for being 0 are different among the cohorts.  
(Or equivalently that the odds ratios are "significantly" different.)

Worries: The fact that 'age' codes are 1/0 and' birth' is 5,6,or 7  
makes me wonder what sort of measurements these are. I worry when  
variables usually considered as continuous get so severely  
discretized. The fact that this is data measured over time also raised  
further concerns about independence. Were controls observed in 1999  
still subject to risk in 2000 and subsequent years? Were there  
substantial differences in the time to events? I also worry when words  
normally used as a location are interpreted as events and there is no  
context offered.

-- 
David.
>> str(data)
> 'data.frame':	1003 obs. of  5 variables:
> $ site  : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
> $ sex   : Factor w/ 2 levels "0","1": NA NA NA NA 1 NA NA NA NA NA ...
> $ age   : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
> $ cohort: Factor w/ 10 levels "1999","2000",..: 10 10 10 10 10 10 10  
> 10 10
> 10 ...
> $ birth : Factor w/ 3 levels "5","6","7": 3 3 2 2 2 2 2 2 2 2 ...
>> datasex<-subset(data, sex !="NA")
>
> *Here below the structure of the analysis and only the anova.glm of  
> the
> last, selected model, mod4:
> *
>> mod1 <- glm(site ~ sex + birth + cohort + sex:birth, data=datasex,  
>> family =
> binomial)
>> summary(mod1)
>> anova(mod1,update(mod1,~.-sex:birth),test="Chisq")
>
>> mod2 <- glm(site ~ sex + birth + cohort, data=datasex, family =  
>> binomial)
>> summary(mod2)
>> anova(mod2,update(mod2,~.-sex),test="Chisq")
>
>> mod3 <- glm(site ~ birth + cohort, data=data, family = binomial)
>> summary(mod3)
>> anova(mod3,update(mod3,~.-birth),test="Chisq")
>
>> mod4 <- glm(site ~ cohort, data=data, family = binomial)
>> summary(mod4)
>> anova(mod4,update(mod4,~.-cohort),test="Chisq")
> Analysis of Deviance Table
>
> Model 1: site ~ cohort
> Model 2: site ~ 1
>  Resid. Df Resid. Dev Df Deviance P(>|Chi|)
> 1       993     1283.7
> 2      1002     1368.2 -9  -84.554 2.002e-14 ***
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> *My question:*
> In this case, the Chi2 value would be the difference in deviance  
> between
> models and d.f. the difference in d.f. (84.554 and 9)?
> In other words may I correctly assess: /"cohorts were unevenly  
> distributed
> between sites ( Chi2=84.5, df=9, p < 0.001)"/?
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Chi-square-value-of-anova-binomialglmnull-binomglmmod-test-Chisq-tp4632293p4632312.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list