[R] Nested variables

Mark Difford mark_difford at yahoo.co.uk
Mon Jun 1 13:27:31 CEST 2009


Daniel,

>> Yes I am trying to model such data, and i need R to know that Site is
>> nested within Habitat. 
>> Do I use some kind of command before running the model (like factor() and
>> so on) or do i 
>> write it in the model formula. If so, how?

You still are not telling the list enough, since nesting specifications are
sometimes package/program specific. You could help yourself by reading some
of R's basic documentation about how to specify a nested model. Then "it"
will tell you what to do.

?formula

Or read §11.1 of "An Introduction to R" (one of R's manuals).

Regards, Mark.


DanielWC wrote:
> 
> Hi. 
> Yes I am trying to model such data, and i need R to know that Site is
> nested within Habitat. Do I use some kind of command before running the
> model (like factor() and so on) or do i write it in the model formula. If
> so, how?
> 
> Thanks
> 
> 
> 
> Douglas Bates-2 wrote:
>> 
>> On Fri, May 29, 2009 at 7:50 AM, DanielWC <daniel.carstensen at gmail.com>
>> wrote:
>> 
>>> Hello
>>> I am working with a biological data including variables called Habitat
>>> and
>>> Site, example:
>> 
>>> Habitat     Site
>> 
>>> Forest      Low
>>> Forest      Low
>>> Forest      High
>>> Forest      High
>> 
>>> I want to tell R that the Site variable is nested within the Forest
>>> variable
>>> (that it is not a new variable).
>>> Does anyone know how to do this?
>> 
>> If you could explain what you mean by "tell R", it would help.  Are
>> you trying to model such data and you want to know how to express the
>> relationship between such factors in a model formula?
>> 
>> ______________________________________________
>> 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/Nested-variables-tp23779402p23813539.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list