options(digits = 4)
data("GasolineYield", package = "betareg")
gy2 <- betareg(yield ~ batch + temp | temp, data = GasolineYield)
cbind(
predict(gy2, type = "response"),
predict(gy2, type = "link"),
predict(gy2, type = "precision"),
predict(gy2, type = "variance"),
predict(gy2, type = "quantile", at = c(0.25, 0.5, 0.75))
)
## evaluate cumulative _p_robabilities for (small) new data set
gyd <- GasolineYield[c(1, 5, 10), ]
## CDF at 0.1 for each observation
predict(gy2, newdata = gyd, type = "probability", at = 0.1)
## CDF at each combination of 0.1/0.2 and observations
predict(gy2, newdata = gyd, type = "probability", at = c(0.1, 0.2))
## CDF at elementwise combinations of 0.1/0.2/0.3 and observations
predict(gy2, newdata = gyd, type = "probability", at = c(0.1, 0.2, 0.3))
predict(gy2, newdata = gyd, type = "probability", at = c(0.1, 0.2, 0.3), elementwise = TRUE)
## CDF at all combinations of 0.1/0.2/0.3 and observations
predict(gy2, newdata = gyd, type = "probability", at = c(0.1, 0.2, 0.3), elementwise = FALSE)
Run the code above in your browser using DataLab