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

Challenge Your Intelligence

brain scan

I watched an Olivier Roland’s video  and I learned good stuff :

Have you ever heard that : « If you’re smart and you’re always surrounded by idiots, you’ll always be right ».

Sincerely, there is a deep truth in it. This corresponds to this quote « If you’re the smartest person in the room, you’re in the wrong room ». We are human beings and it’s easy to follow your ego. It’s easy to stay in an environment where we’re always right because subconsciously we want to be around people who adulate us or put us on a pedestal.

When we look around, we see people who are successful and who stay in a bubble where they’re surrounded themselves with people who will always agree with them. It’s in our human nature not to like the contradiction of what we are and the values we defend. All of this is logical, we have success, we developed values and a life approach that we tested in the field and we don’t know others ways.

It doesn’t mean that in any case it works and that doesn’t mean that there are not other ways to succeed.

A group of intelligent people

 

mastermind group

When was the last time you were in a room where you felt that you weren’t the smartest person in the room and that you learned new things ?

What is interesting when yo participate in a mastermind group is that you’re surrounded by brilliant people who don’t hesitate to say when there are obvious things in you and you don’t see them. It allows you to change your point of view and forces you to face your own limiting beliefs.

Often during a mastermind group, there is a « hot seat ». A « hot seat » is when you share a specific problem and a specific question to the group. What is surprising is that we always see the same pattern that repeats itself. There is a person who shares a problem and a question and we see a lot of obvious things about the limiting beliefs of this person, how much that person has locked himself/herself into a part of the problem. From the outside, we see that there are other ways to attack the problem and we also see obvious solutions.

What’s interesting is that it seems extremely obvious for a person who is in the group to help find the solution but when you share your problem and your question, the group offers you things that you have never seen by yourself.

We all need a moment to take out our trash. We all need to share with a group what doesn’t work and what problems we have. Whenever we do that, we realize that we all have blind spots. Things that seem obvious to everyone but seem hard to see. It’s like seeing the flaws of another person but we don’t see ourselves our flaws.

Here’s an example, I’m ticklish. I can try to tickle myself, I can’t laugh but if someone else tickles me, I laugh immediately.

I can’t be at the window and see me walking in the street at the same time. So if you’re an entrepreneur and you feel isolated, break this situation. Go to events, try to meet other entrepreneurs because it will help you a lot.

You can’t know how many mistakes you make each day without realizing it. Only someone else can show you, your mistakes if you allow him/her to do so in a caring way. It’s not a matter of showing mistakes by accusing but in a kindly way to help you move forward. If you can participate in a mastermind group to be in a collective spirit of brilliant people, do it. It’s a great place to no longer be the smartest person in the room and learn new things to improve yourself.

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

-Steph

A Rare Habit To Have To Be Successful

curious question

I watched an Olivier Roland’s video  and I learned good stuff.

The most successful entrepreneurs are those who are the most curious. It has an extremely simple habit that the majority of the population doesn’t have. This habit is to ask questions but be careful, they’re use 2 way to ask questions :

  • By curiosity to try to understand the history, the motivation and the methods of a person or a company.

  • To question things that everyone agrees with. Are these things that everyone takes for granted true or not ?

It may be trivial, but how many people have met athletes, entrepreneurs or others great people who have just said : « Wow, that’s amazing what you did ». Then they could ask : « What motivated you to do that ? » or « Do you have a piece of advice that helped you on your journey ? » or « Do you make a stupid mistake that will stop you ? ».

When you ask questions about things that everyone takes for granted, you can sometimes find gold mines. What I means is that there are things that many people think is true when it’s wrong because they didn’t verify the information. So, this may be a gold mine that can make you rich at all levels.

It happens because we, human beings, have an imperfect representations of how reality works. That is, we’re like prehistoric explorers with rudimentary maps. The closer your mental map is to how the universe really works, the more likely you’re to do relevant actions, so to be more successful in your life in all areas of spiritual wealth (being happy, living long, create value, etc) and material wealth.

Ask to understand

ask listen learn

For example, Erico Rocha ( ooh, read this article ) is a Brazilian entrepreneur who has an incredible success in the information field in Brazil and he’s someone very curious. When you tell him one thing, he’ll understand that you have implicitly accepted that as a truth and he’ll question you on it.

