uwmadison-chm / scorify

A simple tool for scoring psychological self-report questionnaires.
MIT License
6 stars 2 forks source link

Widen feature #18

Open dgfitch opened 5 years ago

dgfitch commented 5 years ago

The idea is we are sometimes scoring multiple visits and would like to widen so that each visit gets its own aggregated output column.

We need to specify one or more id/key columns to keep and not widen.

Imaginary usage:

widen | visit | id,nc 
measure sr_{visit}_measurename_score sum(acq)

This means some columns of input data would get pulled along as well. "ACQ3: ACQ" becomes "ACQ3_{widen column name}: ACQ"

njvack commented 5 years ago

Widening is also necessary for Gorilla's questionnaire output. See: /study/hm_measures/03-studies/mturk_studies/201904_self_referential_encoding/raw-data/201904_main/data_exp_7659-v8_questionnaire-tpxc_FFMQ.csv for an example.

I'm not sure this would work exactly like the above case; in this case we want Participant Private ID to become rows, Question Key to become columns, and Response to be values.

Maybe we can do this with a widen directive? Maybe this should be a separate preprocessing step? I'm not sure.

njvack commented 5 years ago

Maybe:

widen | row_part_1, ..., row_part_n | col_part_1, ..., col_part_n | value_1, ... value_n would work?

This definitely needs to run before scoring gets processed, so we can do:

score | FFMQ-Q1 | observe