Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

checkReliability

Jesse Lingeman edited this page Jul 20, 2012 · 1 revision

Purpose

This function is used to do a quick reliability check between a primary and reliability variable. The goal isn't to do formal statistical checks, but rather to provide at a glance the percent agreement between the arguments of two variables.

The idea is to have a coder code a primary column, then make a reliability column from that column using makeReliability. A second coder then codes the generated reliability column.

In order to do this, one of the arguments between the two columns have to match. For example, trial number works well for this. A reliability column will only have a percentage of the original column coded, so there has to be some way to bind a cell in the primary column to a cell in the reliability column.

Parameters

Primary Variable (String of variable name or RVariable)

This is the variable that the primary coder coded.

Reliability Variable (String of variable name or RVariable)

This is the variable that the reliability coder coded, probably generated with makeReliability, NOTE: This must have exactly the same argument names as the primary column.

Matching Argument (String of the argument name)

This is the argument that the function will use to match primary and reliability cells together. A coded argument such as trial number is a good candidate for this, but it has to be some sort of unique identifier that can match a primary cell to a reliability cell.

For example, if the reliability coder has coded every fourth cell, and one of the arguments in the cell is trial number (trialnum), then telling the function to use "trialnum" as the matching argument will correctly bind the cells, because then the function knows the cell that matches the primary cell where trialnum is "4" is the reliability cell where trialnum is also "4".

Time Tolerance (Integer representing number of MILLISECONDS)

The amount of time, in milliseconds, that an onset or offset can mismatch before this function will report it as an error.

For example, if this parameter is set to 100, then a difference of 100 milliseconds between the primary and reliability cells' onsets will not count as an error. A difference of 101 will count as an error.

Dump file (String or File) Optional

Whether or not we want to dump the results of this output to a file or simply print them to the console. If this is set to a string, it will create a file and use that. If a file already exists in that place, it will append to it rather than overwriting it.

A file pointer can also be passed here and that will be used instead of opening a new file pointer.

Returns

Nothing.

Examples

# Say we want to check rel on a variable called "trial" and its reliability variable
# called "rel.trial", and it has a matching argument called "trialnum" that binds
# the two variables together. We only care about differences in times greater than
# 100ms, and we want to dump to a file on the desktop.

output_file = File.expand_path("~/Desktop/output.txt")
checkReliability("trial", "rel.trial", "trialnum", 100, output_file)