From ronggui.huang at gmail.com  Thu Apr 26 02:16:50 2012
From: ronggui.huang at gmail.com (Wincent)
Date: Thu, 26 Apr 2012 08:16:50 +0800
Subject: [Rd] nobs.glm
In-Reply-To: <4F96B127.7060205@stats.ox.ac.uk>
References: <CANQBBMsUcKHZeLpN5a1mCnzHhTMNNeSBwiPTUdydc=2jp8netw@mail.gmail.com>
	<4F96B127.7060205@stats.ox.ac.uk>
Message-ID: <CANQBBMssVNhDhCCoceJHOnaC3daF3wnTp89edsuyyqQxVYOjDQ@mail.gmail.com>

Thanks, Professor Ripley. It helps a lot. As a follow-up question, is
there any recommended references I can look into to figure out the
interpretation of "weights" for various families?

Thanks very much in advance

Best regards

Ronggui

On 24 April 2012 21:56, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
> 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



-- 
Wincent Ronggui HUANG
Sociology Department of Fudan University
PhD of City University of Hong Kong
http://homepage.fudan.edu.cn/rghuang/cv/



[Rd] nobs.glm
Wincent