Chi-Square Test With More Than 2 Categories

tableau chi square test

I have just enrolled in a Data Science course on Udemy  and I learned good stuff.

In this article, we will do a Chi-square test with more than 2 categories. We will use the A/B test « Country » which has 3 categories which corresponds to 3 countries : German, Spain and France. Select « Gender Actual » tab, make a copy with a right-click and select « Duplicate ».

tableau chi square test

Name the tab « Gender Actual (2) » by « Country Actual ».

tableau chi square test

In « Dimensions », move the variable « Geography » over « Gender » in « Columns » to replace « Gender » with « Geography ».

tableau chi square test

tableau chi square test

Here’s how to do an A/B statistical test when there are 3 categories. We’ll start with the classic method and then I’ll show you another way to do Chi-square test with any number of categories.

Let’s start with the classical method. In this case, there are 3 categories so we can’t use the online tool of the previous article. In the previous article we used an online tool with only 2 categories « Sample1 » and « Sample2 ». That’s why we’re going to use another online tool, click here  .

tableau chi square test

In this online tool, we can enter the values without using the total values. That is, we enter only the number of observations in each category. We simply need to enter the values that are on our A/B test. And I’m going to show you how to turn our A/B test into a table. In this way, it will be easier to enter the values in the online tool without making any mistakes.

Go to the « Show me » tool at the top right.

tableau chi square test

Click on « text tables »

tableau chi square test

tableau chi square test

Click on « Swap Rows ans Columns » button.

tableau chi square test

tableau chi square test

Cool, now you have a table arranged in exactly the same way as the online tool.

In the online tool, we will select 2 rows and 3 columns.

tableau chi square test

As we have 3 categories and 2 possible results, we enter our values exactly as in the table we just created on Tableau.

tableau chi square test

Perfect, our table is ready. You can click on the « Calculate » button.

tableau chi square test

tableau chi square test

As you can see, we observe the same thing as the other online tool. There is our indicator « p » value which is less than 5%. Which means there is a meaning.

tableau chi square test

This statistical significance means that these results are valid for the total number of the bank’s clients and not just for the sample of 10 000 clients. We observe similar differences with A/B test « Country » whose results are based solely on the sample of 10 000 clients. We can conclude that in the total number of the bank’s clients, it’s the clients in Germany who are more likely to leave the bank. This is how we do things cleanly.

You saw, this online tool limited by 5 by 5 tables so you can’t use this tool when you have 6 categories or more. But fortunately it’s possible to do Chi-square test with any number of categories. It’s a special method and for you to understand that, I’ll give you a theoretical explanation.

Here we have 3 countries : German, Spain and France.

tableau chi square test

What we’re trying to compare is the clients number leaving the bank in each of these countries.

tableau chi square test

With our basic A/B test based on a sample of 10 000 clients, we obtained 16% for France, 32% for Germany and 17% for Spain. Now the question is : « Do we observe the same results on the total clients number of the bank ? », it means : « In general, does the country have a significant effect on the clients number leaving bank ? ». Germany has the largest number of clients leaving the bank so the idea is : « Why would we need to compare the 3 countries at the same time ? ».

tableau chi square test

If we do an A/B test statistical test with Germany and France and we get a significant difference in the clients number leaving the bank between these 2 countries, then that would mean that in general, the country has a significant effect on the clients number who bank. Indeed, if we find by comparing Germany and France that the Germans are more likely to leave the bank than the French, we can consider that Spain will not change anything. Germans will always be more likely to leave the bank than the French. Maybe there will be a different relationship between Germany and Spain but there will always be a statistically significant difference between France and Germany with a larger number of clients leaving the bank in Germany than France.

Here is a way to confirm that this logic is true. There is a test and the participants of this test are German, Spanish and French. Imagine that this test was done without looking at what is happening in Spain. Now you get the result and you ask yourself the question : « Would the results changed if you added Spain ? ». The answer is « no » because there is no interdependence between Germany, Spain and France. That is, the decision to leave the bank in France and Germany doesn’t depend on Spain. And therefore, it’s quite correct to separate the categories by putting 1 aside to compare the 2 others. And as now we have 2 categories, we can do a Chi-square test with the online tool that we used in the previous article.

So let’s go back to our worksheet and put a country aside to compare only 2 countries. Select « Country » tab.

tableau chi square test

What we observe is that the difference between Spain and France is very small, so it wouldn’t be interesting to do a Chi-square test between Spain and France. It’s more interesting to do a Chi-square test between Germany and France and to prove that there is a statistically significant difference between these 2 countries. This will be enough to conclude that the country has a statistically significant impact on the clients number who leave the bank.

Selects « Country Actual » tab.

tableau chi square test

We will use the online tool of the previous article, click here  .

We will make a copy of « Country Actual » to have a bar chart with absolute values. Select « Country Actual », right-click and select « Duplicate ».

tableau chi square test

In « Show Me », select « horizontal bars ».

tableau chi square test

tableau chi square test

