do_chisq {dropR}R Documentation

Compute Chisq-Test Given a Question Position

Description

This function performs a chi-squared contingency table test on dropout for a given question in the data. Note that the input data should be in the format as computed by compute_stats(). The test can be performed on either all conditions (excluding total) or on select conditions.

Usage

do_chisq(do_stats, chisq_question, sel_cond_chisq, p_sim = TRUE)

Arguments

do_stats

data.frame of dropout statistics as computed by compute_stats().

chisq_question

numeric Which question to compare dropout at.

sel_cond_chisq

vector (same class as in conditions variable in original data set) selected conditions.

p_sim

boolean Simulate p value parameter (by Monte Carlo simulation)? Defaults to TRUE.

Value

Returns test results from chisq.test between experimental conditions at defined question.

See Also

add_dropout_idx() and compute_stats() which are necessary for the proper data structure.

Examples

do_stats <- compute_stats(add_dropout_idx(dropRdemo, 3:54),
by_cond = "experimental_condition",
no_of_vars = 52)

do_chisq(do_stats, 47, c(12, 22), TRUE)


[Package dropR version 1.0.3 Index]