[R] gam() of package "mgcv" and anova()

From: Kunio takezawa <r.otasuke_at_gmail.com>
Date: Sat, 26 Jul 2008 18:08:14 +0900


R-users
E-mail: r-help_at_r-project.org

   Hi! R-users.

   A simple object as below was created to see how gam() of package "mgcv" and anova() work.

function()
{
  library(mgcv)
  set.seed(12)
  nd <- 100
  xx1 <- runif(nd, min=1, max=10)
  xx1 <- sort(xx1)
  yy <- sin(xx1)+rnorm(nd, mean=5, sd=5)   data1 <- data.frame(x1=xx1, y=yy)
  fit1 <- gam(y~s(x1, k=5), data=data1, family=gaussian)   out1 <- anova(fit1)
  print(out1)
}

The results is:

Family: gaussian
Link function: identity
Formula:
y ~ s(x1, k = 5)
Approximate significance of smooth terms:

        edf Ref.df F p-value
s(x1) 3.367 3.867 1.992 0.104

   I do not understand why the value of "Ref.df" is larger than "edf" by 0.5. And I failed to find out an equation to derive the F value(1.992). Any help would be greatly appreciated.

        [[alternative HTML version deleted]]



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 Sat 26 Jul 2008 - 09:10:24 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 Sat 26 Jul 2008 - 09:32:23 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