Removes « SUM (Number of Records )» from « Columns » and removes « Exited » and « Geography » from « Rows ».

tableau chi square test

tableau chi square test

In « Dimensions », move « Geography » in « Columns ».

tableau chi square test

tableau chi square test

In « Measures », move « Number of Records » to « Rows ».

tableau chi square test

tableau chi square test

In « Measures », move « SUM(Number of Records) » in « Label ».

tableau chi square test

tableau chi square test

In « Dimensions », move « Exited » in « Label ».

tableau chi square test

tableau chi square test

In « Dimensions », move « Exited » in « Colors ».

tableau chi square test

tableau chi square test

We also need total absolute values, which means the total number of men and women. There is a very fast way to get that. Right-click on the vertical axis and select « Add Reference Line ».

tableau chi square test

Then in « Value », click on the drop-down on the right and select « Sum » to have the total sum of the observations.

tableau chi square test

And in « Scope », you select « Per Cell » option to specify that you want the total sums for each category, male and female.

tableau chi square test

Now, we have the total sum at the top of the bars. We will modify labels to have the absolute values. In « Label », we will change « Computation » to « Value » and click on the « OK » button.

tableau chi square test

tableau chi square test

tableau chi square test

Here’s how to enter the data :

For « Sample1 » in #success, you enter 810 because there are 810 people who left the bank. For « Sample1 » in #trials, you enter 5014 because there are 5014 people in total.

For « Sample2 » in #success, you enter 814 because there are 814 people who left the bank. For « Sample2 » in #trials, you enter 2509 because there are 2509 people in total.

tableau chi square test

Here is the verdict : « Sample2 is more successful ». « Sample2 » corresponds to German’s clients and #success is :« yes, the client left the bank ». This verdict means that of all the clients from German are more likely to leave the bank than clients from France. And look, there is something important, it’s « p<0.001 ». This means that the « p » is strictly less than 0.001. As you can see, « p » value is very small, which concludes that the tests are statistically significant.

Ooh, there’s another thing I wanted to show you with the tab « age » with the 2 bar charts in parallel.

tableau chi square test

As you can see, there are many categories (more than 5) because each category corresponds to a 5-year ago group with clients of the bank aged from 15 to 90 years old. This is a lot of comparison but it would be a good exercise for you to find what are the 2 categories to compare that shows that there is a significant statistic difference.

I give you a hint, compare slices from 50 to 54 years old or from 35 to 39 years olds. In fact, you should compare all peer categories where you observe difference on this basic A/B test. Do a basic A/B test with absolutes values. Then do a Chi-square test to check if the difference is statistically significant, I mean, if the result is valid for the total number of bank’s clients.

This is a way to statistically validate the insights we see onTableau. You see, it’s not very difficult and it’s effective. Here is a way to find insights on Tableau and validate them.

Subscribe to my newsletter and share this article if you think it can help someone you know. Thank you.

-Steph

Validate Data Mining In Tableau With A Chi-Square Test

validate validation

I have just enrolled in a Data Science course on Udemy  and I learned good stuff.

In this article we will start using statistics. Don’t worry we’ll do something simple, we’ll use the Chi-square test in a basic way. There is a special section to learn how to do statistics at an advanced level.

I’ll explain why we’re going to learn how to use the Chi-square test. The results we have with theses 2 bar charts are good. We see on theses 2 bar charts that age has a significant impact on the rate of client leaving the bank. We also see in which age groups the clients leaves the bank the most and which age groups the clients leave the bank the least. With that we have good insights.

In the A/B test « Gender », we can see that there is a correlation between the male and female sex and the choice to leave the bank. But as I said before, this A/B test is basic. The results of a basic A/B test visually shows us what is probably happenning in reality but we aren’t 100% sure of these results. To validate these results, we need do to use statistical tests like Chi-square test.

Doing a report based on basic A/B test is very risky and you can have completely false insights. I don’t advise you to do it (unless you want to leave your job). It’s for this reason that using Chi-square will help us to have strong insights.

Chi-square will allow us to know if our results are statistically significant. Our results are based on a sample of 10 000 clients and Chi-square test will tell us if these results are due to chance effects or if these results can represent all the client of the bank.

For example in our A/B test « Gender », we observed that in our sample of 10 000 clients, women are more likely to leave the bank compared to men.

tableau data mining science chi square test a/b test

Now, we aren’t sure if the results of this sample represent the behavior of all the bank’s clients.

To use basic Chi-square test, we use an online tool. Click here  .

tableau data mining science chi square test a/b test

On internet, there are plenty of websites to do a Chi-square test but we’ll use this one so that you can understand how it works. To do a Chi-square test, we need to use absolute values and in our A/B test we have percentage.

Let’s go back to Tableau. We’ll create a new tab with a version of A/B test with absolute values. In this way, we keep the A/B test with the percentages. Do a right-click on the « Gender » tab and select « Duplicate ».

tableau data mining science chi square test a/b test

Name the new tab « Gender Actual » to specify that it’s absolute values.

tableau data mining science chi square test a/b test

