Skip to contents

Pool estimates using the Rubin Rules

Usage

pooling_rubin(estimate, std.error, df = NA_real_, term = NULL)

Arguments

estimate

List. Each element of the list is a vector of pseudo estimates of length \(m\).

std.error

List. The standard error of the estimates.

df

Numeric. Indicates the degrees of freedom of the test.

term

Character. Indicates the names of the estimates.

Value

A data frame with the pooled results.

Details

This function is adapted from the mice::pool() function.

References

Rubin, D.B. (1987). Multiple Imputation for Nonresponse in Surveys. New York: John Wiley and Sons.

Van Buuren, S., Groothuis-Oudshoorn, K., & Robitzsch, A. (2019). Package ‘mice’: multivariate imputation by chained equations. CRAN Repos.

Examples

if (FALSE) {
library(survival)
data(tvtdata2)

list_data_surv <-
replicate(n = 3,
    {tvt_matching_date(tvtdata2,date_statrisk = stos,treatna,eos,eos01)},
    simplify = F)

list_data_surv <- lapply(list_data_surv, \(di){
    di%>%
      bind_cols(tvtdata2%>%
      select(eos01,fct_2lvl,fct_4lvl,xcov)%>%
      slice(tvt_new$id_row))})

list_coxph <- lapply(list_data_surv, \(di){
    coxph(Surv(time_eos_tv,state_eos_tv)~treat_tv+xcov,data= di)})

estim <- lapply(list_coxph,coef)
var <- lapply(list_coxph,\(x){sqrt(diag(x$var))})
df <- list_coxph[[1]]$n-length(lestim[[1]])
term <- names(lestim[[1]])
pooling_rubin(estim,var,df,term)
}