Andrew Kosal from Valor Accounting Services. Andrew, how are you today? I am very well. How are you doing, Leo? Very well, Andrew, very well. How is the UK? How's London treating you? Yeah, not bad. I'd love to say it's sunny right now, but that would be a lie. Why is it whenever we mention London, the weather has to play a part in the conversation? I know, I know, I know. How about over there? Is this funny? Over there, it's beautiful. As you can see in my background, fantastic. Andrew, well, thanks for jumping on. Looking forward to our chat today. So today we're going to be talking about financial stability with your coaching business. I'm going to let you introduce what we're going to be talking about, but definitely looking forward to this conversation because this is something that we work with coaches on a regular basis, how to make their business more financially stable. So over to you, Andrew. Nice one. All right, thanks, Leo. Yeah, so I guess a lot of these concepts we've touched over the previous podcast, but we're now bringing it all together. So we're going to just start talking about the basics of it and then moving over to a bit more of the taking a bit of an outside perspective, looking into the business. So the first one is kind of fundamentals of having a financially stable sports business. And that is having a good record keeping system. What do I mean by that? So I mean ensuring that you in capture all your business transactions, whether it be on the bank cash transactions, you want to have a place where you have all of that and you can categorize them correctly as well. What do I mean by categorize them correctly? So when we look further on in terms of how the business is performing, we want to know that if you buy sports equipment and you incorrectly categorize that as advertising marketing, for example, then when you actually look at your numbers, you're going to see that there might be an overinflated advertising marketing spend.  Where actually nothing to do with that. You've just incorrectly categorized that as advertising, whereas it should have actually been in the sports equipment category. So that's one really important point is and in the accounting world, what we say is you put rubbish in, you get rubbish out. And that goes with transactions categorizing correctly. So you know that the information you're looking at is correct. It's accurate and can actually give you a good insight into how your business is doing. Does that make sense? That makes perfect sense. So question is, does this come down to good having a good accountant or does it come down to being organized with your business as a coach? Yeah, I think I think it's both really. If you're organized as a, you know, owner of your business, then you're going to have to have a good record keeping system, regardless. Now, it's not to say that you can do it, especially at the start, do it yourself and ensure that it's correct. You may not have any bookkeeping experience. So, you know, there is a slight risk there. But definitely having someone that actually knows what the correct categorization is definitely helps later on when you start looking at your figures. So I think it's a bit of both really. OK, perfect. OK, next one is turnover and profit. So what is the difference? So you may have a sports business where it's turnover just means all the income coming in, whatever the business is generating the money, and you may have a high turnover business. But that doesn't really give you the whole picture because what do your expenses look like? You know, do you have large expenses in terms of hiring staff, travel expenses? You know, as you spoke before, advertising, what is it? That then gives you a profit figure when you take into account what expenses you have. So that's something that business owners have to understand is having a high turnover business doesn't mean that you're a financially stable business, right? You've got to look at the profit and even then the profit doesn't tell you the whole story. And that's where we come on to cash flow to stop you there. I really like what you just said, because I had a conversation with a coach last week and he has a lot of turnover in his business because the way he operates his business is pretty much he doesn't his model is not getting clients committed long term. It's more just eight weeks of training and then if they want to continue, they continue. And if not, it just brings in new new clients. And you made a really good point because something he struggles with is not just turnover of clients, but also turnover of coaches as well, right? He's losing coaches constantly and you made a really good point because turnover doesn't necessarily mean you are a stable, stably financial business. So something we do in our company, we teach coaches how to make clients more committed. So essentially, you're getting what we're going to talk about now, cash flow every month so that that makes you a little bit more financially stable rather than clients coming in, clients coming out. Yeah, yeah, that's a great point as well. And it does really flow into what we're talking about now is the cash flow. It's essentially money coming in, money coming out, but there's a bit more to it. So, for example, if you have a large number of clients and there may be, as you know, there's different ways that it can be done. It could be a block book as you said, as you said, it could be a monthly recurring income. It could be one offs as well. On the profit statement, it actually says that that money has been received because you've invoiced the client. Now, depending on your payment terms, it might be up front payment. It might be at the end of the month. It might be at the end of the season. But from a profit point of view, you've received that money, but have you received it? No, you haven't. And this is where cash flow comes in because it does take into account money coming in, money coming out. Another thing as well is if you purchase equipment, it's not going to appear on the profit and loss statement. So if you buy, let's say, a company van where you're going to put your sports equipment in, if you're traveling to different sports facilities, then that purchase that you made of the company van is not actually going to appear on the profit and loss because it's actually an investment. It's going to appear on the balance sheet now without going too technical. But if someone looking at their profit, they're going to be like, oh, I've had a good month, but they've purchased a van. It's not going to appear in the profit and loss. Another thing as well is what sort of purchases does the business have? If it's sports facility rental, for example, or if you're hiring out a hall or a pitch, for example, when do you actually pay for that? And that depends on the agreed terms with the owner of the facility. So it could be at the start of the term, at the end of the term, or during. From a profit point of view, profit and loss point of view, once they've invoiced you, they can invoice you straight away, but you don't have to pay that until one month, two months down the line. So what cash flow does, it really does show what the money coming in and money coming out is. And another thing as well is, and we could obviously, there could be a separate podcast on this. But actually, I want to go into a revenue model because that's something that you touched on as well is, what sort of revenue model does your business look like? Do you have a mixture of a one-off, do you have block bookings? Is it, and we're going to touch on that as well, is it seasonal? Are you going to have certain periods in the year where there's going to be an influx of clients and then quiet time, quiet periods? How does that look like in your business finances? And then we're going to look at emergency funds. So emergency fund is essentially having enough cash for like a rainy day, you know? That's obviously very important. I thought I'd just include that to be a bit more comprehensive. But yeah, that's pretty much cash flow in a nutshell. Essentially like a kind of saving, say business savings. Correct. That's the one. Yeah. So yeah. And then, you know, we're looking into expenses. You know, that's another side of cash flow really. And it's very, very important as well for your financial stability, because if you've got a high turnover business, but it's it's it's leaking profits because you're having expenses where maybe when you started out in your business, you incurred those expenses and you kept them and you've not actually had a look and seen, oh, do I actually need this type of expense? You know, do I need this monthly subscription? Right. Or can I, if I have a subscription that I do need, for example, can I pay a yearly subscription and save? Now, that depends on whether you've got enough cash reserves to do that. Yeah. You know, are there any alternatives? Is there something that an expensive alternative where, for example, if you're renting out a hall, can you rent a hall which is cheaper, maybe closer to you and you could save on that as well? So it's really identifying these opportunities where you can lower your expenses because that ultimately means more cash for the business. Yeah, like that. Also, another example with coaches that we work with or I talk to as well is a lot of them go to their clients. Now, what they don't realise is that they lose money when they do go to them through not just time, but also, you know, petrol, gas, wear and tear of the vehicle. So all of those things that you've got to take into account as well. So that's why what we like to do is we like to have coaches have a base where clients are coming to them. So they save time, ever money rather than go in different places to go and train train players. Yeah, that's a really, really good point, because essentially, as you mentioned, that time saved could mean extra extra revenue where you could be coaching at your base.  Yeah, 100 percent. And yeah, and and another thing as well is, you know, diversifying your incomes. We have mentioned this before, but I just thought I'd touch on it again is, you know, what are the ways you can provide products and services? You know, can you do online coaching? You know, can you is there a way can you sell merchandise? Is that something that might be helpful to to your clients as well? And, you know, that that's definitely something that can be and that obviously could be a separate podcast in itself. But that is definitely something that is an untapped opportunity for sports coaches. And also, it allows and we spoke to this before, but in the seasonality podcast is your business becomes more resilient as well, because as we spoke, if you if you're relying on certain income streams, you know, if you're going to a sports hall and for whatever reason, there is something that happens where it's not operational. You've got to let not only got to let down your your clients, but your business is taking a hit now. You know, I mean, so they could be other ways where you could deliver services and it doesn't impact your business as much.  And we mentioned seasonality as well, identifying because seasonality doesn't mean it's a bad thing. But if you can plan for it, that's great. For example, during the on seasons. Mention that any marketing has been maximised before that time. Yeah. To ensure that you get maximum results from that. You get a return on your investment from your marketing and and, you know, and also understanding the business stage of your sports business because the startup stage is going to be looking very different to the growth stage. So, for example, during the startup stage, you're going to probably have minimal income coming in and you've got quite a lot of expenses. You've got startup costs, equipment costs, things like that. So it's really good to understand that there is a different difference between a business in there, you know, year one, year two stage compared to a three, four, five and and then prioritising them and and then setting goals as well, you know, setting goals according to that particular stage of the business. Fantastic. And also, I'd like to add one last thing is that it comes down as well to what you talked about having savings. So that's also important planning so that you're actually saving for those those times of the year or those months where business starts to drop, which there is in this type of industry, there is is going to be because it's times of the year where your clients are going to be on holiday. They're going to be away. It might be during Christmas. It might be during summer and business starts to drop or you start to work with less clients during that time of the year. And I know in working with coaches that spring and summer is when most businesses go up because that's when business starts to. It's just that time of the year where parents start to get their kids outside, training, practising and then when once winter hits, business starts to drop a little bit and coaches don't prepare for it. So they don't have those savings in place and and they don't diversify their streams of income, as you mentioned here. So, yeah, just being organised and planning. Yeah, yeah, I think that's that's a great, great point to end up is is understanding those those trends, preparing for that and and also benefiting or taking advantage of those trends for the quieter seasons, but also opportunities that could arise during those quite quieter seasons as well. Yeah, perfect. All right, Andrew, I'm going to put you on the spot right now. So if you were to summarise everything we talked about today in a short sentence, what would it be? So to summarise, I would say, ensure that you prepare your business. You organise its finances to ensure that you can understand the numbers, make sense of the numbers and then plan from those numbers, any opportunities or trends or your business for the future. Fantastic. I think that was more than a sentence, but but it was a good. I'll work on it. I'll work on it. It was a good summary to be fair. All right, Andrew, well, thanks again for jumping on and sharing your knowledge and expertise with with the coaches and audience that watch the podcast. Yeah, brilliant. Thanks for having me, Leo. Yeah, I'll see you on the next one. Cheers.


