Announcing the new Datavyu v1.3.6 with enhanced features and transcription support!

I am trying to write a script for reliability check. I have the template script for checking reliability that compares two cells that have the same ordinal number. However, my coding doesn't work in this way. Each coder code the behavior whenever they observe (event-coding), so each may have different numbers of cells. I have tried putting "onset" instead of "ordinal" in the template that I have, but the result didn't seem right (agreements were 100% although those weren't). I found a similar question titled "Reliability scripting question", but I couldn't quite understand the script given in the answer. Since I am a beginner of writing a script, I couldn't fully understand the script, and therefore, I'm not sure which part should be changed when I edit it to fit to my data.

asked 12 Aug '16, 00:36

younme45's gravatar image

accept rate: 0%

I just reviewed the post you mentioned and while the sample code in the answer was a bit verbose, it can serve as a good starting point. The basic idea is to construct a column that merges together two columns such that a cell is created in the new column whenever a cell starts or stops in either of the original columns.

For example:


You would then check each of the cells in the merged column and see if it denotes a disagreement or agreement (when the value of a code is blank, denoted in the image above as the name of the code inside less-than and greater-than symbols, it means it was not coded in the respective column).

Documentation on how to use the create_mutually_exclusive function can be found on the API reference page: core documentation

Additional documentation is also available at: full documentation

Since you are new to scripting, here is a quick skeleton script to get you started:

## Paramaters
primary_column_name = 'primary'
reliability_column_name = 'reliability'
merge_column_name = 'merged_column'
save_merged_column = true

## Body
require 'Datavyu_API.rb'

# Load the columns
pri_col = getVariable(primary_column_name)
rel_col = getVariable(reliability_column_name)

merge_column = create_mutually_exclusive(merge_column_name, pri_col, rel_col)

# Loop over cells in merged column
merge_column.cells.each do |cell|
    ## Additional code to do disagreement checking here ##

setVariable(merge_column) if save_merged_column

permanent link

answered 15 Aug '16, 16:46

Shohan%20Hasan's gravatar image

Shohan Hasan ♦♦
accept rate: 11%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 12 Aug '16, 00:36

question was seen: 796 times

last updated: 15 Aug '16, 16:46

powered by OSQA