2016-04-30 30 views
1

我正在爲我的數據做零膨脹模型。我使用RStudio和pscl包。我的模型:系統在R中的計算奇異性錯誤

z_deniz <- zeroinfl(YANs ~ deniz, dist = "poisson", link = "logit", data=zipveri3) 
zn3_nufus05 <- zeroinfl(YANs ~ nufus05, dist = "negbin", link = "logit", data=zipveri3) 

我沒有與我的其他型號的問題,但我得到這個錯誤與這兩款車型:

錯誤solve.default(as.matrix(FIT $麻袋) ): 系統在計算上是單數:倒數條件數= 9.93413e-121

因變量是火計數和獨立變量是海岸線和人口的距離。我試圖記錄轉換我的因變量,但它不起作用。

summary(regveri3$deniz) 
    Min. 1st Qu. Median  Mean 3rd Qu.  Max. 
    4.24 18010.00 48070.00 65760.00 97340.00 269200.00 

任何幫助表示讚賞!

+2

請添加一些數據使其成爲MWE。 http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/28481250?s=3|0.0000#28481250 – dww

+2

我認爲這是一個*數學*問題比一個*編程*問題:請參閱http://stats.stackexchange.com/questions/76488/error-system-is-computationally-singular-when-running-a-glm和http://stats.stackexchange.com/questions/71438/computationally-singular-error-using-mirt-package(以及更多[CrossValidated](http://stats.stackexchange.com/search?q=computationally+singular+ [r]))。 – r2evans

回答

1

嘗試指定零組分的迴歸器。如果你不想使用, 然後添加「1」;否則你要使用的變量替換「1」:

z_deniz <- zeroinfl(YANs ~ deniz | 1, dist = "poisson", link = "logit", data=zipveri3) 

來源可以發現here