Skip to contents

Perform chisquare test and display results if significant

Usage

plot_correlation(
  datalist = datalist,
  dico = dico,
  var,
  by_var,
  datasource = NULL,
  showcode = FALSE
)

Arguments

datalist

An object of the "datalist" class as defined in kobocruncher

dico

An object of the "kobodico" class format as defined in kobocruncher

var

name of the variable to display

by_var

variable to use for cross tabulation

datasource

name of the data source to display, if set to NULL - then pulls the form_title within the settings of the xlsform

showcode

display the code

Examples

dico <- kobo_dico( xlsformpath = system.file("sample_xlsform.xlsx", package = "kobocruncher") )
datalist <- kobo_data(datapath = system.file("data.xlsx", package = "kobocruncher") )

plot_correlation(datalist = datalist,
              dico = dico, 
              var = "profile.occupation",
              by_var = "profile.country",
              datasource = NULL)
#> Warning: Chi-squared approximation may be incorrect
#> 
#>  No significant association found between profile.occupation &  profile.country (p.value :0.3505).