Page 1 of 1

Side-by-side bar chart for weighted data

Posted: Wed Jun 05, 2019 11:37 am
by PeteD
Hi all

Suppose I have a two-way table of counts, and the data are entered in "short" form (rather than one row per 'person', or "long" format); say

Code: Select all

 52,1,0
105,1,1
  2,2,0
 24,2,1
...where the columns are the counts, and the other two are the two qualitative variables and their two levels.

This is, of course, a very common way to enter such data, and SPSS handles it through a general Data> Weight cases option before doing any analysis.

Now, performing a chi-square test with data entered this way is easy enough in jamovi: Frequencies> Independent samples, and the "Counts" contain the first column of the above, indicating the number of times each of the combinations of the qualitative variables occur.

So far, so good... but I cannot generate a plot from within there (unlike, say, for a two-sample t-test). So I head to Exploration> Descriptives to try and produce a chart/graph. The two qualitative variables can be placed in "Variable" and "Split by" which almost does the correct thing... but the "Counts" (the weightings; the first column in the data above) are lost, so the plot is wrong. This would work presumably if the data file were set up with the one-row-per-'person' "long" format, rather than the combined/weighted "short" format as above.

Am I doing something wrong, or missing something? Or should this be a feature request?

Thanks for guidance; any advice appreciated.

P.

Re: Side-by-side bar chart for weighted data

Posted: Tue Jun 11, 2019 9:05 am
by jonathon
hey, yes, create a github issue.

i have been thinking about 'weight cases' lately.

cheers

jonathon

Re: Side-by-side bar chart for weighted data

Posted: Tue Jun 11, 2019 10:31 pm
by PeteD
Thanks jonathon. I take this to mean that it is something that is likely to get added soon :smirk:

The "Weight cases" idea works fine for the chi-square test, but not the bar chart which must be created separately. With t-tests, for example, the option exists to create the plots within that t-test dialog box... so adding an option for creating a bar chart within the chi-square test dialog box would be useful.

Thanks.

P.

Re: Side-by-side bar chart for weighted data

Posted: Thu Jun 13, 2019 6:23 am
by jonathon
oh that's true. perhaps that's the easiest way forward here? to add a bar chart to the contingency tables?

jonathon