全部版块 我的主页
论坛 提问 悬赏 求职 新闻 读书 功能一区 经管百科 爱问频道
1383 0
2019-03-22
我做PM10对心脑血管疾病门诊人数的影响,将PM10根据浓度大小分成四类,0-0.1为第一类,0.1-0.15为第二类,0.15=0.25第三类,大于0.25为第四类,我现在要求分别求出第一类,第二类,第三类,第四类分别对应得RR值,请问我如何实现呢
脚本如下
rm(dow)
rm(time)
rm(wind)
rm(press)
rm(vi)
rm(atemp)
rm(htemp)
rm(dtemp)
read.table("C:/Users/14916/Desktop/jieguo/XZshuju/XINZONGLF.txt",header=T,fill=T)->fitty
fix(fitty)
attach(fitty)
downum=factor(dow)
downum
library(mgcv)
fitty=gam(low~downum,family=poisson,na.action=na.omit)
summary(fitty)
AIC(fitty)
stat <-NULL
mod<-list()
for (i in 1:50){
mod [[i]]=fit=gam(low~downum+s(time,k=11,fx=T)+s(wind,k=3,fx=T)+s(press,k=3,fx=T)+s(dew,k=3,fx=T)+s(vi,k=11,fx=T)+s(htemp,k=i,fx=T),family=poisson,na.action=na.omit)
tt=AIC(mod[[i]])
stat<-append(stat,tt)
}
plot(x=(1:50),y=stat)
stat
summary(stat)
fitty=gam(low~downum+s(time,k=11,fx=T)+s(wind,k=3,fx=T)+s(press,k=3,fx=T)+s(dew,k=3,fx=T)+s(vi,k=11,fx=T)+s(atemp,k=7,fx=T)+PM10,family=poisson,na.action=na.omit)
summary(fitty)
AIC(fitty)

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群