1

カウントデータがあり、データには自己相関と過分散の問題があるため、動的負の二項回帰を使用して時系列分析を行う必要があります。使用できる R パッケージをオンラインで検索しましたが、見つかりませんでした。

助けていただければ幸いです。

私のデータの例:

>St1
[1] 17  9 28  7 23 16 17 12 11 16 19 29  5 40 13 27 13 11 10 14 13 23 21 24  9 42 14 22 17  9

>Years
 [1] 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006
[23] 2007 2008 2009 2010 2011 2012 2013 2014

>library(AER)
>library(stats)

>rd <- glm(St1 ~ Years, family = poisson)
>dispersiontest(rd) 

Overdispersion test
data:  rd
z = 2.6479, p-value = 0.00405
alternative hypothesis: true dispersion is greater than 1
sample estimates:
dispersion 
  4.305539 

#Autocorrelation
>Box.test (St1, lag=ceiling(log(length(St1))), type = "Ljung")

    Box-Ljung test

data:  St1
X-squared = 13.612, df = 4, p-value = 0.008641
4

1 に答える 1