Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Pie Chart Won't Calculate % correctly

I have a small table with two columns - one nominal variable (just some country names) with a scale (some numbers associated with the country). I am trying to create a pie chart to show what % of the total is each country but I'm not able to calculate the correct % for the pie chart. All the sections of the pie are the same size. Excel is able to do it but I want to know how to do it in JASP.


Comments

  • edited October 9

    Hi @newjaspuser ,

    The pie chart you create is based on a single column, where it looks at how frequently each value occurs. Since you have a separate column that indicates the counts, it is unfortunately not possible to create a pie chart in descriptives.

    If you want to visualize the counts, using a count variable, then there are two options:

    • In Frequencies -> Multinomial test, you can specify a factor and counts, and then request a Descriptives plot that provides a bar chart of the counts
    • You can create a new variable that has the single column with all observations, occurring as many times as the Counts column in your data. This is a bit technical, but you can first create a new column (see here), then select the R icon after specifying the name, and use the following R-code to create this variable: "rep(Country, each = Counts)", where Country should be name of the variable you have that has the countries, and Counts should be the name of the variable with the observed frequencies. This is how it looks like if you do it:

    Sorry that there is not a better way of doing it for now - we will work on a more elegant way of handling counts variable in future versions with more elaborate data editing.

    Kind regards

    Johnny

Sign In or Register to comment.