Running Dropout related Tests with dropR"

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(dropR)
data("dropRdemo")
qs <- which(grepl("vi_", names(dropRdemo)))
dropRdemo <- add_dropout_idx(dropRdemo, q_pos = qs)

stats <- compute_stats(dropRdemo,
                             by_cond = "experimental_condition",
                             no_of_vars = length(qs))

Running a Chi-sq. Test for a Selected Question

NOTE: Chi-sq. tests are only available when an column denoting the experimental condition is given.

Let's compute a Chisq test at question 15 for experimentatl conditions 11 and 12. dropR's dropout Chisq-Test returns a list containing the actual test results and dropout overview table at the selected question.

do_chisq(stats,
         chisq_question = 15,
         sel_cond_chisq = c('11','12'),
         p_sim = TRUE)

Kaplan-Meier Estimation

kpm <- do_kpm(df = add_dropout_idx(dropRdemo, qs),
              condition_col = "experimental_condition",
              model_fit = "total")

kpm$model_fit
head(kpm$steps)
head(kpm$d)


Try the dropR package in your browser

Any scripts or data that you put into this service are public.

dropR documentation built on July 3, 2024, 5:06 p.m.