add_dropout_idx {dropR}R Documentation

Add Dropout Index to a Data.Frame

Description

Find drop out positions in a data.frame that contains multiple questions that had been asked sequentially. This function adds the Dropout Index variable do_idx to the data.frame which is necessary for further analyses of dropout.

Use this function first to prepare your dropout analysis. Then, keep going by creating the dropout statistics using compute_stats().

Usage

add_dropout_idx(df, q_pos)

Arguments

df

data.frame containing NAs

q_pos

numeric range of columns that contain question items

Details

Importantly, this function will start counting missing data at the end of the data frame. Any missing data which is somewhere in between, i.e. a single item that was skipped or forgotten will not be counted as dropout. The function will identify sequences of missing data that go until the end of the data frame and add the number of the last answered question in do_idx.

Therefore, the variables must be in the order that they were asked, otherwise analyses will not be valid.

Value

Returns original data frame with column do_idx added.

Source

R/add_dropout_idx.R

See Also

compute_stats() which is usually the next step for dropout analysis.

Examples

dropout <- add_dropout_idx(dropRdemo, 3:54)


[Package dropR version 1.0.3 Index]