On Fri, Mar 1, 2013 at 12:05 AM, Rolf Turner <r.turner@auckland.ac.nz>wrote:

>  On 03/01/2013 02:26 PM, Andrew Robinson wrote:
>
>   Hi Rolf,
>
>  on nesting of fixed effects: nesting is just incomplete crossing :).
>
> How about when the response variable is student performance on
> standardized tests, and two predictor variables are (i) nominated major and
> (ii) faculty?
>
>  Science - Math, Physics Chem, ...
>  Arts - Literature, History, Philosophy ...
>
>
> The predictive power from specifying both faculty and major (subject)
> is the same as that obtained by just specifying major.
>

I agree.  But the explanation provided by the model is quite different.


> You can *do* the
> former by writing the model as
>
>     performance ~ faculty/major
>
> but there will be a load of NAs in the coefficient estimates.
>

Sure - but the model will still provide the estimates that you need, if you
want to compare faculties and then majors within faculty.


> The non-NA
> values will just correspond to the individual majors (Physics, Chem,
> History,
> Philosophy, ....).  The model matrix for faculty/major is of less than
> full rank.
>
> You get all the information that you are going to get out an analysis of
> variance
> of the data by just writing the model in the more perspicuous form:
>
>     performance ~ major
>
> Put another way ---- History and Physics are different subjects.
> Specifying
> that they are in different faculties tells you nothing more about them.
>

I don't agree.  I'd like to know if the differences between then can be
explained by them being in different faculties, or whether dark forces are
at work.

Cheers

Andrew

Note that if the nested effect is random then only one more parameter (the
> variance of that effect) is being estimated, rather than (p1-1)*p2 more
> parameters,
> (where p1 is the number of levels of the first factor and p2 is the number
> of
> levels of the second --- nested --- factor).  So defective rank of the
> model matrix
> does not become a problem.
>
>     cheers,
>
>         Rolf
>
>
>  Cheers
>
> Andrew
>
>
> On Fri, Mar 1, 2013 at 12:02 PM, Rolf Turner <r.turner@auckland.ac.nz>wrote:
>
>>
>> Perhaps I am just obtuse (there are those who would say there is
>> no "perhaps" about it) but it seems to me that nesting of fixed effects
>> makes no sense.
>>
>> In the example given below you have in effect a ***single*** factor
>> with six levels: a.1, a.2, b.3, b.4, c.5, c.6.  This really means that
>> you just have the second "nested" factor with levels 1, 2, 3, 4, 5, 6.
>> So just supply the second factor to the formula in the call to glmer()
>> and forget about the first factor entirely.  It is redundant when the
>> second factor is supplied.
>>
>> You *can* use the formula y ~ f1/f2 or equivalently y ~ f1 + f1:f2
>> but you'll find that you wind up getting 12 coefficient estimates, six
>> of which are "NA".  The values of the six non-NA coefficients will
>> be indentical with values of the six coefficient estimate that you get
>> from y ~ f2.
>>
>>     cheers,
>>
>>         Rolf Turner
>>
>> On 03/01/2013 03:27 AM, PALACIO BLASCO, SARA wrote:
>>
>>> Hi Hugo,
>>>
>>> Thanks for your e-mails. The structure of my data is not the one in your
>>> examples but:
>>>
>>> Factor 1: a,b,c
>>> factor 2: 1,2,3,4,5,6
>>>
>>> combination:
>>> a.1, a.2, b.3, b.4, c.5, c.6
>>>
>>> note factor 2 is nested within factor 1, so that not all levels of
>>> factor 2 are in every level of factor 1.
>>> Hence I do not have a full factorial or crossed design but a
>>> hierarchical one.
>>>
>>> My question: How can I include such a design in glmer?
>>>
>>> Cheers,
>>>
>>> Sara
>>>
>>> Hugo.Mildenberger@web.de escribió:
>>>
>>>  On Thu, 28 Feb 2013 14:27:36 +0100
>>>> "PALACIO BLASCO, SARA" <s.palacio@ipe.csic.es> wrote:
>>>>
>>>>  Maybe this is a trivial question but: how can I specify a nested
>>>>> structured of fixed factors in glmer?
>>>>>
>>>>> I still haven't found a way to solve the issues explained in my
>>>>> previous e-mail.
>>>>>
>>>>
>>>>
>>>> Sara,
>>>>
>>>> may be this fits your needs?
>>>>
>>>>  a<-factor(c('a','b','c','d'))
>>>>> b<-factor(c('1','2'))
>>>>> interaction(a,b)
>>>>>
>>>> [1] a.1 b.2 c.1 d.2
>>>> Levels: a.1 b.1 c.1 d.1 a.2 b.2 c.2 d.2
>>>>
>>>>
>>>> Best
>>>>
>>>


-- 
Andrew Robinson
Director (A/g), ACERA
Senior Lecturer in Applied Statistics                      Tel:
+61-3-8344-6410
Department of Mathematics and Statistics            Fax: +61-3-8344 4599
University of Melbourne, VIC 3010 Australia
Email: a.robinson@ms.unimelb.edu.au    Website: http://www.ms.unimelb.edu.au

FAwR: http://www.ms.unimelb.edu.au/~andrewpr/FAwR/
SPuR: http://www.ms.unimelb.edu.au/spuRs/

	[[alternative HTML version deleted]]

