Statistics for Data Science
Transcript
data science and machine learning is the hardest job of the 21st century with an average salary of $120,000 per year according to LinkedIn the data science job profile is among the top five jobs in the entire world now if you want to for into the world of data science you need to have good command over statistics as it forms the base of all the data science Concepts so with the help of Statistics you can make predictions such as New York will be hit with multiple tornadoes at the end of this month or the stock market is going to crash by this weekend now all of this sounds magical doesn't it well to be honest it just statistics and not magic and you don't really need a crystal ball to see into the future so keeping the importance of Statistics in mind we have come up with this comprehensive course by Dr abanda sarar Dr abanda sarar has his PhD in statistics from Stanford University he has Tau Applied Mathematics at the Massachusetts Institute of Technology being on the
research staff at IBM let quality and engineering development and analytics functions at General Electric and as co-founded omix Labs we are uploading this highquality classroom session by Dr abanda sarar from great learnings business analytics and business intelligence course it has been ranked number one analytics program consecutively for the past 4 years this tutorial will be on YouTube for only a limited period of time so that Learners across the world can have access to high quality content so please do subscribe to Great learn YouTube channel and share the video with your peers so that everyone can learn from the best now without further delay let's have a quick glance at the agenda we'll start off by understanding the difference between statistics and machine learning then we'll go through different types of Statistics which are descriptive predictive and prescriptive after that we'll understand the different types of data available
going ahead we'll understand the concept of correlation and co-variance comprehensively following which we'll head on to probability and learn how to implement conditional probability with base theorem and finally we'll look at two types of probability distribution binomial distribution and poison distribution so let's start off with the session what you now need to do is you now need to be able to get the data to solve this problem so therefore the statistical way of thinking typically says you formulate a problem and then you get the data to solve that problem the machine learning we have looking at things typically says here is the data tell me what that data is telling you many of my colleagues and I myself have run into this problem when going for interviews etc etc and so uh um sort of statisticians say that um
we're not getting jobs out there and so I go to uh go to people who are hiring and saying that why don't you hire statisticians and I reach an interesting conclusion to this entire discussion um that sometimes around the way the interviewer who's interviewing the statisticians for a data scientist job ask the question um here is my data what can you say and the statistician answers with something like what do you want to know and the business guy says but that's why I want to hire you and the statistician says but if you don't tell me what what you want to know how do I know what to tell you and this goes round and round right no one's happy about this entire process so there's a difference in the way these two communities approach things my job is not to resolve that because in the world that you will face you'll see a lot more of this kind of thinking than you'll see in this thinking because in this world the data is cheap and the question is
expensive and you're paid for asking the right question in this world the question is cheap and the data is expensive you're paid for collecting the data so sometimes you will be in a situation where this is going to be important for example let's suppose you're trying to understand who's going to buy my product you're asking the question let's say that my products aren't selling and you want to find out why what will you do get what data so let's say that
you're selling your I don't know what do you want to sell um you want to sell watches say so let's suppose people AR buy buying watches anymore which is a reality correct so you're a watch company who buys watches these the entire business model of a watches disappearing do you have watches some of you have he has actually a surprising number of you have maybe they do different things these days right that that seems like a very that that's a fitness device is not really a watch at all so so something like this was actually with my daughter at lunch today so she got something like this I'm not sure my my my my wife who's an entrepreneur runs their own company she came back from Delhi she came back with two of these I don't know where she picked them up so my my daughter the first thing she did she took one of this and she took this thing out because she thought of the whole wristband as an unnecessary idea I mean she that didn't occur to her
I mean that's a separate thing that's a nice little beautiful red wristband Etc so a watch is a different thing but let's say that you're a watch company nobody's buying your watches or fewer people are buying your watches now how are you going to solve this problem or how you going to process this information what do you want to do what do you want to know theel okay but remember I'm asking this question also from an analytical perspective So when you say that to check the model and see what is not sold that assumes the whole data question so you so first order you'll see sales for whom and when and how how do you structure your data how will you how will you arrange the problem comp are your competitors sing okay that makes problems even harder because now you're going to look for data that isn't with you no no he's right he's right he's right maybe people are not buying watches because they're buying something else that's a reasonable
thing but let's keep this problem simple let's consider only data that is within you we'll go outside not to worry but let's say that I'm looking at my data what data do I want to see and what questions do I want to ask of it let's so sales year by year types and then what comparisons do I want to do year on year year on year region region wise age with what purpose what question am I asking the data what section of customers are buying my product or what section of customers are
buying my product compared to what what has changed in terms of the what are my biggest set of customers so that's so that's one thing who who are my biggest customers okay that's a very interesting question to ask except that that question implies that I needed to know who my biggest set of customers sort of could have been but it's a good point where is the bulk of my sales coming from then someone else say something about time you know is it going is it going down so you can look at things like saying that for which group of customers are my sales going down the most for example you could ask that I'm not saying that's the right question but that's a possible question to ask so let's suppose you follow that approach that I'm trying to understand I know that my are going down that's an obvious thing my CEO is telling my CFO is telling me and if I don't stop this we're all going to be out of a job correct the HMT factories in
Bangalore are not in good shape one of them I think has become the income tax office right somewhere in the mishwar area so that's going to happen to me if I if I don't do this well so I know my sales are going down but I don't know by how much and particularly for whom so are there segments for which the sales are going down which segments are sales going down the most in which segments are they going down a little bit how fast are they going down I can question I can ask questions of that
sort now what conclusions at the end of this do I want to be able to do how do I need to how do I want to use this information now for this you usually follow something like a three-step process and you may have seen this and this this covers both these sides and these words should be should be familiar to you to some extent the first is called descriptive the second is called predictive and the third is called prescriptive have these words been introduced to you at least in this at
least you've read it I'm sure you you all Cruise the web and look at blogs and things like that nothing new in this I'm sure but I just want to set a context because it's going to talk a little bit of what we descriptive there's a c here so descriptive predictive and prescriptive now what is a descriptive problem the descriptive problem is a problem that says that describe for me where and I'm losing my sales and when I'm losing my sales it just describes the problem for
me it tells me where the problem is it locates it it isolates it the predictive problem says look at this data and give me an idea as to what might happen or what would happen if I change this that or the other so let's suppose I do the following kind of idea I say that let me relate my sales to my prices let me try and understand that if I reduce my prices of my watches will more people buy them conversely if I make my Watches luxury items increase the price of a
watch remove a low-end brand and make a watch an aspirational thing a decorative item a luxury item a brand item so that people wear a watch not to see the time but also as a Prestige statement as a fashion statement whatever it is if I do this then what will happen that's predictive I'm trying to predict something based on it I'm trying to say if something happens to let's say one part of my data what will happen to the other part of my data and then and based on that the doctor carries out a
predictive analysis of you because I see this I now think you have this issue you have this thing going on let's say I'm diagnosing you as being pre-diabetic you're not yet diabetic but you're happily on the way to becoming a diabetic now because of this I now have to issue you a prescription I now should tell you what to do so there's a data that comes from you that data in some way is modeled using the domain knowledge that the doctor has and that model has translated into a
into an action that action is designed to do something typically it's designed to do something actually fairly complicated the first action the doctor tries to do is number one let's say Do no harm the hypocritic oath first let me make sure that that I don't do any unnecessary harm to the patient then let me shall I say optimize his or her Welfare by making sure that I control the blood sugar the best and that I postpone the onset of diabetes as best as I can it's a complex optimization problem
of some sort in a business also it's a complex optimization problem right I need to be able to sell more watches but I also need to be able to make money doing so I can increase my sales but if I increase my sales and my profits go down or my earnings Go Down based on the cost then that's a problem but at the same time if I try to run a profitable business and nobody buys my product that also is not a particularly good idea then there are other issues maybe in running the company I've got
employees that I want to keep on the on on on the boards how do I run the company in such a way so that it needs that particular labor force I have finances to take care of I have loans to repay how do I get the cash flow in order to repay the bank loans that I have so the prescription has to meet lots and lots of requirements if you're building an autonomous vehicle you'll have situations saying the car has to do this but it also has to follow certain other rules for example if it sees someone crossing the road it should stop but it shouldn't stop very suddenly because if it stops very suddenly is going to hurt the car it's also probably going to hurt the driver so it can it should needs to stop but it shouldn't stop too suddenly it has to follow the rules of the road because otherwise the computer will simply say oh you want me to avoid the person crossing the road I'm just going to go behind the person and you going going to tell the car please don't do that because there's
a house next to it you can't just sort of do that oh you didn't tell me that you just told me to avoid the person you didn't tell me about the house okay we'll put that as a constraint in our program and see how well it goes so prescription is problematic another simple way of doing it might be to say that description is how many centuries has Virat kohi scored look up Crick info and it'll give you the answer prediction might be try to guess how many centuries verat kohi will score
in the World Cup prescription might be how do we get vat kohi to score more centuries in the world cup and as you can figure out you're going from a purely data BAS version of the problem into something that's only notionally about the data data will help you but there's a lot more than the data when it gets to that what we'll do today what we'll do now once I've finished talking to you is we'll we'll take a look at what descriptive what the the descriptive part of analytics
is so the descriptive part of analytics is talking about simply describing the data without necessarily trying to build any prediction or any models into it simply telling you the way it is this is hard this is in itself not necessarily an easy thing to do because you need to know very well how to do that and what are the ways in which one looks at data this is skillful in itself so for example let's suppose that you are you're the I'm you're a do you go to the doctor and the the doctor is
looking at you looking at your symptoms and the the doctor recommends a blood test now how does a doctor know what blood test to recommend based on the symptoms based on the symptoms but remember that potentially there's an enormous amount of information in you all of us as biological things carry an enormous amount of information in in our blood in our neurons in our genes or wherever you know if you're talking about Big Data as I said there's 2 meters inside every cell and there are a
few billion neurons in your head you don't need to go far to see big data you are big data you are one walking example of big data we all are right now in that big data what little data does the doctor know to see that's a descriptive analytics problem the doctor is not doing any inference on it the doctor is not building a conclusion on it the doctor is not building an AI system on it but it's still a hard problem because given the vast amount of data that the that the that the doctor could potentially see the doctor needs to know that I I this is interesting to me and this is interesting to me and this is interesting to me and this is interesting to me in this particular way for example a blood test let's suppose that I draw I draw blood from you for a particular purpose let's say for blood sugar correct leaving aside the biology of how much blood etc etc to draw
um just neither none of you I guess are a do any of you are doctors here any doctors in the room doctor so I can say whatever I want you won't understand what I'm saying no no but so but I'm old enough that this is a real problem for me so you have a you have a large amount of blood that's flowing through you we all do this blood carries nutrients what that does is that every time there is a nutrient inflow the blood looks a little different so if you eat your blood looks a little
different because that's your blood's job the blood's job is to carry nutrients if you want to run you want to walk if I'm walking around my legs are getting energy from somewhere the energy need from my legs is being carried from the blood and it is being generated through inputs that I get some of it because of the air that I breathe from where it gets the oxygen to burn things some from the food that I've eaten the nice lunch that that I had where it gets the calories to do that so therefore based on what my energy requirements are and based on what I've eaten my blood is not constant my blood content is what is known as a random
variable what's random about it because it looks a different it looks really different all the time your blood at 12:00 is going to look a little different 12:00 at midnight is going to look a little little different from 12:00 at noon because it's doing something a little different the same phenomena is there everywhere if I were to for example measure the temperature of the oil in your car or in your two- wheeler what do you think that temperature will be it depends first of all it depends on
whether the car is running or not it depends on whether it has run or not it depends on how much oil there is it depends on how you drive it depends on temperature rest of the car the answer is it depends and the same is true for your bodily fluids so this becomes a slight problem because if it is random then from a random quantity how do I conclude what your blood sugar is how does a doctor reach that reach a conclusion of any sort average of what average of particular duration so there are multiple averages that you can get first of all there's a question of saying that if I take blood from you how is the blood usually collected so the fotus comes and usually takes an injection from one point let's say by some strange accident this is Thoroughly in advised but let's say by say some strange accident two different people are drawing blood from two hands at the
same time do not try this at home but let's suppose they do do this will they get the same blood IDE ideally yes it depends what time same right at the same time as I said do not do this at home but at the same time you're getting two different samples there's not just a question of time your blood is not going to look the same even within your body at one period of time even from the left hand even from the right hand exactly the same period of time it's not going to look the
same there is a slight there is a slight problem that somehow a little obvious that that you know your your your heart is in the middle your heart is actually in the middle but it beats to the left why because the the heart is what the heart is both a pump and a suction device the pump side is on the left the suction side is on the right so your blood pose out from your left side and it goes back in on the right side so there's a slight asymmetry in your body between left and right one side tends to go out the other side tends to come in it's slight it mixes up all in the middle so one sampling idea is that I'm taking a sample of blood from you and it's just one example the second question is as you were saying it's a question of time so you can average over time if you average over time this is really easier you can say I'm going to do this maybe before eating after eating reg after eating so for those of you who have blood pressure
test for example oh sorry blood sugar test once they ask you to do it fasting and then they ask you to do it some 2 hours after eating do they tell you what to eat sometimes with glucose okay sometimes they don't they they sort of say that based on what you naturally eat let me figure out what you are processing they expect you to eat a typical meal and not go and eat you know large amounts of KFC if that is is not what you normally eat just eat what you normally eat a vegetarian eat normal vegetan eat normal food and then figure it out let's see how how good your body is at trying it out so it's saying do a normal thing and I'll take another normal
sample then one of you said something very interesting they average things out now what does averaging do neutralize that's an interesting word to use neutralizes things Prov a general provide context provide context context of what context there a good point so so what is the doctor trying to do so let's let's simplify things a little bit and say that let's suppose that the doctor has a threshold let's give it a number let's say the doctor says that if your blood
sugar is above 140 I'm going to do something if your blood sugar is say less than 140 I'm not going to do anything I don't know whether this is the right number or not but just let's make it up now the doctor is going to see from you a number it may be a single reading it may be an average it may be a number of things how is the doctor going to translate what they see from you and compare it to the 140 how is that comparison going to be made maximum number of people Maxim so let's suppose I have just one reading so let's suppose that I have one reading and that reading oh I don't know is 135 I've just got one reading from you 135 what does that tell
me no test required one AR one argument is it's simple let's take a very machine learning computer science view to this 135 is less than 140 ahuh so now he's saying yeah but you know what let's say that 135 and another guy who say 14 120 there should be something that says that this 135 is a little bit more trouble than 120 closer to the threshold as he says so maybe in other words this threshold isn't quite as as simple as I thought it was so I can solve this problem in one of two
ways one way to do this is to make this 140 a little range this is something called fuzzy logic right in other words the question you're asking becomes fuzzy not as crisp you're not fiddling with the data you're fiddling with the boundary you're fiddling with the standard the other way to do that is to create a little uncertainty or create a little plus minus around the reading itself around 135 saying that if this is 135 and let's suppose that I go and get another reading and the second reading
that I get is say 130 and the third reading that I get on the day after that is say 132 and I'll say Okay seems to be fine I might say but let's suppose after 135 the guy goes and I do my usual thing and I measure it again and this time it comes out as 157 and I do it again and it comes out as 128 and I do it again it comes out to be 152 so in both cases 135 was probably a good number but in One cases 135 was wearing very little and the other cases 135 was wearing a lot which gives me different ideas as to how to process it so what descriptive analytics talks about essentially is trying to understand understand certain things about data that helps me get to conclusions of this kind a little more rigorously now to be able to quantify
what these plus minuses are is going to take a take us a little bit of time and we will not get there this residency we'll get their next residency to say that in order to in order to say it's not 135 or 135 plus minus something that question now needs to be answered but to do that I need to have two particular instruments at my disposal one instrument that I need to have at my disposal is to be able to know what to measure I need to say what does an error mean I need a statement
that says that maybe I'm 95% confident that something is happening I'm 95% sure that this is below 140 I need a way to express it and that is the language of probability so what we will do tomorrow is we'll introduce a little bit of the language of probability it'll be sort of unrelated to what we're doing today so there's going to be a little bit of a disconnect but what we're going to do is we're going to create two sets of instruments one instrument that is purely descriptive in nature and one set of instruments which is purely mathematical in nature so that I can put a mathematical statement on top of a description and the reason I need to do that is because the pure description is not helping me solve the problem that I've set itself that I have set
so therefore what will happen is you will see in certain medical tests you will not see points like this you will see intervals your number should be between this and this your chestal number your HDL whatever should be between this and this you won't see a number you'll see a range the typ typifies the variation and in certain cases you will see thresholds or maybe the it's just a lower limit or an upper limit but you'll also see a recommendation that says Please do this
again in other words I'm going to compare I can't compare one number to to one number one number to one number is typically a very bad place for any kind of analyst to be in because you got no idea of which is error prone and where the error is so therefore what happens is you try to improve one of those numbers and so either by filling around with the range or by getting more measurements and you'll do that and you'll see that as we go along a little later so this is a context
for for what we have uh in terms of terms of data let's see so this is a set of files that has been loaded uh it's a very standard set of files it's not mine to be honest uh I just want to make sure that I'm doing what I'm supposed to be doing so so for reasons that are more to do with security my understanding The Notebook will not access your drives so keep it on your desktop and not complicate life so uh and there is this
notebook it's called cardio goodness of good the word statistics refers to the idea that this is comes from the statistical way of thinking which as I said opposed to the machine learning we have thinking is tends to be a little more problem First Data next which means we worry about things like hypothesis and populations and sampling and questions like that and the descriptive part refers to the fact that it is not doing any inference it is not predicting anything it's not prescrib anything it is simply telling you what is there with respect to certain questions that you might POS possibly ask of it now what is the context to the case the market research team at a company's assigned the task to identify the profile of the typical customer for each treadmill product offered by the company the market research team decides to investigate whether there are differences across product line with respect to customer characteristics exactly what you guys
were suggesting that I should do with respect to the watch understand who does what entirely logical the team decides to collect data on individuals who purchase a treadmill at a particular store during the past 3 months like watches they're now collect looking at data for treadmills and that is in the file in the CSV file so what you should have is you should have a CSV file in the same um directory and through the magic of python you don't have to worry about things like path
before we get there remember because we're looking at this statistically before we get the data we should have a rough ideas as to what we're trying to do and so they say that here are the kinds of data that we are looking at the kinds of products the gender the age in years education years relationship status annual household income average number of times a customer plans to use a treadmill each week average noriz a customer expects to run walk each week on a self-rated Fitness scale on 1 to five where one is in poor shape and five is in excellent shape some of this is data some of this is opinion right some of this is opinion masquerading as data like for example number of times a customer plans to use a treadmill hopeful wishful thinking it's still data you're asking someone how many times will you use it her Rose daily no problem seven times a week oh we'll see huh but it's still data it's come from somewhere so so what has happened the
way to think about this is to say that I want to understand a certain something and the certain some certain something has to do with the characteristics of customer uh customer characteristics and to do this you can then use either you can either take let's say a marketing point of view who buys you can also take a product engineering kind of view what sells in other words what kind of product should I make Etc in business as you probably know for those of you are any of you
entrepreneurs one hand up there one hand up the closet entrepreneurs from what I could figure out right sometimes it's unclear what that word means in other words you think you are or you're not confident enough to call yourself one or you're doing that uh in in it space if you're an entrepreneur for example in um in in physical product space or even in software space one of the things you often think about is What's called the product Market fit which is you're making something how do you match between what you can make and what people will buy because if you make something that people do not buy that doesn't make any sense on the other hand if you identify what people buy and you can't make it that also doesn't make too much sense so the conclusions that we will draw on this we will not draw on today but the purpose is to be able to go towards conclusions of that kind either isolate products isolate customers and try and figure out what what they tell
us pandas generally has a fair amount of Statistics built into it that's what it was originally built for numai is something that was built more for mathematical problems than anything else so some of the mathematical algorithms that are needed are there there are other stat side plots in metal plot life or c Bor and many other things that you have seen already um python is still figuring out how to arrange these libraries well enough uh the the shall we say the the the programming bias sometimes shows through in the libraries so I for one do not remotely know this well enough to know what to import up front but a good session you know what to import up front and you do all this up front so you don't get stuck with what you want to do the naming is up to you if you like the names as they are then that's fine you want a standard set of
names so when you wrote the data set if this is in the right path just this will work do CSV it's usually smart enough to convert Excel forms into CSV in other words if you have this as excels and things like that it's usually smart enough but if it isn't then just go in and save an XLS file as a CSV file and operate that way in case it doesn't do it on its own but more often than not what you see is that when you when you when when Jupiter sees it it'll see an any excels
file as a CSV file or go and make the change yourself or you can have other XLS other restatements in it as well you can change functions inside it and you can figure out how much to head what this tells you is there's the head and the tail of the data this is simply to give you a visualization of what the data is um this gives a sense of what variables are available to it um what kinds of variables they are we'll do we'll see a little bit of a summary after this
Etc so for example some of these are numbers income what is income income is annual household income that's a number sum for example let's say gender m male female this is a categorical variable this is not entered as a number it's entered as a text field if you are in Excel for example right at the Top If you go in and you see that it will tell you how many distinct entries there are how many distinct settings there are so usually what happens right at the beginning and a data frame like this if it is created this is a data frame if a data frame is created when it gets created the software knows as to whether it is talking about a number or whether it is talking about
categories there are certain challenges to that you can see one particular challenge to this um what does this 180 mean counts why do you think there are so many decimal places that comes here 14 years of experience 16 years of experience why is it going 0
that's yes it does this because it sees other numbers where those decimal places are needed so what it does is what any software typically does is when it sees data it sort of says that at what granularity do I need to store the data sometimes this is driven by your computer your 64 bit your 32bit and things like that but what it does is it means that the data is stored in the data frame to certain digits now usually you don't see that you'll see it in this way but
sometimes for example when you say include equal to or and and you ask for a full description the data comes out in this slightly irritating way h because of something here because of let's say the income field or any of that now when it recommends when it looks at the descriptions of this what is the description that it is reporting and how does it choose to report out the description in this particular situation so let's take a little bit of a closer look at this one thing
here look at the way it's done here so count unique top frequency and then there are certain things here mean standard deviation minimum 25% 50% 75% and Max when it sees a variable like gender it reports out lots and lots of n what does that tell you right off the bat it can't do that which means it's not a number this is not a number in other words if you ask me to find the mean of something and you're giving me male and female as inputs I don't know what to
do which is an entirely reasonable stand to take for any reasonable algorithm right it it requires another kind of description for it to work but the problem we describe this syntax is that it's asking for the same description for all of them whether it's in significant digits whether it's in columns etc etc so it's chosen this description and it says that that's all that I'm going to give you but where it makes sense let's say for example I look at age now for age I've got 180
observations and it is calculating certain descriptions for it correct so what are the discriptions that is calculating let's look at these is calculating a desription like say minimum minimum is what 18 maximum is 50 these are easy to understand then let's look at something really interesting suppose I want to report one number one representative age for this data set this is like asking the question how do I get a representative blood sugar number for you I can give you a minimum and a
maximum but to do the minimum the maximum I need to draw blood many many times from you but let's suppose I want to this I want one representative age for you somebody asks you what is your blood sugar you want to give them one number similarly somebody's looking at this data and ask the question give me a representative age how old is your typical user or what age do you want to build it for or you're even asking a you're even asking let's say a product question you're a product designer and a
product designer building a treadmill now how do you design a product those of you Engineers based on based on the weight now very good what weight who's weight huh who's the user what is the weight of the user he's got a good point as as a design engineer I need to know what weight will be on that treadmill now what is the answer to that question Max us who visit the gym huh so there's a question of saying that if I want to measure a variable by one number how should I even frame that
question what makes sense what is the one average no Max in this particular case you might argue the max is the is the right number because I want to be able to say if I can support him I can support anyone but there's also a downside to that I've now engineered that product I You could argue that I shall shall I I say over engineered that product I'm sorry fact of safy a factory of safety okay all right so let's suppose that you are you are doing this for a mattress you all sleep on mattresses we're all relatively wealthy based on the fact that we're here so we probably sleep on a mattress not everyone's fortunate enough to sleep on a mattress but let's suppose you do sleep on a mattress how much weight should that mattress be designed to Bear if you over engineer it what will happen happen is that number one
for for for a reasonable weight let's say weight a lot below that that mattress is not going to sink let's say that you design it for 100 kilos now if you have 50 kilos or 60 kilos that mattress is not going to sink for you because it's going to feel comfortable for someone who is 100 kilos and for someone who's 50 kilos you're just going to bounce on it you're going to feel it soft silkiness or whatever it is you want to feel from the mattress it won't work so what to
do that's a hard problem it's a description but it's a hard problem who do I Engineer for and so therefore uh people have different ranges of what I mean to represent it so here's one version of it this is what is called a fiveo summary I report out the minimum the 25% point the 50% point the 75 % point and the maximum variable by variable I report five numbers I report the lowest what does 25% mean 25% of my data set or the people are younger than 24 the youngest is
18 25% or a quarter of them are between 18 and 24 a quarter are between 2 24 and 26 a quarter between 26 and 33 and a quarter are between 33 and 50 this is what is known as a distribution this is what is known as a distribution statisticians love distributions they capture the variability in the data and they do all kinds of things with it so I'm going to draw typical shape of a distribution we'll we'll make more sense of it later on this is a theoretical distribution distribution for example
let's say has has a minimum has a maximum has say 25% Point has a 50% point it say 75% point in terms of probabilities there's 25% here 25% here 25% here 25% here if you want to think in terms of pure description this is not a probability it's just a proportion if you want to think in terms of probabilities what this means is that out of 180 out of 180 people if I draw one person at random if I draw one person at random there's a 25% chance that that person's weight is going to be below below
24 sorry age 24 correct if you want to think in terms of probabilities we'll do that tomorrow but this is a description so what this description does is it gives you an idea as to what value to use in which situation so for example you could say that I'm going to use 20 26 as my representative age if I do that what is the logic I'm using this this 25% this 50% point so to speak this is called the median this is called the median and we'll see it median means the age of the average
person first s take the middle person and ask how old are you the age of the average person I could also ask for the average age AG of the person which is what which is the mean which is 1 / n X1 + xn now this is algebra what you have to do is you have to put n equal to 180 this is the first age the second age the third age up to 180 1 by 180 age 1 plus age 11 18 this is called the mean this value is what 28.7 n the average age is about 28 years or 28 and a half years 28.8 years but the
age of the average person is 26 yes so can you please repeat the median and the the difference between the two describe what is the age of the person so I described the median as the age of the average person and I describe the mean as the average age of a person now he's looking at me like saying you have to be kidding me right that's confusing I admit to it the easy way to understand it could be this what is the mean add them all up divide by how many there are what is the median sort them
from the smallest to the largest pick off the middle if they're an even number what do you do you take the average of the two middle ones if they're the same it'll be the same number if they're not it'll be a number between them so sometimes the median may show up with a 0. five or something like that for that reason if there is an ing counts but there are an even number of counts now which do you think is better dep you're giving the right answer it depends you'll figure out that I like that
answer they both make sense they both make sense it depends on what what context you're going to use it for in certain case yes you said that Med basically the mean of the it's it's the it's the age of the average person it's a reading from the average person so what is the parameter we are saying it is average person how we are getting that aage okay if you're talking in terms of parameters so he used an interesting term he's saying what is the parameter I'm after parameter is an interesting word parameter refers to something what generally in a population it's an unknown thing that I'm trying to get after for example blood sugar is a parameter it exists but I don't know it I'm trying to get my handle on it correct so if I'm thinking in terms of of of parameters then these are different parameters so let's let's look at a distribution here I'm not sure whether this will pick up things I hope so so the median is the is the median is a parameter such

Ask anything
We've read this whole study set, so questions about it get the best answers.