Re: [R] anova function to test the difference between two coefficients in nlme package

From: shirley zhang <shirley0818_at_gmail.com>
Date: Tue, 22 Jan 2008 11:00:50 -0500

Dear Dr. Bates, and R-help,

I just found the reason I got the error message is because I copied the code directly from the book. When I tried the code in "~\library\nlme\scripts" under the R installation directory like the following, I got the same answere as in the book.

anova(fm2BW.lme, L = c("Time:Diet2" = 1, "Time:Diet3" = -1))

Now my question is instead of test the difference between two coefficients, can I use anova to test the significance of the sum of two coefficients, like

anova(fm2BW.lme, L = c("Time:Diet2" = 1, "Time:Diet3" = 1))

Thanks,
Shirley

On Jan 22, 2008 10:38 AM, shirley zhang <shirley0818_at_gmail.com> wrote:
> Dear Dr. Bates, and R-help,
>
> I've tried the anova function to test the difference between two
> coefficients, as shown on page 225 of your book "Mixed Effects Models
> in S and S-Plus (Statistics and Computing)".
>
> When I type: anova( fm2BW.lme, L = c(TimeDiet2 = 1, TimeDiet3 = -1) )
>
> I got the following error message:
>
> Error: unexpected '=' in "anova( fm2BW.lme, L = c(Time:Diet2 ="
>
> Could you tell me whether I miss anything?
>
> > sessionInfo()
> R version 2.6.0 (2007-10-03)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> States.1252;LC_MONETARY=English_United
> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] nlme_3.1-85
>
> loaded via a namespace (and not attached):
> [1] grid_2.6.0 lattice_0.16-5
>
>
> Thanks,
> Shirley
>



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. Received on Tue 22 Jan 2008 - 16:03:54 GMT

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 Tue 22 Jan 2008 - 16:30:10 GMT.

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

list of date sections of archive