| Title: | Computing Mann-Whitney Effect Based on Copulas |
|---|---|
| Description: | Computing the Mann-Whitney effect based on copula models. Estimation of the association parameter in survival copula models. A description of the underlying methods is described in Nakazono et al. (2024) <doi:10.3390/math12101453> and Nakazono et al. (accepted for publication in Statistical Papers). |
| Authors: | Kosuke Nakazono [aut, cre] |
| Maintainer: | Kosuke Nakazono <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-06-04 08:16:33 UTC |
| Source: | https://github.com/cran/MannWhitneyCopula |
MW.comp provides a parametric estimator for the Mann-Whitney effect under the parametric survival functions and copulas. See Nakazono, et al.(2024) for details.
MW.comp( copula = c("clayton", "gumbel", "frank", "fgm", "gb"), copula.param = 1, s1 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), S1.param, s2 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), S2.param )MW.comp( copula = c("clayton", "gumbel", "frank", "fgm", "gb"), copula.param = 1, s1 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), S1.param, s2 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), S2.param )
copula |
copula family. Available options include; "clayton", "gumbel", "frank", "fgm", "gb". |
copula.param |
the copula parameter. |
s1 |
a parametric survival function for S1. Available options include; "exponential", "weibull", "gamma", "log-normal", "burr3". |
S1.param |
the distribution parameter for S1. |
s2 |
a parametric survival function for S2. Available options include; "exponential", "weibull", "gamma", "log-normal", "burr3". |
S2.param |
the distribution parameter for S2. |
copula.param is restricted as below:
"clayton"; copula.param >= 0
"gumbel"; copula.param >= 0
"frank"; -Inf < copula.param < Inf
"fgm"; -1 =< copula.param =< 1
"gb"; -1 =< copula.param =< 1
estimate of the Mann-Whitney effect.
Nakazono, K., Lin, Y. C., Liao, G. Y., Uozumi, R., & Emura, T. (2024). Computation of the Mann–Whitney effect under parametric survival copula models. Mathematics, 12(10), 1453.
# Under the exponential survival functions and Clayton copula MW.comp( copula = "clayton", copula.param = 1, s1 = "exponential", S1.param = 1, s2 = "exponential", S2.param = 2 )# Under the exponential survival functions and Clayton copula MW.comp( copula = "clayton", copula.param = 1, s1 = "exponential", S1.param = 1, s2 = "exponential", S2.param = 2 )
MW.Copula provides a parametric estimator and confidence interval for the Mann-Whitney effect under the parametric survival functions and copulas. The result of this function includes results for logit-transformed estimators. See Nakazono, et al. (2025) for details.
MW.Copula( t.event, event, group, copula = c("clayton", "gumbel", "frank", "fgm", "gb"), copula.param = 1, s1 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), s2 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), par1 = c(0, 0), par2 = c(0, 0), alpha = 0.05, logit = FALSE )MW.Copula( t.event, event, group, copula = c("clayton", "gumbel", "frank", "fgm", "gb"), copula.param = 1, s1 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), s2 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), par1 = c(0, 0), par2 = c(0, 0), alpha = 0.05, logit = FALSE )
t.event |
a vector of time-to-event data. |
event |
a vector for event indicator. |
group |
a vector for group indicator. |
copula |
copula family. |
copula.param |
the copula parameter. |
s1 |
a parametric survival function for S1. Available options include; "exponential", "weibull", "gamma", "log-normal", "burr3". |
s2 |
a parametric survival function for S2. Available options include; "exponential", "weibull", "gamma", "log-normal", "burr3". |
par1 |
initial value(s) for the parameters of S1. |
par2 |
initial value(s) for the parameters of S2. |
alpha |
significance level. |
logit |
logical; if TRUE, the estimator and CI is logit-transformed. |
parameter: a vector of MLE.
estimate: the Mann-Whitney effect estimator
SE: the standard error
CI: the 1-alpha% confidence interval for Mann-Whitney effect
P.value: the P-value for testing the null hypothesis H0: p=1/2.
kendall: Kendall's tau
logit: the estimator and CI are logit-transformed or not.
Nakazono, K., Uozumi, R., & Emura, T. (2025). Parametric inference for the Mann-Whitney effect under survival copula models, Statistical Papers, in press.
##Mann-Whitney effect under exponential distributions #set distribution parameter lambda1 = 1 lambda2 = 2 #generate time to event u = runif(100) t.event1 = -log(u) / lambda1 t.event1 = sort(t.event1) v = runif(100) t.event2 = -log(v) / lambda2 t.event2 = sort(t.event2) #censoring indicator t1c = runif(100, 0, 1.5) t.event1 = (t1c >= t.event1) * t.event1 + (t1c < t.event1) * t1c event1 = 1 * (t1c > t.event1) t2c = runif(100, 0, 0.8) t.event2 = (t2c >= t.event2) * t.event2 + (t2c < t.event2) * t2c event2 = 1 * (t2c > t.event2) t.event = c(t.event1, t.event2) event = c(event1, event2) #group indicator group = rep(c(1, 0), each = 100) MW.Copula(t.event, event, group, copula = "clayton", copula.param = 1, s1 = "exponential", s2 = "exponential", par1 = c(0, 0), par2 = c(0, 0), logit = FALSE)##Mann-Whitney effect under exponential distributions #set distribution parameter lambda1 = 1 lambda2 = 2 #generate time to event u = runif(100) t.event1 = -log(u) / lambda1 t.event1 = sort(t.event1) v = runif(100) t.event2 = -log(v) / lambda2 t.event2 = sort(t.event2) #censoring indicator t1c = runif(100, 0, 1.5) t.event1 = (t1c >= t.event1) * t.event1 + (t1c < t.event1) * t1c event1 = 1 * (t1c > t.event1) t2c = runif(100, 0, 0.8) t.event2 = (t2c >= t.event2) * t.event2 + (t2c < t.event2) * t2c event2 = 1 * (t2c > t.event2) t.event = c(t.event1, t.event2) event = c(event1, event2) #group indicator group = rep(c(1, 0), each = 100) MW.Copula(t.event, event, group, copula = "clayton", copula.param = 1, s1 = "exponential", s2 = "exponential", par1 = c(0, 0), par2 = c(0, 0), logit = FALSE)
MW.plot plots the results, the parametric estimator and their confidence intervals, for the Mann-Whitney effect under parametric survival functions and copulas.
MW.plot(t.event, event, group, copula = c("clayton", "gumbel", "frank", "fgm", "gb"), lower = 0, upper = 1, s1 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), s2 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), par1 = c(0, 0), par2 = c(0, 0), alpha = 0.05, logit = FALSE, xaxis = 2 )MW.plot(t.event, event, group, copula = c("clayton", "gumbel", "frank", "fgm", "gb"), lower = 0, upper = 1, s1 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), s2 = c("exponential", "weibull", "gamma", "log-normal", "burr3"), par1 = c(0, 0), par2 = c(0, 0), alpha = 0.05, logit = FALSE, xaxis = 2 )
t.event |
a vector for time-to-event. |
event |
a vector for event indicator. |
group |
a vector for group indicator. |
copula |
copula family. |
lower |
the lower end points of the interval of the copula parameter. |
upper |
the lower end points of the interval of the copula parameter. |
s1 |
a parametric survival function for S1. Available options include; "exponential", "weibull", "gamma", "log-normal", "burr3". |
s2 |
a parametric survival function for S2. Available options include; "exponential", "weibull", "gamma", "log-normal", "burr3". |
par1 |
initial value(s) for the parameters of S1. |
par2 |
initial value(s) for the parameters of S2. |
alpha |
significance level. |
logit |
logical; if TRUE, the estimator and CI is logit-transformed. |
xaxis |
a indicator specifying whether the xaxis is the copula parameter (xaxis = 1) or Kendall's tau (xaxis = 2). |
No return value, called for side effects (generates a plot).
##Exponential distributions #set distribution parameter lambda1 = 1 lambda2 = 2 #generate time to event u = runif(100) t.event1 = -log(u) / lambda1 t.event1 = sort(t.event1) v = runif(100) t.event2 = -log(v) / lambda2 t.event2 = sort(t.event2) #censoring indicator t1c = runif(100, 0, 1.5) t.event1 = (t1c >= t.event1) * t.event1 + (t1c < t.event1) * t1c event1 = 1 * (t1c > t.event1) t2c = runif(100, 0, 0.8) t.event2 = (t2c >= t.event2) * t.event2 + (t2c < t.event2) * t2c event2 = 1 * (t2c > t.event2) t.event = c(t.event1, t.event2) event = c(event1, event2) #group indicator group = rep(c(1, 0), each = 100) MW.plot(t.event, event, group, copula = "clayton", lower = 0.2, upper = 0.8, s1 = "exponential", s2 = "exponential", par1 = c(0, 0), par2 = c(0, 0), alpha = 0.05, logit = FALSE, xaxis = 2)##Exponential distributions #set distribution parameter lambda1 = 1 lambda2 = 2 #generate time to event u = runif(100) t.event1 = -log(u) / lambda1 t.event1 = sort(t.event1) v = runif(100) t.event2 = -log(v) / lambda2 t.event2 = sort(t.event2) #censoring indicator t1c = runif(100, 0, 1.5) t.event1 = (t1c >= t.event1) * t.event1 + (t1c < t.event1) * t1c event1 = 1 * (t1c > t.event1) t2c = runif(100, 0, 0.8) t.event2 = (t2c >= t.event2) * t.event2 + (t2c < t.event2) * t2c event2 = 1 * (t2c > t.event2) t.event = c(t.event1, t.event2) event = c(event1, event2) #group indicator group = rep(c(1, 0), each = 100) MW.plot(t.event, event, group, copula = "clayton", lower = 0.2, upper = 0.8, s1 = "exponential", s2 = "exponential", par1 = c(0, 0), par2 = c(0, 0), alpha = 0.05, logit = FALSE, xaxis = 2)
survival.mle provides the maximum likelihood estimator and their variance-covariance matrix under parametric survival functions. This function also provides AIC and Kolmogorov-Smirnov distance to evaluate the model fitting.
survival.mle( t.event, event, distribution = c("exponential", "weibull", "gamma", "log-normal", "burr3"), par = c(0,0))survival.mle( t.event, event, distribution = c("exponential", "weibull", "gamma", "log-normal", "burr3"), par = c(0,0))
t.event |
a vector for time-to-event. |
event |
a vector for event indicator. |
distribution |
a parametric distribution for survival function. Available options include; "exponential", "weibull", "gamma", "log-normal", "burr3". |
par |
initial value(s) for the distribution parameters. |
estimate: a vector of MLE.
var: variance-covariance matrix of MLE.
AIC: Akaike information criteria.
KS: Kolmogorov-Smirnov distance between MLE and KM estimator.
#MLE under exponential distribution #set distribution parameter lambda = 1 #generate time to event u = runif(100) t.event = -log(u)/lambda t.event = sort(t.event) #censoring indicator tc = runif(100, 0, 1.5) t.event = (tc >= t.event) * t.event + (tc < t.event) * tc event = 1 * (tc > t.event) survival.mle(t.event, event, distribution = "exponential")#MLE under exponential distribution #set distribution parameter lambda = 1 #generate time to event u = runif(100) t.event = -log(u)/lambda t.event = sort(t.event) #censoring indicator tc = runif(100, 0, 1.5) t.event = (tc >= t.event) * t.event + (tc < t.event) * tc event = 1 * (tc > t.event) survival.mle(t.event, event, distribution = "exponential")