Pagal numatytuosius parametrus nėra gausite tuos pačius rezultatus iš "rxGlm" kaip iš "glm".
Iš tikrųjų turite nustatyti argumentų 'dropFirst' TRUE ir "dropMain" false, taip pat norint atkurti glm, rezultatai, nes
RevoScaleR naudos SAS kontrastas pagal numatytuosius parametrus, o ne r. numatytąjį kontrastas.
Štai keletas pavyzdinių duomenų ir kodą aš išbandyti šią problemą, paaiškina, kaip gauti dvi funkcijas atitinkančių rezultatų:
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)