Re: [Rd] nobs.glm

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue, 24 Apr 2012 14:56:55 +0100

On 24/04/2012 14:36, Wincent wrote:
> Hi all,
>
> The nobs method of (MASS:::polr class) takes into account of weight,
> but nobs method of glm does not. I wonder what is the rationale of
> such design behind nobs.glm. Thanks in advance. Best Regards.
>
>> library(MASS)
>> house.plr<- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
>> house.logit<- glm(I(Sat=='High') ~ Infl + Type + Cont, binomial,weights = Freq, data = housing)
>> nobs(house.plr)
> [1] 1681
>> nobs(house.logit)
> [1] 72
>

Well, the interpretation of 'weights' for a GLM depends on the family. They may be equivalent to duplicated observations for a binomial GLM, but they are not for a Gaussian one. The nobs method for class "glm" (there is no visible nobs.glm) follows the "lm" method.

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue 24 Apr 2012 - 14:08:02 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 26 Apr 2012 - 09:40:50 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive