# Rt<1啦,上海疫情流行趋势分析

Shalom

| 传染病的有效再生数与基本再生数,” n.d.)

2019)，需要假设系列间隔(serial
interval)的分布,本文中假设系列间隔均值为4天，标准差为2天(“新型冠状病毒Omicron变异株的流行病学特征及其科学防控建议,”
n.d.)。使用`EpiEstim`包默认的1周滑动窗进行分析。结果如下：

``````library(tidyverse)
library(EpiEstim)
library(patchwork)

# observation
cases<-case.asym.wider.sh %>%
select(date,pos) %>%
mutate(date=as.Date(date)) %>%
rename(I=pos,dates=date)

## make config
config <- make_config(
mean_si = 4,
std_si = 2
)

## estimate
res <- estimate_R(
incid = cases,
method = "parametric_si",
config = config
)

#plot(res)

res.r<-res\$R %>% as_tibble() %>%
rename(mean=`Mean(R)`,std=`Std(R)`,lbd=`Quantile.0.025(R)`,ubd=`Quantile.0.975(R)`) %>%
mutate(date=cases\$dates[res\$R\$t_end])

res.si <- as_tibble(list(time=as.integer(str_sub(names(res\$si_distr),2)),
frequency=as.vector(res\$si_distr)))

p1<-ggplot(data = cases,aes(x=dates,y=I))+
scale_x_date(date_breaks = "2 days",date_labels = "%m/%d",expand = c(0,0.5))+
labs(x="",y="每日新增阳性数",title="Epidemic curve")+
theme_bw()+
theme(axis.text.x = element_text(angle=45,vjust=0.5,hjust = 0.5))

p2<-ggplot(data = res.r,aes(x=date,y=mean))+
geom_hline(yintercept = 1,size=1,lty=2)+
scale_x_date(date_breaks = "2 days",date_labels = "%m/%d",expand = c(0,0.5),limits = c(as.Date('2022-03-09'),Sys.Date()-1))+
labs(x="",y="时变再生数Rt",title='')+
theme_bw()+
theme(axis.text.x = element_text(angle=45,vjust=0.5,hjust = 0.5))

p3<-ggplot(data = res.si,aes(x=time,y=frequency))+
geom_line()+
labs(x="Time",y="Frequency",title='Assumptive Serial Interval Distribution')+
theme_bw()

p1+p2+plot_layout(ncol = 1)
p3``````

## 参考资料

[1] Thompson, R. N., J. E. Stockwin, R. D. van Gaalen, J. A. Polonsky, Z. N.
Kamvar, P. A. Demarsh, E. Dahlqwist, et al. 2019. “Improved Inference of
Time-Varying Reproduction Numbers During Infectious Disease Outbreaks.”
Epidemics 29 (December): 100356.
https://doi.org/10.1016/j.epi....

[2] “新型冠状病毒Omicron变异株的流行病学特征及其科学防控建议.”
http://mp.weixin.qq.com/s?__b....

[3] “流行病学专家解读 | 传染病的有效再生数与基本再生数.”
http://mp.weixin.qq.com/s?__b....

1 声望
0 粉丝
0 条评论