You can do that too, and that opens doors that you never imagined.

Here is a concrete example. Many people think that handwork things are better than industrial things. This is a truth that most people have accepted without verified the information and this will influence their thoughts, decisions and words. Now let’s ask ourselves : « Is something handwork automatically better than an industrial thing ? ».

It’s true that there are some handwork things that are better than industrial things, but is a handwork book better than an industrial book ? We can ask the same question for a car, is a handwork car better than a industrial car ?

Analyze around you people who think that handwork things are automatically better than industrial things. Be careful, these people aren’t going tell you that explicitly. They’re just going to say things like : « Did you see ? I bought this wooden spoon, it’s pretty, huh ?!? It’s a handwork thing ». In this case, you can ask the question : « For you, are handwork things better than industrial things ? » With that you can analyze the way of thinking of this person on this subject.

With this habit, you’ll change your state of mind. This habit of asking such questions allows you to find those unconscious acceptances that influence our thoughts, actions and words. When you use that, it gives you a lot of advantage in life to be successful compared to people who don’t understand that.

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

-Steph

The Trick To Have A Prodigious Result

results

I watched an Olivier Roland’s video  and I learned good stuff.

This trick is one of the fundamental principles for success. If you want an exceptional result, you need to have an exceptional behavior.

Having an exceptional behavior means have a different behavior from the majority of people. Think about it, if you do the same thing as the others, you will have the same results as the others, it’s simple and logical.

Look at this example. Imagine that you’re doing karate and you want to become world champion :

Here are 2 choices :

  1. You’re looking for a teacher who has already been world champion and you use a technique that is different from others.

  2. You learn karate with people doing karate for fun. These people don’t have the ambition to become world champion.

Another example. Imagine that you want to have financial independence and that in your environment, there is no one who has financial independence.

Here are 2 choices :

  1. You’re looking for a person (on internet) who is financially independent and you use a technique different from the others.

  2. You listen to advice of people around you who don’t have financial independence.

We agree. In both cases, you’re more likely to succeed by looking for people who have already accomplished your goal. It’s interesting to see that the majority of people (my parents, for example) criticize people who are successful, but that shouldn’t stop you from listening to and using the techniques of people who are successful.

My opinion on

opinion

I think you noticed but everyone has an opinion on everything. Even a person who doesn’t know anything about a subject, likes to give his/her opinion. Is it in human nature ? I don’t know but to be successful, you need to learn how to sort out the good advice that will help you to reach your goal and the bad advice that will slow you down or block you.

I’m not going to lie to you, when you start, it’s really hard to sort out the good and bad advice. To get the best of luck from the start, I advise you to listen to people who have already accomplished your goal and not others.

Skepticism

skepticism

There is a method that is cool, it’s good skepticism. You’ll see, it’s easier to understand the difference between good and bad skepticism than a good and bad hunter.

Bad skepticism

Bad skepticism is when you see something that is too good to be true and you say : «  Pfff, it’ a scam » or « No, it’s not for me » and you’re not going to do anything.

Good skepticism

Good skepticism is as astonished as the bad skeptic, but he/she wonders : « Is it going to work with me ? ». Good skeptic thinks like that because he/she knows that the only way to know if it’s true is to test it yourself. He/She tests it by doing a simple experiment to see if it’s true or if it’s a scam.

I know we can’t absolutely test everything because sometimes we don’t have the time or the material but, it’s this concept that I share with you. When you have a project that you like, see if you can test different techniques or methods. Test different techniques or methods that have the potential to give you a lot of result with simple experiences.

With this article I want to motivate you to connect with people who already accomplished your goal. With theses people, you can advance your project faster by avoiding making fatal mistakes. It’s true that it’s easier to connect with people around you but you may stagnate. Be persistent and patient to connect with people who have already reached your goal and who are still progressing.

It’s extremely motivating to be surrounded by people who are always progressing.

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

-Steph

Be Really Constant

constant

I watched an Oliver Roland’s video  and I learned good stuff.

Sometimes I subscribe to a blog or a Youtube’s channel because I find the content is interesting and bring me value. But, I don’t know why, the creator of the blog or the Youtube’s channel publishes content once a month. It’s frustrating because this creator has a talent but he’s not constant.

