Code
studentized Breusch-Pagan test
data: modelo
BP = 32.258, df = 6, p-value = 1.456e-05
Code
## MQGF
reg_aux <- lm(log(resid(modelo)^2) ~ log(income) + log(cigpric) + educ + age + I(age^2) + restaurn, data = smoke)
w <- 1/exp(fitted(reg_aux))
modelo_mqgf <- lm(cigs ~ log(income) + log(cigpric) + educ + age + I(age^2) + restaurn, weight = w, data = smoke)
round(cbind(MQO = coef(modelo),
stdMQO = summary(modelo)$coefficients[,2],
pMQO = summary(modelo)$coefficients[,4],
MQGF = coef(modelo_mqgf),
stdMQGF = summary(modelo_mqgf)$coefficients[,2],
pMQGF = summary(modelo_mqgf)$coefficients[,4]), 5)
MQO stdMQO pMQO MQGF stdMQGF pMQGF
(Intercept) -3.63983 24.07866 0.87988 5.63546 17.80314 0.75167
log(income) 0.88027 0.72778 0.22682 1.29524 0.43701 0.00313
log(cigpric) -0.75086 5.77334 0.89655 -2.94031 4.46014 0.50993
educ -0.50150 0.16708 0.00277 -0.46345 0.12016 0.00012
age 0.77069 0.16012 0.00000 0.48195 0.09681 0.00000
I(age^2) -0.00902 0.00174 0.00000 -0.00563 0.00094 0.00000
restaurn -2.82508 1.11179 0.01124 -3.46106 0.79551 0.00002