# \donttest{
require(gkwreg)
require(gkwdist)
data(sdac)
# Example 1: Basic Kumaraswamy regression
# Mean recovery depends on age and chemotherapy protocol
# Precision varies with age (older patients more variable)
fit_kw <- gkwreg(
rcd ~ ageadj + chemo |
age,
data = sdac,
family = "kw"
)
summary(fit_kw)
# Interpretation:
# - Alpha (mean recovery): Depends on age-adjusted covariate and chemo protocol
# Different protocols show different baseline recovery rates
# G-CSF-only may differ from multi-day chemotherapy protocols
# - Beta (precision): Raw age affects recovery variability
# Hypothesis: Older patients show more heterogeneous responses
# Example 2: Include gender effects
# Gender may influence stem cell recovery rates
fit_kw_gender <- gkwreg(
rcd ~ ageadj + chemo + gender |
age + gender,
data = sdac,
family = "kw"
)
summary(fit_kw_gender)
# Interpretation:
# - Gender effects in both mean and precision
# - Precision may differ between males and females
# Test gender significance
anova(fit_kw, fit_kw_gender)
# Example 3: Exponentiated Kumaraswamy for extreme recovery patterns
# Some patients show unusually high or low recovery (outliers)
# Lambda parameter captures tail heaviness
fit_ekw <- gkwreg(
rcd ~ ageadj + chemo + gender | # alpha: mean model
age + chemo | # beta: precision varies with age and protocol
chemo, # lambda: protocol affects extremity
data = sdac,
family = "ekw"
)
summary(fit_ekw)
# Clinical interpretation:
# - Lambda varies by chemotherapy protocol: Some protocols produce more
# extreme recovery patterns (very high or very low CD34+ counts)
# - G-CSF-only vs multi-day protocols may differ in tail behavior
# - Important for risk stratification and clinical decision-making
# Test if extreme patterns differ by protocol
anova(fit_kw_gender, fit_ekw)
# Example 4: Interaction between age and protocol
# Protocol effectiveness may vary with patient age
fit_kw_interact <- gkwreg(
rcd ~ ageadj * chemo |
age * chemo,
data = sdac,
family = "kw"
)
summary(fit_kw_interact)
# Interpretation:
# - Interaction: Does protocol effectiveness decline with age?
# - Critical for personalized treatment selection
# }
Run the code above in your browser using DataLab