Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

預設情況下則不會收到相同的結果從 '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?

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

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×