Being constant means doing something regularly. More precisely, it’s to do something that works regularly.

What I’ve noticed with people who have a website and use social media to promote their website is that they find something that works, that attract trafic and that’s all. They do this think that works once and they’re happy.

That is not how theses people are going to be successful over the long term. When you find something that works and attract trafic to your website, you have to do it several times. You need to be an expert in this thing that works to perfect it and use it frequently

It’s not a stroke of luck

dice role playing game

For example, you do a fighting sport. During a fight, you find a technique that works. What do you think : « Wow this technique worked, but I’m going to stop using it. I will not use this technique all my life » or « Wow, this technique worked. I will use it in each fight and perfect it to win the most fight possible all my life » ?

I think you’re like me, you want to win the most fight possible all your life but we’re a lot not to do that. I reassure you, before I was like that. When I found something that worked, everybody said : « Bravo » but in my heart I felt it was a stroke of luck and I couldn’t do it again. It was a huge mistake.

There is a really cool tool to see the number of views and subscribers of some social media (Youtube, Twitch, Instagram, Twitter). If you want to do analyzes, social blade  is interesting for that.

Case study

case study

I’ll take the example of Olivier Roland’s Youtube channel. Olivier Roland have a little more than 136,000 subscribers. When he publish a video, he has around 5 %-10 % views compared to his subscribers number (6,800 views-13,600 views).

There are many Youtubers who have more subscribers than Olivier Roland. And when they publish a video, there are 50 %-100 % view compared to their subscribers number. Beware, there 50 %-100 % views weren’t only made by subscribers. Generally on Youtube there are 40 % of views that were by subscribers.

You know that there are Youtubers with more subscribers than Olivier Roland and they make more views than Olivier Roland each time they publish a video. And these Youtubers make fewer views per month than Olivier Roland. Olivier Roland has about 450,000 views – 500,000 views.

There are Youtubers who have 150,000 – 200,000 subscribers and who easily have 50,000 views – 100,000 views when they publish a video but they have 100,000 views – 200,000 views per month. When you look at the monthly figure, you see that it makes about 1/4 of the Olivier Roland’s views.

Do also research with social blade , you’ll have surprises (that is why, now, I learn data science). Why are these monthly figures low ? This is because they don’t make enough videos and they’re not constant. Making a video per month is not enough.

Making a video per month is very bad for trafficking, it’s bad for the community (audience/subscribers). It’s impossible to retain someone and it diminishes the ability to reach more people. The result is that these Youtubers have fewer view of what they might have, It’s a spoiled talent.

All make sense. When there is little content, there is less to watch, less to share and less to critize.

Be regular

regular

Because there is not enough content, the audience (the community) is frustrated and loses interest and confidence in these Youtubers.

Attention, Youtube is just an example. It’s necessary to be constant in all fields. Being constant create something strong and powerful. Olivier Roland published more than 1000 videos and he was able to do this by being constant.

Being constant to create content regularly creates options to explore new topics for the creator. This create a habit or respect to a pat of the audience. And most importantly, create content regularly, create possibilities to be known, to be shared, to be discussed and to have a better impact in the lives of people.

Quantity VS Quality

quantity quality

Do videos published per day have the same quality as weekly video ? Honestly, it’s not possible. But when you have 7 times more videos in you Youtube channel, it has tremendously more strength and values than some 4K videos.

Sometimes a 4K video can have more impact than 10,000 video in average quality, but it’s just « one shot » as won at the Lotto. And you know that the majority of people who win the Lotto are ruined a few years later.

What about you

what about you morpheus

Yeah, what about you ? I mean, what are you doing in your life that works ? Could you do this more often so that it brings more value to yourself and to the world ?

For exemple, imagine that you like to write and you write 200 words once a week to create your book. Could you increase that to 400 words or write twice a week or write 400 words twice a week ?

Another example, you do sport once a week and it really good for you. Could you increase it twice a week ?

In the comments, I would like you to answer this question : « If you put in place a plan for you to do something that works consistently and regularly, what can it bring as happiness or as value in your life ?

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

-Steph

The Key To Have Success

key of success

I watched an Olivier Roland’s video  and I learned good stuff.

The key of success in any field is something everyone is looking for. I’ve been looking for this and I think you too.

