R-users
E-mail: r-help@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.
***** r.otasuke@gmail.com *****
[[alternative HTML version deleted]]