In a previous video which I'll link up here and that will be done in the description, we looked at simulating the difference in means for the same numerical variable between two groups. I'm going to show you how we can do that just with the F distribution or calculating the F ratio. And one way, one place that we can use that if we want to compare more than two means. And in this example we'll see three means and I'll show you how to build up a sampling distribution of F statistics. And we can see where our F statistic falls on that sampling distribution and hence get some sense of how likely it was to have found our F statistic or more extreme. As in the previous video we're going to use Julia and I'm going to code in visual studio code. Once again there'll be a link in the description down below where you can see a video where I set up Julia and visual studio code. So as always I'm going to have at the start of my scripting file here all the packages that we're going to use and we're going to use data frames random distribution stats plots and stats base. So I'm just going to hold down shift and hit return after each of these. Now first of all you'll see Julia will start and that data frames package will be imported. There we go. I'm just going to install all the other or at least use all these other packages import all of them into this active session of Julia. So let's have a look at the F distribution. Now the F distribution takes two parameters and that has to do with how we look at the numerator and denominator of the F statistic and the F statistic is a ratio and I'll show you how all of that comes together. Now I'm going to use the plot function there and then from the distributions package you can see I'm using the fdisk function and I'm passing those two parameters. I'm also going to do a little bit of coloring there and just put a label and there we can see the F distribution for those two parameters. So you can certainly see this is not a normal distribution. It's not symmetric and it's sort of certainly not centered around a mean. And what we're going to calculate is an F statistic or an F ratio which will fall somewhere on the x-axis and the way that we will think of how likely it was to have found our test statistic or more extreme would just be you know if it was here to just draw a line straight up from two and then everything towards positive infinity. That area under the curve there that is going to be this likelihood of having found our F ratio or more extreme and in that way with randomization we're going to be able to simulate a p-value. So let's set up our data in this instance we're going to have 300 samples in our data set and we're just going to have an equal size now that's obviously not necessary but in this instance we're just going to have 100, 100 and 100 and if I divide 300 by 3 I'm going to get back a floating point value in Julia so I just have to stipulate that I want an integer and it becomes important when we use the repeat function to use an integer. So there we have I have N and N group and N underscore group so the value is 300 and 100. I'm also going to set an ID column because we're going to build a data frame and I'm just going to use a range object there 1 to 300 because 300 is in the value N and then I'm going to create a computer variable called group and I'm going to vertically concatenate 3 vectors and for that we use the VCAT function as you can see the VCAT and I'm just going to pass 3 vectors and I'm going to create each of my vector with the repeat function so I'm being very verbose here just so that you can clearly understand how I put this together so the repeat function I pass a vector that contains one element which is a string which is the Roman numeral 1 and how many of those repeats do I want? Well I want 100 and this is where it becomes important to place a integer there and if I didn't use int there I was going to have 100 dot zero which is a floating point value and you can't use that with a repeat function. Then I'm going to repeat the Roman numeral 2 100 times and the Roman numeral 3 100 times and I vertically concatenate all of those so I have this long vector of 300 elements so let's execute that and I have this vector as you can see there if I hover over that it starts with 100 ones and then goes on. Now my next variable is going to be a continuous numerical variable I'm going to call it mass just so that it you know can fit in with anything you want whether it's a product on the shelf or from a factory floor of some animal or organism doesn't matter so I'm going to take all of these values from a normal distribution and because I want three of them I'm just going to stipulate three means and three standard deviations so we see there 98 100 105 so I'm just setting these values there we go all six of them because now I'm going to use the vcat again and I'm going to assign that long vector of 300 elements to the mass computer variable and each of them that I'm vertically concatenating is going to be from a normal distribution so I'm going to use the ran function first argument is from what we want to take these random values so the distributions package I'm using the normal function there and I'm stipulating my mu1 and sigma1 that is my mean and standard deviation so there'll be 98 and 20 and how many do I want well I want 100 of those and then from 115 for the second one and 105 and 10 as fast the mean and standard deviation is for the third one so just do all of those and now you can see that'll be neatly fit in with my group one group two and group three and I'm just also going to just seat the pseudo random number generator and if you use 12 you know there's nothing special about using 12 but if you use 12 you're going to get exactly the same pseudo random numbers so I'm just going to highlight all of them hold down shift and hit return or enter and I have my 300 element vector and then from these three computer variables ID group and mass I'm going to create three columns in my data frame I'm assigning my data frame to the computer variable DF from the data frames package we're using the data frame function so I always just show you where these functions come from by you know using the package name as well so remember we don't have to put symbol notation there or use quotation marks when it comes to the column header or the name of that column which will then be a statistical variable for us we can just write out the word or the character so ID I'm going to sign to that my 300 element vector ID to group I'm assigning my 300 element vector group and to mass I assign that 300 element vector mass so if we execute that I'm going to have a data frame that's going to be 300 by 3 so you can see the three columns there ID group and mass ID is a 64 bit integer group is a string and mass is a 64 bit floating point number so that would you know mean from the group which is a categorical variable I can create my groups and the variable that we're going to compare between these groups as a continuous numerical variable so no problem there as always I like to create these sub data frames they just you know if I'm working on different parts of a data project it's just easy to work with data frames that only contain the samples or subjects that you want so I'm going to use the filter function and the filter function takes this little argument there and that R is just a placeholder so R dot group and you know I think last time we used the word row you can use X you can use whatever you want and it's just going to go down each of the rows in the group column it's going to look for those that have one in them if that returns a true that conditional that row will be included otherwise not in the second argument there is just my my data frame which this filter function would refer to so I'm going to get create these 300 by 1 3 100 by 3 data frames and they will all now only have you know values in for the specific group I also like to extract vectors of the values that I'm going to work with for that I use the collect function and I'm going to extract df dot mass so that's all 300 masses and that dot notation just allows me to refer to that column and I'm going to assign that to mass underscore all so that'll be a vector of all 300 masses and then I'm going to do 100 element vectors for each of those no you know we had that before when we created the repeat function but I'm just assuming that you're importing a CSV file and that you have a data frame and you just want to extract those vectors from the columns so very quickly I think we start off with some descriptive statistics now we chose you know we set the parameters for the normal distribution from which we took these values but you know so we know what they're going to look like but let's use the describe function and that comes from the stats base package and you see that's going to print out here in about with the default settings here in visual studio code that's going to print out in the repel down below here and we can see the 100 values in the mass underscore one and that vector there's no missing values we see a mean of 99 and we see the quartiles there one thing that you don't see is the standard deviation but as I've mentioned many times before just use from the statistics package you can just use the standard deviation function STD so let's just have a look at those as well and we see 104.95 and then 100.52 so what we're going to try and look at is there difference between 99.71 100.52 and 104 so we've got three means that we're going to compare and of course we can't just subtract them from each other as we did when we only had two samples so we're going to just simulate here you know many possible if ratios this is do a little bit of data visualization as well so I'm using this macro DF referring to my DF data frame and I'm going to do a box plot of all three of those and we create this box plot just to show me the masses of all three and the ideas is their difference in the means between these three groups of course here we see the median and the first and third quartiles and then you know suspected outliers there beyond the whiskers so let's generate a test statistic now our test statistic is going to be an F ratio and I'll show you the equation for it in a little while what we need for that equation though is the mean of all of this the values combined so that's going to be the mean of all 300 values and I'm going to sign that to mean underscore mass then we need the mean of all three of the individual groups so I'm just going to sign them there and we saw them before now let me show you this equation now this is a PDF of the Pluto notebook that I used to do this exact same analysis and what the Pluto notebook of course does there's Jupiter notebook it allows us to make these nice little notebooks and I'll certainly make that available and get up together with this dot jl file that we're working with individual studio code but if we scroll down here you can just see everything we've done before it's all there and what I want to show you here it's a scroll down there's a little bit of information for you about their ratio and their statistic that you can certainly read but this is what we after it's a very simple idea first of all you can see there that I have all the values there so I'm just representing them in very schematic form and we only have two groups in this little schematic but you put all the values together and you calculate a mean and that's going to be our initial model we call it the mean model you can that's what you can call it and that says that whatever this mean is will be the predicted value so if you're thinking about this variable and now since this is mass given any random subject we're going to predict that its mass is the mean of our model and that's a very poor model of course and what we interested in is the difference between each of the values and the mean and because you know we subtract one from the other and depending on the order we might get negative and positive numbers we square all of those so if you think about it we well on our way to thinking about the variance because the variance is going to be the difference between each value and the mean and you square all of those you add all of those square terms and you divide by how many there are minus one for a sample variance so we're not going there we're all only here considering the difference between each value and the mean squared just keep that in mind and then on a fitted model and we use these terms because it's very similar to thinking about linear regression so if you know a little bit about linear regression so they keep that in mind and what we do here because you know we don't have any medical variable on the x-axis so we can't do this least squares line so we think about it in a slightly different way but we now separate the two groups or in our instance we've got three and if you've got more than three you obviously separate that out and for each of those now we calculate a new mean so every group will now have its individual mean and that mean will be the predictor for that so given the group that the subject is in we will use the mean as the predictor for the numerical variable which again is a very poor model but it's at least now going to be better because given the group we're going to have a you know a better understanding or better prediction of the numerical variable by its specific mean versus this overall mean and that's what we call the fitted model and we just look at each of those individually but once again for each of those and you can see I'm only you know highlighting in each group just one of the differences but again it's the difference between the value and the mean squared and we're just going to sum over all those and again it's well underway we well on our way to looking at the variance here we just not dividing by how many there are minus one and then F ratio is this idea behind the difference between these two models this mean model which is very poor and then this fitted model which is obviously well let's let's use the term obviously in quotation marks better and it's this ratio between these and you'll see the term between and within the structure between the between variance and the within variance and that might be slightly confusing so I think this is just a better way to think about it somehow this F ratio is just going to demonstrate or express at least the difference between these two ideas this very poor model which is the mean model and this better model which we kind of call the fitted model but for all of them all we want to remember is the fact that you know we we are going to sum over the squared differences so we have this mean and we're just going to take each individual value and we're just going to do the square difference and there you can see the equation there we gonna call it SSM sum of squared it is around the mean and that's just the mean minus each of the values squared and then there is the F ratio so what we have in the numerator is the numerator and denominator and what we have in the denominator is the numerator and denominator so in each of these you can think of it sort of over variance over a variance but it stays a bit of a difference here so SSM minus SSF now I haven't told you what SSF is we've seen SSM all we're gonna go do is just go back here to this nice little schematic so what we're doing here is the summing of all the square differences so from each of the value from the top to the bottom you know subtract the mean from it or it from the mean doesn't matter because we square all of those and we just add all of them together with the fitted model we have these separately for two groups three groups four groups yes indeed you can do it for two groups you don't have to use that the t distribution so there we go we have you know for each of them the sum of squares for the next one the sum of squares and all we do for those individual sum of squares we just add all of them so SS fit will just be the sum of each of these individual sets of sums of squares and that's all we do for SS fit so SSM is going to be larger than SS fit SS fit is going to be better so the sum of the sum of squared errors are going to be less but once again very simple just do the squared errors for each of these individually so in this instance you land up with two and our example we're gonna land up with three and you just add all of those three it's a simple summation and then we divide that by in the numerator we divide that by this symbol here called pf underscore fit minus p underscore mean and that p stands for parameter so how many parameters did it take for our fitted model if we go back here well it only had one parameter there was only one mean in there so that p mean is only going to be one p fit in this instance well we had two means so we had two parameters in calculating that SSF so that will be two and now in our example we're gonna have three so p fit would be three the three parameters three means and if we look at the denominator it's this SSF so if you think of SSM minus SSF over SSF that is just this proportion that we trying to express its denominator though is the complete sample size minus how many parameters they were in the fitted model so keep that in mind that is what this you know calculating the safe distribution is all about and we're gonna do that in code so back to our visual studio coger and that's where we see p mean p underscore mean and p underscore fit there was only one mean in my mean model and there were three means they're gonna be three means in my fitted model so I'm just saving that so let's calculate SSM I'm gonna call it SS underscore mean for descriptive purposes I'm gonna sum over all the square differences so there's my difference differences I'm taking mean mass remember that was the all of them together dot minus mass that dot minus means do that in each instance it's gonna take the mean and for each of the values in the mass all 300 values it's gonna subtract that from the mean so you've got to put that because you know that is only a single value that is 300 values so you've got to put the dot there to indicate that it's done per element and then each of them dot square so each of those differences I'm squaring each of those and all of that combined goes into the sum function so I'm summing over all the square differences and I get 73,888 now I'm going to do it for each of the three individual groups no no difference there other than I've got a different mean now it's mean mass one and I'm subtracting that from that each element in mass underscore one again with a dot minus and the dot square so now I'm going to get these three values and all I'm going to do in the end for SS fit I'm just adding all three of those there we go and now eventually we can use our F ratio function that we saw it's SSM minus SSF divided by PFIT minus PMIN and that goes over SSFIT divided by N minus PFIT and we see a F ratio there of 3.26975 etc that is our F statistic and if you've looked at textbooks or tables before you'll you'll have seen an F statistic and that's going to fall somewhere on that F distribution plot that we saw specifically for the two parameters and if you ever wonder where those two parameters come from well they're right there there's our first parameter for an F distribution and there's our second parameter for an F distribution so as simple as that so now it's time to do our randomization again under the null hypothesis of a simple null hypothesis we're going to state that these three means are equal to each other under that null hypothesis it means it does not matter in what group a subject falls you know we can swap two of them around because our null hypothesis states that there's no difference between these groups I can just interchange them and that's what we're going to do we're going to randomly well put them all together in one row scramble them up shuffle the whole 300 and then for that same sample sizes as before which in our cases the easiest was 100 100 100 if I take all of those values in a row shuffle them up down up down randomly first new 100 is group one second new hundreds group two last 100s group three I have news three new groups and I can do calculate this F ratio all over again start from sketch I've got my 300 values now shuffle them up and down make three new groups calculate a new F ratio and if I do that over and over again I'm going to get this sampling distribution of F ratios so to hold these values we're going to start off just with an just defining here creating an empty vector and I'm going to call it F underscore ratio underscore sampling and I'm going to do 20,000 in this time F ratios that we're going to through randomization that we're going to create so I'm just using reassigned there 20,000 and I do that because if I want to change it later to 40,000 or some less doesn't matter I can just change that value so once again we can use a for loop so you can you can write much better code than this I'm being very verbose as before just so that you can see exactly what happens so my for loop is going to run from 1 to 20,000 so the first thing that I do is I do a shuffle of the mass values remember the masses all 300 values the shuffle function from the random package it's going to just reshuffle them in a random order and I assign this new order to shuffle underscore mass and then I'm going to calculate the mean of this new shuffled mass now remember that's going to be no different from before because all 300 are there so nothing's changed there and I'm going to just do this reassigned SSM which is just going to do the mean of the shuffle mass minus you know each of those shuffled ones squared so just as we had before for SSM SSM now remember this is going to be no different because shuffling them around they're all together I'm not taking a random selection with with replacement it's just the same as before but now what is more interesting I'm going to have three new different groups so I'm going to create new group one and that's going to be the first 100 values in my shuffle underscore mass my second group is going to be from 101 to 200 and the last one 201 to 300 so just be in mind if your sample sizes were different just keep the sample sizes the same but because they know all shuffled now there are going to be reassignment of the group that a subject is in but under the null hypothesis this should make no difference because the null hypothesis states that well the three means are equal to each other anyway and then I'm just creating the me calculating the mean for each of these three new groups I'm calculating the new three fitted sum of squared errors and I'm just adding all three of those so that I haven't a new SS fit and then I'm calculating a new F ratio I'm going to call it reassign underscore F underscore ratio and we calculated it exactly the same as we did before for that F ratio and then I'm going to append to my initially empty vector there is my initial empty vector I'm going to append to that this new F ratio that I've just calculated and then I'm going to run through this 20,000 times now powerful computer lots of RAM no problems it's very quick now let's have a look at the histogram let's have a look at the histogram of this distribution of F ratios now remember if we come to the left-hand side there we could see the plot that we have before for the F ratio using an equation this is what it would look like for those two parameters so let's have a look if we simulate we've got our 20,000 simulated values there I'm going to use the histogram function those 20,000 values but I only want 60 bins I want a bit of transparency and I'm just giving a label to my function let's see what it looks like let's see and look at that same or similar sort of shape as we had with our theoretical distribution now our F ratio falls somewhere here remember it was three point something and we just wanting to know how likely was it to have found this F ratio or more extreme so wherever we have our F ratio in the x-axis we want to know how many of our values this is a histogram so it's gonna you know just in every bin that counts how many of those fell in that bin so if we have a line here three point something we just want to know what fraction of all these 20,000 values were equal to our F ratio or more extreme so that's towards the positive infinity side and that's all that remains I'm just going to sum over this I'm just going to ask the F ratio sampling dot greater than F ratio so it's going to go through all 20,000 and return true or false if it is bigger than the F ratio and remember true is saved as a one and false is saved as a zero so if I sum over all those zeros and ones it's going to sum over it's going to give me the sum of all the true values so how many of these 20,000 values were more than our initial F ratio and I'm just dividing that by 20,000 so that I get a fraction and if we do that we see 0.039 and that is very close to using just your statistics with the mathematical equations that come with that to calculate AP value from an F distribution given those two parameters so that is you know V V I think intuitive way or different way just to think about how likely it is to find your value given the null hypothesis now we don't have access to the whole population the only thing we have is our sample and we assuming that that sample looks very much like the population so we using that as a proxy for the population and because we're just doing this reassignment through randomization over and over again we're building this distribution of possible F ratios and we assuming that that's going to look you know very similar to the population and you know if those samples were you know taken very properly it should be quite close and here we've estimated we've have some idea of how likely it was to have found our F ratio and we can now state that if our alpha value was let was open 05 this is less than open 05 we reject that null hypothesis and we say well there is a different there is a difference between those three means and now we can start thinking about post hoc analysis just to show you the count map function here it's just going to show me how many truth and false as I had so if I look at there zero is false one is true so 773 of those 20,000 were larger than our F ratio and that's how we got to that fraction there of 0.039


The traditional medicine and diets of mankind have been used for centuries to prevent and treat chronic diseases such as cancer. Recent research indicates that chronic inflammation plays a key role in these diseases and two transcription factors NF-Kappa B and STAT 3 are implicated in regulating inflammation, cellular transformation, and tumor cell survival, proliferation, invasion, angiogenesis, and metastasis. Triterpine compounds derived from traditional medicine and diet have been shown to inhibit NF-Kappa B and STAT 3 activation pathways, suggesting they may be effective in preventing and treating cancer. This article was authored by Bharat B. Uggarwal, Bakyan Sun, Sadiya Prasad, and others.