library(mgcv)
##1 读取数据
trainset <- read.delim(file="F:/07.txt",header=TRUE)
testset <- read.delim(file="F:/2012/07.txt",header=TRUE)
sst<-trainset[,1]
stg<-trainset[,2]
ssh<-trainset[,3]
sss<-trainset[,4]
CPUE<-trainset[,5]
mgam<-gam(log(CPUE+1)~s(sst)+s(ssh)+s(sss)+s(stg),data=trainset,model=T)
summary(mgam)
##2运行结果
Family: gaussian
Link function: identity
Formula:
log(CPUE + 1) ~ s(sst) + s(ssh) + s(sss) + s(stg)
Parametric coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.11369 0.07581 80.65 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Approximate significance of smooth terms:
edf Ref.df F p-value
s(sst) 7.603 8.505 5.034 5.51e-06 ***
s(ssh) 5.255 6.430 3.018 0.00568 **
s(sss) 2.139 2.692 4.305 0.00740 **
s(stg) 2.032 2.584 0.904 0.44626
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
R-sq.(adj) = 0.21 Deviance explained = 24.7%
GCV = 2.2236 Scale est. = 2.1147 n = 368
##3 提问
GAM模型的运行结果能否得到log(CPUE+1)与s(sst)、s(ssh)、s(sss)、s(stg)之间的关系,怎么看?
谢谢大家!!


雷达卡



京公网安备 11010802022788号







