if (FALSE) {
# Example 1: Beta regression on ReadingSkills data
# ------------------------------------------------
# This example analyzes factors affecting reading accuracy in children with dyslexia.
# Load ReadingSkills data
reading_data <- get_bounded_datasets("ReadingSkills")
# Fit beta regression model
reading_model <- gkwreg(
accuracy ~ dyslexia + iq,
data = reading_data,
family = "beta",
link = list(gamma = "log", delta = "logit")
)
summary(reading_model)
# Example 2: Kumaraswamy regression on FoodExpenditure data
# --------------------------------------------------------
# This example models the proportion of income spent on food.
# Load FoodExpenditure data
food_data <- get_bounded_datasets("FoodExpenditure")
food_data$y <- food_data$food / food_data$income
# Fit Kumaraswamy regression model
food_model <- gkwreg(
y ~ persons,
data = food_data,
family = "kw",
link = list(alpha = "log", beta = "log")
)
summary(food_model)
# Example 3: Exponential Kumaraswamy regression on retinal data
# ------------------------------------------------------------
# This example analyzes the decay of intraocular gas in retinal surgeries.
# Load retinal data
retinal_data <- get_bounded_datasets("retinal", package = "simplexreg")
# Fit a Kumaraswamy - Kumaraswamy model
retinal_model <- gkwreg(
Gas ~ LogT2 | Level | Time,
data = retinal_data,
family = "ekw"
)
summary(retinal_model)
}
Run the code above in your browser using DataLab