# \donttest{
require(gkwreg)
require(gkwdist)
data(MockJurors)
# Example 1: Main effects model with heteroscedasticity
# Confidence depends on verdict options and conflicting evidence
# Variability may also depend on these factors
fit_kw <- gkwreg(
confidence ~ verdict + conflict |
verdict * conflict,
data = MockJurors,
family = "kw"
)
summary(fit_kw)
# Interpretation:
# - Alpha (mean): Additive effects of verdict type and conflict
# Three-option verdicts may reduce confidence
# Conflicting evidence reduces confidence
# - Beta (precision): Interaction suggests confidence variability
# depends on combination of verdict options and evidence type
# Example 2: Full interaction in mean model
fit_kw_interact <- gkwreg(
confidence ~ verdict * conflict |
verdict * conflict,
data = MockJurors,
family = "kw"
)
summary(fit_kw_interact)
# Interpretation:
# - Full interaction: Third verdict option may have different effects
# depending on whether evidence is conflicting
# Test interaction significance
anova(fit_kw, fit_kw_interact)
# Example 3: McDonald distribution for extreme confidence patterns
# Jurors may show very high confidence (ceiling effects) or very low
# confidence depending on conditions
fit_mc <- gkwreg(
confidence ~ verdict * conflict | # gamma: full interaction
verdict * conflict | # delta: full interaction
verdict + conflict, # lambda: additive extremity effects
data = MockJurors,
family = "mc",
control = gkw_control(
method = "BFGS",
maxit = 1500,
reltol = 1e-8
)
)
summary(fit_mc)
# Interpretation:
# - Lambda: Models asymmetry and extreme confidence
# Some conditions produce more polarized confidence (very high or very low)
# Example 4: Exponentiated Kumaraswamy alternative
fit_ekw <- gkwreg(
confidence ~ verdict * conflict | # alpha
verdict + conflict | # beta
conflict, # lambda: conflict affects extremity
data = MockJurors,
family = "ekw",
control = gkw_control(
method = "BFGS",
maxit = 1500
)
)
summary(fit_ekw)
# Compare 3-parameter models
AIC(fit_ekw, fit_mc)
# }
Run the code above in your browser using DataLab