There is a quote to find the key. It’s a quote from Sir William Olser , the father of modern medicine Here is his quote : «  The very first step towards success in any occupation is to become interested in it ».

I think you had the same reaction as me when you read the quote : « Yes, it’s obvious ». Yet if Sir William Olser said that, it was because he noticed that people around him didn’t follow this principle.

Be interested in

be interested in

Now look around you. I’m sure that in your friends group, there are people who want to earn more money or be rich ? Are these people really interested in knowing how to earn more money effectively ? In my case, I am the only one.

Oh another thing. I’m sure that in your friends group, there are people who want to be happy ? Are these people really interested in knowing how to be happy effectively ? In my case I am the one.

In my friends group, there are people who want to be happy and rich but that’s just words. And when I tell them what I found they, often, tell me they already knew that. So I ask them : «  What do you know about that ? But why you don’t do it ? ». I don’t explain you the answer, you already know that.

The truth is, if people don’t do something, it’s because they’re not really interested in that . Everyone has different goals.

Long-term investment

long-tern investment

To be really interested, it’s to ask yourself questions, to look for information, to meet people who have reached the goal, to read books that will help you reach the goal, to meet people who have not yet reached the goal but which are in the same movements as you, etc.

Here’s the question I ask you. This question is the first step to your success : « What do you want to accomplish in your life and are you interested enough in it to succeed ? ».

For exemple, if you want to become a successful author, you need to learn. You need to learn and practice regularly and for a long time. You need to read books where successful authors share their advice. You need to follow trainings with successful authors. You need to be part of a group of authors on Facebook, etc. With internet, there is so much resource that you have no excuses. Success is a long-term investment.

Take a few hours on a quiet weekend to really think about what you want to accomplish in your life. Very often, these are things your parents don’t like but if you’re really interested you’ll prove them wrong with your success. Don’t forget, success is a long-term investment.

I have a friend in prison and the last time I saw him, he said to me : «  You know Stephane, the best revenge in life is success ».

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

-Steph

Being An Entrepreneur Is Being A Student

entrepreneur student entrepreneurship

I watched an Olivier Roland’s video  and I learned good stuff.

I see a lot of entrepreneurs make this mistake. They create their companies based only on their technical skills. A good baker who create his/her own company is a excellent start but we must not forget the second part of the equation. When you create a company, you need to learn a second job, entrepreneur (CEO and manager).

Technical skills aren’t the same as the entrepreneur’s skills. A person can be very good technically in his/her job and bad as an entrepreneur. It’s important to spend time learning entreprenarial skills needed to avoid bankruptcy.

To be seriously trained as an entrepreneur is important. I think in your country there are mandatory training course for business start-up. Unfortunately, these courses last only a few days and it’s not enough.

It’s true that it’s complicated because there are no good academic trainings on entrepreneurship. By example successful business rate created by business school students is about 10 %.

Books

book

I think it’s possible to train ourselves at the core of entrepreunarial skills with books. The Personal MBA’s list  is a good start.

Did you see, the list is long. I advise to read these 3 books to start more easily.

« The 4 Hours Workweek » is a way of seeing entrepreneurship in another way. This book breaks the codes and allows you to have a more open mind to have more opportunity.

The Personal MBA is a summary of the essentials of what you need to know to build your company. The book is excellent but the problem is that it lacks coherence, which makes is a bit difficult to imagine how to use these concepts in your company. But don’t worry because with this book you’ll have the theoretical knowledge that 90 % of entrepreneur don’t have.

« The Ultimate Sales Machine » explains how to set up an effective system for sale in your company.

With books, you can have acces to the best brains for cheap, it’s cool.

Meet others entrepreneurs

meet people

To create opportunities for you, I advise you to meet creation of company’s organizations in your city.

The ideal is to make a combination of books, training (online and offline) and meet entrepreneurs. It’s a mix of theory and execution. You know, you can have all the theory of the world, if you don’t act, you will not able to change things. This is why that it’s motivating to meet entrepreneurs, precisely entrepreneurs who are more successful than you so that you can always remain motivated despite obstacles.

It’s like in sport, all athletes want to become world champion or Olympic champion. Having this state of mind in entrepreneurship is excellent. I hope you want to become the best in your market.

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

-Steph