To have the absolute values, move « Number of Records » in « Measures » to the « Marks » area and put it over top of « SUM(Number of Records ».

tableau data mining science chi square test a/b test

tableau data mining science chi square test a/b test

Move « Number of Records » in « Measures » to « Rows » over « SUM(Number of Records ».

tableau data mining science chi square test a/b test

Cool, we have our absolute values.

tableau data mining science chi square test a/b test

We also need total absolute values, which means the total number of men and women. There is a very fast way to get that. Right-click on the vertical axis and select « Add Reference Line ».

tableau data mining science chi square test a/b test

Then in « Value », click on the drop-down on the right and select « Sum » to have the total sum of the observations.

tableau data mining science chi square test a/b test

And in « Scope », you select « Per Cell » option to specify that you want the total sums for each category, male and female.

tableau data mining science chi square test a/b test

Now, we have the total sum at the top of the bars. We will modify labels to have the absolute values. In « Label », we will change « Computation » to « Value » and click on the « OK » button.

tableau data mining science chi square test a/b test

tableau data mining science chi square test a/b test

Perfect, we have the total amount of observation at the top of each bar : 4543 women and 5457 men. We have what we need to use our online tool.

tableau data mining science chi square test a/b test

OK, I’ll explain how this tool works. « Sample1 » and « Sample2 » correspond to the independent variable « Gender ». You choose in which order you enter the data, « Sample1 » for men or the opposite. In our case, we use « Sample1 » for women and « Sample2 » for men.

« #success » corresponds to the result Y=1, which means in our case « yes, the client left the bank ».

« #trials » is the total number of observations, which means the total number of women in « Sample1 » and the total number of men « Sample2 ».

That’s how you enter the data :

  • For « Sample1 » in #success, you enter 1139 because there are 1139 women who left the bank. For « Sample1 » in #trials, you enter 4543 because there are 4543 women in total.

 

  • For « Sample2 » in #success, you enter 898 because there are 898 men who left the bank. For « Sample2 » in #trials, you enter 5457 because there are 5457 men in total.

tableau data mining science chi square test a/b test

Here is the verdict : « Sample1 is more successful ». « Sample1 » corresponds to women and #success is :« yes, the client left the bank ». This verdict means that of all the bank’s client, women are more likely to leave the bank than men. And look, there is something important, it’s « p<0.001 ». This means that the « p » is strictly less than 0.001.

tableau data mining science chi square test a/b test

« p » is the value that indicates whether an independent variable has a statistically significant effect on a dependent variable. In our case, the independent variable is « Gender » and the dependent variable is « Exited », which is : « yes, the client left the bank ». So « p » is strictly less than 0.001, which means that the independent variable « Gender » has a statistically significant effect on the dependent variable « Exited ». This shows us that out of the total number of bank’s clients, women are more likely to leave the bank than men.

This is how we use Chi-square test with this online tool. This is the same principle on all online tools that you can find on Google or DuckDuckGo . You can repeat these instructions that I gave you with other tools, you will get the same results.

It’s cool with the Chi-square we validated the A/B test and to specify that this A/B test is validated, we’ll color the tab in green.

Right-click on the tab, select « Color » and select « Green ».

tableau data mining science chi square test a/b test

tableau data mining science chi square test a/b test

Perfect, now we’ll validate another A/B test. Selects « HasCreditCard » tab.

tableau data mining science chi square test a/b test

We’re going to create an A/B test « HasCreditCard » only with absolute values. To save time, right-click on « Gender Actual » tab and select « Duplicate ».

tableau data mining science chi square test a/b test

We’ll remove the green color on the tab « Gender Actual (2) ». Right-click on the tab and select « Color » and « None ».

tableau data mining science chi square test a/b test

You rename the tab « HasCreditCard Actual ».

tableau data mining science chi square test a/b test

Move the variable « HasCrCard » over « Gender » in « Columns ».

tableau data mining science chi square test a/b test

tableau data mining science chi square test a/b test

Excellent, everything is ready to do a Chi-square test. We’ll remove « Exited » labels to better see the absolutes values. Make a click and drag out.

tableau data mining science chi square test a/b test

tableau data mining science chi square test a/b test

Perfect, let’s go back to our online tool. In this case, « Sample1 » is « no », which means client who don’t have credit card and « Sample2 » for « yes », which means clients who have a credit card.

That’s how you enter the data :

  • For « Sample1 » in #success, you enter 613 because there are 613 clients who left the bank. For « Sample1 » in #trials, you enter 2945 because there are 2945 clients who don’t have a credit card.
  • For « Sample2 » in #success, you enter 1424 because there are 1424 clients who left the bank. For « Sample2 » in #trials, you enter 7055 because there are 7055 clients who have a credit card.

tableau data mining science chi square test a/b test

Let’s look at the verdict, it’s « No significant difference ». « p » value is very high, it’s above 5%. This confirms that the independent variable « HasCrCard » has no statistically significant effect on the dependent variable « Exited ». That was the conclusion we had made when we had done the A/B test with percentages.

We had seen that there was 21% of « Exited » (clients who left the bank) in the category « no » and 20% in the category « yes ». With these results we concluded that most likely the variable « HasCrCard » had no impact on the rate of clients who left the bank. Chi-square test confirms our conclusion and we can put the tab « HasCrCard » in green to say that it’s OK.

Right-click on the tab « HasCreditCard » => « Color » => « Green ».

tableau data mining science chi square test a/b test

tableau data mining science chi square test a/b test

Excellent, now, you can do a statistical A/B test with 2 categories. Soon, we will do statistical A/B tests with more than 2 categories.

Share this article if you think it can help someone you know. Thank you.

-Steph

Create Bins and View Distributions

tableau, bins, bar, chart, distribution, age, data, science

I have just enrolled in a Data Science course on Udemy  and I learned good stuff.

It’s cool, you finished the 1st part. Now we’re going to do more deep Data Mining analysis with this bank’s dataset.

tableau, bins, bar, chart, distribution, age, data, science

To make these analyzes more deep, we’ll create a more statistical approach.

To do that we will create a new tab.

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

For this new tab, we want to understand how client distributed according to their age. Is there a majority of young or old people ?

tableau, bins, bar, chart, distribution, age, data, science

Move the variable « Age » in « Columns ».

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

As we want to see the distribution of client ages, we need to use the variable « Number of Records » to see the number of observations. Move the variable « Number of Record » to « Rows ».

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

Boom, we have a chart but there is only one point on the top right. What happened is that Tableau took the sum of the ages of all the bank’s clients and the sum of all the « Number of Records », it means the total number of clients, 10 000 clients.

We’ll find a solution but before we’ll change the format to better see the chart. Right-click in the middle of the chart and select « Format ».

tableau, bins, bar, chart, distribution, age, data, science

For the font’s size, select « 12 ».

tableau, bins, bar, chart, distribution, age, data, science

Here you can see that the total age is 39 218 but that’s not what we’re looking for. What we want to see is the number of clients for each age.

I’ll explain what’s going on. We took the aggregated sums of our variables. Aggregate means that we took the total sum of the variable for each category. We added the ages but in fact we want to see the total number of observations for each age separately.

To have that, just click on the arrow in « SUM(Age) » in « Columns ».

tableau, bins, bar, chart, distribution, age, data, science

Then select « Dimensions »

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

You see, Tableau doesn’t take the aggregated sum of ages but it takes ages separately. We have a curve that shows us the continuous distribution of our clients ages. That is to say, for each age, the curve gives is the number of clients of this age.

We’ll look at the dataset. Right-click on « Churn Modelling » and select « View Data… ».

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

There is window that appears that shows us the data in detail. If you scroll to the right, you will find the column « Age ».

tableau, bins, bar, chart, distribution, age, data, science

We see that the ages rounded. As all ages rounded, Tableau is able to group clients by age. By positioning the mouse on the curve, we can see that there are 200 clients who are 26 years old.

tableau, bins, bar, chart, distribution, age, data, science

If in the dataset, ages weren’t rounded, you would have seen clients with 26.5 or 26.3 years. It would create a lot of irregularity, there would be plenty of spikes with lots of variations.

Oooooh look, there is a variation that isn’t normal.

tableau, bins, bar, chart, distribution, age, data, science

Let’s analyze it in detail. Around this peak, we see that there are 348 clients who are 29 years old.

tableau, bins, bar, chart, distribution, age, data, science

Here, 404 clients who are 31 years old.

tableau, bins, bar, chart, distribution, age, data, science

And this peak down that shows us that there are 327 clients who are 30 years old.

tableau, bins, bar, chart, distribution, age, data, science

How to explain this irregularity ? It’s possible that many people of 29 years old are about to turn 30 years old and many people of 31 years old who just had 31 years old. It’s chance that make us have inaccuracies. You may have other inaccuracies if you data isn’t precise and rounded. In our case, the ages are rounded but we want to get rid of our small irregularity that we see on our curve.

There is way to see our distribution without our irregularities, it’s « bins ». « Bins » consists of grouping the information into different categories. That is we’re going to regroup our clients in different age groups.

Right-click on « Age » in « Measures ». Select « Create » and select « Bins… ».

tableau, bins, bar, chart, distribution, age, data, science

A window appears. We’ll group our clients in 5-years increments. In « Size of bins », write « 5 » and click on the « OK » button.

tableau, bins, bar, chart, distribution, age, data, science

As you can see, the variable « Age » has remained in « Measures » but there is a new variable in « Dimensions ».This is the variable we created « Age(bins) ».

tableau, bins, bar, chart, distribution, age, data, science

Our « Age(bins) » variable was correctly placed in « Dimensions » because it is a category variable because each category corresponds to a 5-year age group.

For example, one category is 20 to 24 age group. Now we’ll create a new distribution based on « bins ».

To do that, we’ll remove the variable « Age » from « Columns » with a click and drag outside.

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

You move the variable « Age(bins) » from « Dimensions » to « Columns ».

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

Note

In this case, it’s not possible to directly replace « Age » by « Age(bins) » over « Age » on « Columns ». This is because « Age » is a measure and « Age(bins) is a dimension.

That’s nice distribution, it’s usually the type of distribution (chart) we see in economics or mathematics. The difference with the old chart is that this chart is discrete. This chart is discrete because the clients grouped by age group while the previous chart was continuous.

On this distribution (chart), each bar corresponds to an age range. For example, this bar corresponds to the 25-29 age group.

tableau, bins, bar, chart, distribution, age, data, science

Now, we’ll change the colors.

In « Row », move « SUM(Number of Record) » while holding down the « Ctrl » or « Command » key on your keyboard to « Colors ».

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

We get our distribution in blue but we’ll change the color to red. Click on « Colors » and click on « Edit Colors »

tableau, bins, bar, chart, distribution, age, data, science

In the window that appears, click on the blue square on the right to display the color pallet.

tableau, bins, bar, chart, distribution, age, data, science

Select the red color and click on the « OK » button.

tableau, bins, bar, chart, distribution, age, data, science

Click on the « OK » button of the « Edit Colors » window.

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

To facilitate the reading of the bar chart, we’ll add the number of clients in each age group. In « Row », move « SUM (Number of Record) » while holding the « Ctrl » or « Command » key on your keyboard to « Label ».

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

That’s it, we can see how many clients there are in each age group.

We see that the dominant bar is the 35-39 age bracket and the second dominant bar is the 30-34 age bracket. Overall, we can see that most clients are between 25 and 40 years old, which seems consistent.

On our bar chart, we have absolute values. We’ll replace that with percentages. Click in the little arrow in « SUM(Number of Records) » in « Label » and you select « Add Table Calculation… » but I’ll show you another way to do it.

tableau, bins, bar, chart, distribution, age, data, science

Instead of clicking « Add Table Calculation… », click on « Quick Table Calculation » and select « Percent of total ».

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

It’s cool, we have the exact percentage of people in each age bracket. Now, we can see that in the 25 to 40 age group, we have 20 + 23 +17= 60% of clients.

I’ll show you one last thing.You can change the size of the slices easily, just click on « Age(bins) » and select « Edit ».

tableau, bins, bar, chart, distribution, age, data, science

In the windows, you can change the size of the slices (bins). Put « 10 » instead of « 5 » to get 10-years slices. Click on the « OK » button.

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

Now, we have a distibution with fewer slices and the dominant slice is 30 to 39 years old.

Well, it was just to show you how to change the size of bins. To go back to the old distribution with the 5-years slices, click on « Back » button.

tableau, bins, bar, chart, distribution, age, data, science

tableau, bins, bar, chart, distribution, age, data, science

As you can see, the values on bars are in percentages but the values on the axis are in absolutes values. Here is an exercise that I ask you to do : « Put the values of the axis in percentage ». I’ll give you the answer the next article.

Share this article if you think if can help someone you know.Thank you.

-Steph

Connect Tableau to An Excel File

tableau connect excel file geographic map

I have just enrolled in a Data Science course on Udemy  and I learned good stuff.

Now that you downloaded the dataset in Excel file format, we’ll use Tableau to analyze this.

We’ll connect to the dataset using the « Excel » option.

Now that you downloaded the dataset which is in Excel format, we will use Tableau to analyze this.

We will connect the the dataset using the « Excel » option.

tableau connect excel file geographic map

Select the dataset in Excel file you downloaded and click on the « Open » button.

tableau connect excel file geographic map

And as you can see, there is only one tab.

tableau connect excel file geographic map

There is only one tab because in the Excel file there is only one tab. If in the Excel file there were several tabs, they would all have been listed here.

tableau connect excel file geographic map

It’s necessary to check that all data is « OK ». Scroll the lines and columns to see that. Everything is good, there are 10 000 lines as in the Excel file.

tableau connect excel file geographic map

Excellent, we connected our Excel source file to Tableau.

Now, click on the « Sheet1 » tab to access the Worksheet.

tableau connect excel file geographic map

tableau connect excel file geographic map

We’ll have a little fun.

For example, let’s look at what we have with « Geography »

tableau connect excel file geographic map

« Geography » is the dimension that gives us the country, so we’ll make a map to see where the clients from the bank come from.

Move « Geography » on this area.

tableau connect excel file geographic map

tableau connect excel file geographic map

Ah, it’s odd, nothing happens ?!? Why ? Look, when you look at « Geography », it’s not recognized by Tableau as a geographic dimension. Here,, you can see that Tableau recognized « Geography » as a dimension of type text with the label « ABC »

tableau connect excel file geographic map

Don’t worry, we can fix it quickly. Click on the arrow of « Geography ».

tableau connect excel file geographic map

Selects « Geography Roles » and « Country Region » so that the « Geography » dimension become geography’s type.

tableau connect excel file geographic map

Now you remove « Geography » made a table with a click-and-drag.

tableau connect excel file geographic map

tableau connect excel file geographic map

Look, we have a globe next to « Geography ». This means that Tableau recognize that « Geography » is a geographic dimension.

tableau connect excel file geographic map

Since « Geography » is a dimension of geography type, there are 2 new measures that have appeared : Latitude (generated) and Longitude (generated).

tableau connect excel file geographic map

Put « Geography » in this space with a click and drag.

tableau connect excel file geographic map

Look, this time there is a map.

tableau connect excel file geographic map

You have the possibility of zooming with these buttons.

tableau connect excel file geographic map

The map is fine but we’ll remove the blue dots and modify the map so that it’s easier to read.

We’ll color the countries and display the clients number that has in each country.

We know that in the dataset each line corresponds to a client. What we can do is use the « number Of Record », it means the total of number of observations. In this way, we can visualize the number of lines attended to each country and the number of lines attended to each country is the number of client per country.

Then, take the « number Of Record » and move it to « Colors ».

tableau connect excel file geographic map

Boom ! Each country has a color.

tableau connect excel file geographic map

Look at the color contrasts. France has a darker color which indicates that it is the country with the most clients. Germany and Spain have almost the same colors which indicates that they have almost the same clients number.

But we want to know the clients number per country without have the cursor on the country.

To do this we’ll add a label. Take « number Of Record » and moves it to « Label ».

tableau connect excel file geographic map

tableau connect excel file geographic map

We’ll increase the text’s size and put in bold. Click on « Label », click on « Font » and select « 12 » and bold.

tableau connect excel file geographic map

It’s cool, we can see the clients number per country. You have the possibility to zoom on a region. Click on « Zoom area » and drag and drag to select the region on the map.

tableau connect excel file geographic map

tableau connect excel file geographic map

Now we can see that the majority of clients are in France, this represents almost half of the total clients number of the dataset. Germany and Spain have almost the same number of clients.

Share this article if you think it can help someone you know. Thank you.

-Steph

The Only Thing To Be Successful In the Long Term

 long term success

I read a Nerd Fitness article  and I learned good stuff.

Sir Winston Churchill said : « Success is the ability to go from one failure to another with no loss of enthusiasm ».

I’m sure you’ve heard this quote . But there’s something that nobody told you about that quote. This thing is the « GRIT ».

What’s this

definition

The meaning of the word « grit » is : « passion and perseverance for a long-term goal ».

We discovered after several years of case studies that intelligence wasn’t the most important element to have success in school, at work and in life.

The most important element to be successful is grit and personality. It’s essential to have the courage to go through all the challenges and failures to find a new solution to achieve the goal.

Psychology Professor at University Of Pennsylvania, Angela Duckworth shows in her studies that   :

« Smarter students actually had less grip that their peers who scored lower on an intelligence test. This finding suggests that, among the study participants – all students at an Ivy League School – people who are not as bring as their peers compensate by working harder and with more determination. And their effort pays off : The grittiest students – not the smartest ones – had the highest GPAs ».

And  :

« At the elite United States Military Academy, West Point, a cadet’s grit score was the best predictor of success in the rigorous summer training program known as « Beast Barracks ». Grit matter more than intelligence, leadership ability or physical fitness.

At the Scripps National Spelling Bee, the grittiest contestants were the most likely to advance to the finals – at least in part because they studied longer, not because they were smarter or were better spellers ».

These findings suggest that the achievement of difficult goals entails not only talent but also the sustained and focused application of talent over time.

There is also this article by Thomas Friedman in New York Times: Need a job ? Invent one .

In this article, there is a quote from Tony Wagner, Harvard Education Specialist : « Today, because knowledge is available on every Internet-connected device, what you know matters far less than what you can do with what you know ».

As you can see, it’s not the amount of information that is important to be successful but what you do with this information. It’s the same principle to have a healthy body. I know people who know a tremendous amount of information about how to lose weight and how to build muscle. But there is a problem, they’re all overweight and from year to year, they take on more weight and they need to take more medicines.

What is necessary is to use the information that you have every day. It’s useless to know all the answers and look for the perfect workout. Start with what you have now and day after day, you’ll improve your knowledge on the field.

How do I do

how much

Here is my case. As you already know, I plan my workout program throughout the year to gradually increase the difficulty (periodization). I have failures (very often) and I adjust. Every week I search for small changes and tactics.

Tracking my workout helps me tremendously to adjust the difficulty without creating any injury. I use an application on my smartphone to track my workout, it’s Jefit.

I know that all my life is going to be like that. Learn more, have more failures and find new tactics to progress.

It’s true that says it like that, you think it’s boring but it’s very motivating to see progress made week after week. Small details are important to your body. Often the people around you don’t see you making progress. They don’t see that your body is changing but you know you have more strength and better health.

What looked annoying is actually motivating. I like to see small changes on my body because I know that the accumulation of small changes make a great transformation. It’s the same principle as a video game, the main character is gradually becoming stronger and stronger.

When I look my workout’s tracking over several months or several years, I see that I have done great transformation. The amount of weight lifted has increased and my endurance has increased.

When I check my workout’program of the day, I stop to day to myself : « It’s going to be painful today, oh no ! » but « Mmmh, it’s going to have a little new record today ! ».

That is why I began to « document » the evolution of my body. If you watch my videos every day, you’ll not see any difference but when you watch the videos I made 6 months or 1 year ago, you see that the differences are really visible. And it’s the same for you.

Build the grit

grit

For several years I had several (one ton) failures and I searched to find small changes and new tactics to change my body little by little, week after week. I did all that to create « my new standard » and « my new identity » to have the best possible future in my life. All these small improvements on my body have developing more grit and perseverance.

Here is how to build your grit yourself :

  1. Determine your new « identity ».

    The more specific your new identity, the easier it will be to prove it to yourself. For example : « I’m the type of person who never miss a workout » and « I’m the type of person who always eats a healthy meal at lunch » and/or « I’m the type of person who works on his own business as soon as I have free time ».

    To always have these identities in mind put post-it in several places in your house like on the calendar, the phone and the mirror of your bathroom. You can also have it in the wallpaper (lock screen) on your smartphone.

  2. Have small victories every day to prove it to yourself and motivate you to do that

    Follow your evolution and highlight your small victories to see that you are in the right direction. Make a daily challenge that takes you between 5 and 15 minutes. Once this challenge is successful, it’s a small victory in addition.

  3. Increases the difficulty of your challenges every 30 days

    For a month, for 30 days, you’ll have small victories. Once you have 30 small victories, make a party to celebrate these victories and increase the difficulty of your challenges for the next 30 days.

    Attention, our will’s strength is limited so use all this will to build this new healthy habit.

  4. When you have created you « new standard », it’s time to improve it.

    Improve your « new standard » by making small adjustments. Make slow and steady progress to win. If you make drastic adjustments, you will have more failures than small victories and this will make you want to give up.

  5. When you fail in something , be sure to fail differently next time

    Failure doesn’t mean that you have a bad or a weak personality. It’s just mean that you didn’t have all the knowledge and experience to succeed. Learn and practice more on the field to continue towards the best.

It’s not important where you’re from, where you’re going that’s important.

I warn you already that this a path with more that 1 billion challenges but it’s the price to pay for a better lifestyle. To achieve the lifestyle of your dreams , you will create 1 billion versions of yourself, all better than the previous ones (it’s like an update).

The most important thing is that you shouldn’t let anyone tell you that you can’t accomplish anything in you life (this also includes you parents).

If you know you can do it, do it !

What is the little victory you have recently made, and what the next ?

Share this article if you think it can help someone you know. Thank you.

-Steph

Bench Press And Morphology

bench press morphology

I read a Frederic Delavier’s book « Strength Training Anatomy » and I learned good stuff.

I think you’ve noticed that the bench press is the most practiced exercise in a gym. And as this is the most practiced exercise, it’s also the exercise that create the most injury per year. This is why, it’s important to have basic morphology’s notions to be able to do this exercise correctly.

Arms length

bench press morphology

The majority of injuries with the bench press are muscle tears or rupture of the pectoralis major tendon (during the descent of the barbell).

The pectoralis major inserted on the humerus. As a result, during the descent of the barbell, more the arm go down and more the pectoralis major is stretched and vulnerable.

But the descent of the arm and the stretching of the pectoralis major vary from one individual to another. More the arm is long, more the humerus will go down, which causes the pectoralis major to be stretched. It’s for this reason that willowy people (a person with long body members) often have this type of injury.

Rib cage thickness

bench press morphology

More rib cage is thick and less the barbell can go down. This means a limited strech of the pectoralis major therefore less risk of injury.

It’s for this reason that the majority of great bench press champions are brevilineal type (a person with short body’s members). Having a thick rib cage and short members allow to achieve a record with a morphological safety that limits the risk of muscle tearing or rupture of pectoralis major.

Morphology has a fundamental place in sport success and it’s injuries that limit the progression. Sport progression isn’t only based on mental (mindset), diet and workout type.

It’s fundamental to adjust the training program with the morphology. Let couple things be clear : what’s good for the person next to you, is not automatically good for you.

Limit the injury risk

bench press morphology

There is a bench press variant and it’s close-grip bench press. This variant limits the arm’s descent and this reduces the pectoralis major’s stretch thus limits the injuries risks.

This variant used by bench press champions with willowy type but the disadvantages are reduced performances, triceps work more and the movement’s amplitude is more important.

There is also another variant, the partial bench press. The concept is to decrease the barbell’s descent for it doesn’t touch the chest. This avoids excessive pectoralis major’s stretching.

Muscle predominance

Depending on the muscular strength of a person, there are 2 ways to do bench press :

  • Elbows spread to make more work the pectoralis major

  • Elbows close (to close arm/chest angle) to make more work deltoids.

Regardless morphology, these techniques can be used to specifically target a muscle (elbows spread => pectoralis major or elbows close => deltoids).

Attention : for bench press, it’s necessary to adjust the technique according to the different morphologies

bench press morphology

Image A

A thin rib cage with long arms when the barbell approaches the chest during the descent dangerously stretch the pectoralis major. The risk of muscle tears or tendon rupture are increased with the weight on the barbell.

Image B

A thick rib cage with short arms when the barbell approaches the chest during the descent limits the movement’s amplitude and the pectorlis major’s stretching. It’s for this reason that there are many bench press champons with this morphology.

Share this article if you think it can help someone you know. Thank you.

-Steph

What Is Motivation

I read a Nerd Fitness article  and there is good stuff.

A guy named Roger Bannister in 1964, Oxford, England, did something impossible. He ran 1.6km (1 mile) in 3 minutes and 59 seconds. While 9 years, the world record was 4 minutes and 01 secondes. 3 years after Roger Bannister’s record, 13 persons ran 1.6km (1 mile) in less than 4 minutes.

It’s like the Tony Hawk’s record with the 900° on a half-pipe. Since 9 persons did it .

How is possible than suddenly abilities improves ? It’s because of equipment or we impose ourselves limits ?

Brain VS muscle

The truth is that you’re physically able to go beyond the limites that your brain tells you.

Look, in 2012, a group of trained cyclists did a 4k timed trial as fast as possible. Their guideline was « Use all efforts ».

They did this trial again with a virtual avatar who had the same speed than them at the first trial. The average speed of all cyclists was 1 % better than the first trial. Remember at the first trial, cyclists were in mode « Use all efforts ».

They did this trial a third time with a virtual avatar again. Cyclists didn’t know that the virtual avatar was a little bit faster than them. Again, cyclists beat the virtual avatar by increasing their performance of 1.7 %.

It’s like to play to Mario Kart and do a race against the ghost of your last performance. You know exactly how to increase the speed and you have a visual cue.

For more information, read the Mark McClusky’s « Faster, Higher, Stronger » about limitations, fatigue, emotions and what our bodies are capable of doing.

Tim Noakes, South Africa professor of exercices and sport science at the University of Cape Town, make the hypothesis that it’s not our body that slow down but our brain who control WHY and HOW our body slow down.

« Fatigue is an emotion, a construct in the mind that helps ensure that exercise is performed within the body’s ability. That emotion is affected by many factors, such as motivation, anger, fear, memories of past performance, self-belief, and what the body is telling the brain….our physical performance is regulated by the brain, not limited by our hearts, lungs, or muscles ».

We’re able to do more than we think. Cyclists always beat the virtual avatar who was faster than them.

How

Read a funny quote on Imgur :

« Better to cultivate discipline than to rely on motivation. force yourself to do things. force yourself to get up out of bed and practice. Force yourself to work. Motivation is fleeting and it’s easy to rely on because it requires no concentrated effort to get. Motivation comes to you, and you don’t have to chase after it.

Discipline is reliable, motivation is fleeting. The question isn’t how to keep yourself motivated. It’s how to train yourself to work without it ».

If you want to be motivated to train, stop it and stop crying. It’s better to build a system that isn’t relied on motivation. Create a system like the cyclists virtual avatar, create an avatar of your last week performances. Don’t be relied on inspiration but build a system for success, a system that improve your abilities each week.

Sometimes, we need people to push us, challenge us to do things we don’t want to do to go to the next level.

Surround yourself with people better than you in your activites. More you do activities with people who have more experience than you, more you become better.

And sometimes, you need a technological assistance to buid these habits :

  • Self-Control to block time-wasting website on our computer

  • Rescue time to track our efficiency

  • Alarm clocks across the room

Did you see ? No ones of these exemples are relied on a motivation, will or be better than someone else. It’s external forces that we use to exceed our limits.

Outworked

Imagine what you can accomplish if failure isn’t an option. McClusky make a theory in his book « the winner is the athlete for whom defeat is the least acceptable rationalization ». So people who want to do everything to achieve their goals almost always accomplish theirs goals.

Watch this Will Smith’s video .

« The only thing that I see that is distinctly different about me is I’m not afraid to die on a treadmill. I will not be out-worked, period. You might have more talent than me, you might be smarter than me, you might be sexier than me, you might be all of those things you got it on me in nine categories.

But if we get on the treadmill together, there’s two things: You’re getting off first, or I’m going to die. It’s really that simple, right ? »

This is why Will Smith is one of the most successful actors.

Of times in our quest when we don’t make sacrifice to succeed, we fall into the belief that accomplishing our goal isn’t possible.

In fact, this rationalisation may appear to several people event before trying !

Instead of rebuking yourself when you aren’t motivated to do exercice or that you struggle to eat healthy, take a step back and look it with a different angle :

  • « how can you build a habit of success and be focus on rather than seeking a motivation to realize it ? »

It’s easy to become ensnared (to chase motivation and fail) or to rationalize inaction and never try. We all fell into the trap.

What is you plan to avoid this trap ?

-Steph

P.S. Do you want a free training program ? Click here