Skip to contents

list_read_data() Read list experiment data and return a properly formatted data.frame. Should contain at least the following four variables;

  1. Variable with _list_[0-9]_direct suffix – A variable containing responses to the direct version of the list experiment. The number identifies the bundle. The values are LIMITED to: "Agree", "Disagree" and "Don’t know / No opinion".

  2. Variable with _list_[0-9]_bundle suffix – A variable containing responses to the treatment or control question of the list experiment. The number identifies the bundle.

  3. Variable with _list_[0-9]_group suffix – A variable containing the control/treatment identifier. The number identifies the bundle.

  4. A variable with respondent's IDs.

list_read_data_bulk() is is convenient wrapper over list_read_data() for multiple bundles. It takes the survey data and returns each bundle nicely formatted as a separate list element.

Usage

list_read_data_bulk(data, id)

list_read_data(data, id)

Arguments

data

A data.frame or tibble with raw survey data.

id

Quoted or unqouted name of column which stores respondent's IDs.

Value

A data.frame (in the case of single bundle) or a list of bundles with formatted dataset for list experiments. The resulting dataset(s) will contain following columns:

  1. response_id – Respondent's IDs.

  2. le_direct – Responses to direct question, coded as Factors.

  3. group – Indicating if the respondent was in control (0) or treatment (1) group.

  4. le_response – Response to List Experiment question, coded as Integer.

Examples


### To read the List Experiment data simply pass the raw survey to the
### list_read_data_bulk() function

data("list_experiment_toy")
list_read_data_bulk(list_experiment_toy, response_id)
#> $bundle_1
#> # A tibble: 491 × 4
#>    response_id       group le_response le_direct              
#>    <chr>             <dbl>       <int> <fct>                  
#>  1 R_3hmU6JnwqHTdM4K     0           4 agree                  
#>  2 R_1iqZhVMAC7wE5vE     0           1 disagree               
#>  3 R_3GrhDcnGpsy0YmA     1           2 don’t know / no opinion
#>  4 R_20OPJhnGqVxdrRD     1           1 agree                  
#>  5 R_1MNckiiUwazy18h     0           3 disagree               
#>  6 R_To1z3EsU1o0eJB7     0           1 disagree               
#>  7 R_3JzaalT7iZh7Ya6     1           2 don’t know / no opinion
#>  8 R_3ikDMJJiQfxzlwA     1           2 disagree               
#>  9 R_3q9gJP8yhdJvVI2     0           1 disagree               
#> 10 R_bE1A5bxpxiUafiV     0           0 disagree               
#> # ℹ 481 more rows
#> 
#> $bundle_2
#> # A tibble: 491 × 4
#>    response_id       group le_response le_direct              
#>    <chr>             <dbl>       <int> <fct>                  
#>  1 R_3hmU6JnwqHTdM4K     0           0 disagree               
#>  2 R_1iqZhVMAC7wE5vE     0           3 disagree               
#>  3 R_3GrhDcnGpsy0YmA     1           3 disagree               
#>  4 R_20OPJhnGqVxdrRD     1           4 agree                  
#>  5 R_1MNckiiUwazy18h     0           2 agree                  
#>  6 R_To1z3EsU1o0eJB7     0           4 disagree               
#>  7 R_3JzaalT7iZh7Ya6     1           2 disagree               
#>  8 R_3ikDMJJiQfxzlwA     1           3 agree                  
#>  9 R_3q9gJP8yhdJvVI2     0           3 don’t know / no opinion
#> 10 R_bE1A5bxpxiUafiV     0           3 agree                  
#> # ℹ 481 more rows
#> 
#> $bundle_3
#> # A tibble: 491 × 4
#>    response_id       group le_response le_direct              
#>    <chr>             <dbl>       <int> <fct>                  
#>  1 R_3hmU6JnwqHTdM4K     0           4 agree                  
#>  2 R_1iqZhVMAC7wE5vE     0           1 disagree               
#>  3 R_3GrhDcnGpsy0YmA     1           2 don’t know / no opinion
#>  4 R_20OPJhnGqVxdrRD     1           1 agree                  
#>  5 R_1MNckiiUwazy18h     0           3 disagree               
#>  6 R_To1z3EsU1o0eJB7     0           1 disagree               
#>  7 R_3JzaalT7iZh7Ya6     1           2 don’t know / no opinion
#>  8 R_3ikDMJJiQfxzlwA     1           2 disagree               
#>  9 R_3q9gJP8yhdJvVI2     0           1 disagree               
#> 10 R_bE1A5bxpxiUafiV     0           0 disagree               
#> # ℹ 481 more rows
#>