Applies To
Revolution Analytics

預設情況下則不會收到相同的結果從 'rxGlm' 'glm' 從一樣。您實際需要的引數 'dropFirst' 設為 TRUE 和 'dropMain' 設定為 FALSE,也可重現的 glm,結果,因為RevoScaleR 會使用預設的 SA 對比而不是 R 的預設對比。 以下是一些範例資料和我測試這項問題的說明如何取得兩個函式,以產生符合的結果中所使用的程式碼︰

basictestdata <- data.frame(  Factor1 = as.factor(c(1,1,1,1,2,2,2,2)),  Factor2 = as.factor(c(1,1,2,2,1,1,2,2)),  Discount = c(1,2,1,2,1,2,1,2),  Exposure = c(24000, 40000, 7000, 14000, 7500, 15000, 2000, 5600),  PurePrem = c(46,32,73,58,48,25,220,30))GLM.1 <- glm(PurePrem ~ Factor1 * Factor2 - 1,  family = tweedie(var.power = 1.5, link.power = 0),  data = basictestdata, weights = Exposure  , offset = log(Discount))rxGlm.1 <- rxGlm(PurePrem ~ Factor1 * Factor2 - 1 + offset(log(Discount)),  family = rxTweedie(var.power = 1.5, link.power = 0),  data = basictestdata, fweights = "Exposure", dropFirst = TRUE, dropMain = FALSE)coef(GLM.1) coef(rxGlm.1)

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。