R/twin.clustertrunc.r
twin.clustertrunc.Rd
Estimation of twostage model with cluster truncation in bivariate situation
twin.clustertrunc(
survformula,
data = parent.frame(),
theta.des = NULL,
clusters = NULL,
var.link = 1,
Nit = 10,
final.fitting = FALSE,
...
)
Formula with survival model aalen or cox.aalen, some limitiation on model specification due to call of fast.reshape (so for example interactions and * and : do not work here, expand prior to call)
Data frame
design for dependence parameters in two-stage model
clustering variable for twins
exp link for theta
number of iteration
TRUE to do final estimation with SE and ... arguments for marginal models
Additional arguments to lower level functions
library("timereg")
data(diabetes)
v <- diabetes$time*runif(nrow(diabetes))*rbinom(nrow(diabetes),1,0.5)
diabetes$v <- v
aout <- twin.clustertrunc(Surv(v,time,status)~1+treat+adult,
data=diabetes,clusters="id")
aout$two ## twostage output
#>
#> Dependence parameter for Clayton-Oakes model
#> Variance of Gamma distributed random effects
#> With log-link
#> $estimates
#> log-Coef. SE z P-val Kendall tau SE
#> dependence1 -0.4125038 0.3719616 -1.108996 0.267432 0.2486826 0.06949713
#>
#> $vargam
#> Estimate Std.Err 2.5% 97.5% P-value
#> dependence1 0.662 0.2462 0.1794 1.145 0.007178
#>
#> $type
#> [1] "clayton.oakes"
#>
#> attr(,"class")
#> [1] "summary.mets.twostage"
par(mfrow=c(2,2))
plot(aout$marg) ## marginal model output
out <- twin.clustertrunc(Surv(v,time,status)~1+prop(treat)+prop(adult),
data=diabetes,clusters="id")
out$two ## twostage output
#>
#> Dependence parameter for Clayton-Oakes model
#> Variance of Gamma distributed random effects
#> With log-link
#> $estimates
#> log-Coef. SE z P-val Kendall tau SE
#> dependence1 -0.391893 0.3637734 -1.0773 0.2813464 0.2525534 0.06866958
#>
#> $vargam
#> Estimate Std.Err 2.5% 97.5% P-value
#> dependence1 0.6758 0.2458 0.194 1.158 0.005978
#>
#> $type
#> [1] "clayton.oakes"
#>
#> attr(,"class")
#> [1] "summary.mets.twostage"
plot(out$marg) ## marginal model output