[R] Post-hoc tests in MASS using glm.nb

Peter Ehlers ehlers at ucalgary.ca
Tue May 17 15:08:30 CEST 2011


On 2011-05-17 02:22, Timothy Bates wrote:
> Dear Bryony: the suggestion was not to change the name of the data object, but to explicitly tell glm.nb what dataset it should look in to find the variables you mention in the formula.
>
> so the salient difference is:
>
> m1<- glm.nb(Cells ~ Cryogel*Day, data = side)
>
> instead of
>
> attach(side)
> m1<- glm.nb(Cells ~ Cryogel*Day)
>
> This works for other functions also, but not uniformly as yet (how I wish it did and I could say
>     hist(x, data=side)
> Instead of
>     hist(side$x)
>
> this inconsistency encourages the need for attach()

Only if the user hasn't yet been introduced to the with() function,
which is linked to on the ?attach page.

Note also this sentence from the ?attach page:
  ".... attach can lead to confusion."

I can't remember the last time I needed attach().

Peter Ehlers

[... non-germane material snipped ...]



More information about the R-help mailing list