Converting a numeric variable to a categorical variable of equal frequency and plot a numeric variable against it?

Hey Guys,

I was wondering how I could group and sum certain values of a variable, say ages, and plot them against corresponding values of another variable, say average weight.

For instance,

Step 1: Count the number of kids in each group and
Group them on basis of their age bucket:

0-10 years old : 12 people
10-20 years old: 15 people
20-30 years old: 11 people

Step 2: Variable: Average weight
1-10 years : 155 lbs
10-20 years old: 528 lbs
20-30 years old: 1200 lbs

Task: Plot age buckets against average weight.

Sounds you can create β€˜bin’ first, then use Pivot Table.

How to create bins.
https://docs.exploratory.io/wrangling/buckets.html

Cheers,
Kan

1 Like