 Welcome to your 20th session and today we're going to continue with hypothesis testing but we're going to look at hypothesis testing for the proportion. Before we start today's evening, I'm going to do a recap on what we did on Saturday and then we'll start with the session. On Saturday we looked at the hypothesis testing for the mean when the population standard deviation is unknown and we said when it's unknown then we use the t-test statistic. We also said because we're doing hypothesis testing you always need to remember the six steps of hypothesis testing which we're still going to use even today when we do hypothesis testing for the mean. And we looked at an example of hypothesis testing when we're doing a two-tailed test and we said if you are given the information that the average cost of a hotel room in New York is said to be 168 to determine if this is true and you are given also the random sample of 25 that was selected and they calculated and found that the mean average of the average of the sample is 172.50 and the standard deviation which is the sample standard deviation therefore this population standard deviation is unknown is 154 and we needed to test the hypothesis at alpha equals to zero and because they just said the room is said to be they never said it's greater than or it's less than so therefore it means it's equal. So it will be a two-tailed test and the first step of hypothesis we know that you state your null hypothesis and alternative then you also state what you are given in terms of alpha and and and since we're going to be going to the G table and we need the degrees of freedom so we can calculate the degrees of freedom as well and you can also identify whether are you doing what kind of a test that's step number three and because your population standard deviation is unknown therefore we're going to be doing a test a t test statistic and step number four is to find the critical value by using alpha divided by two because we're doing a two-tailed test so it means our alpha we're going to divide it by two to go find the critical value and the degrees of freedom and the critical value helps us with the region of rejection it will identify if we need to reject or not reject the null hypothesis and step number five oh sorry six you step number five is to calculate the test statistic and calculating the test statistic we find that it was one point four six and then we can go and use the critical value and the test statistic to make a decision then step number six is to make your conclusion after you made your decision you conclude so the same concepts we're still going to continue with today when we do hypothesis testing for the proportion by the end of the session you should know how to use hypothesis testing for the proportion or you should be able to test the hypothesis for the proportion when we do hypothesis testing for the proportion we still need to remember all those six steps of hypothesis testing so therefore for the proportion the test statistic will be z state which will be the sampling distribution formula of proportion where it will be the sample proportion minus the population proportion divided by the standard error which is the population proportion times one minus the population proportion divided by n and remember if your sample proportion is not given therefore they will be giving you your x observations which are your number of observation that satisfies that sample and you can calculate the sample proportion by dividing the x observations with your sample size let's go and look at an example of how we do the hypothesis testing for the proportion a marketing company claims that it receives eight percent response from its mailing to test the claim a random sample of five hundred we surveyed with 25 responses test at alpha zero comma zero five level of significance so we need to do a hypothesis testing at alpha zero comma zero five we know the six steps of hypothesis testing so and this they didn't give us the sample proportion but they gave us the x observation which are 25 responses so we can calculate p so the first step is to state the null hypothesis and alternative and then we're going to go and do step number two to choose what level of significance is there identify what is given in relation to the sample size there's a population sample proportions as well and then we're going to determine the appropriate test so because we're doing for the proportion always for the proportion we use the z test and then we determine the critical value by going to the normal table to find the critical value so depending on your null hypothesis so depending on your alternative hypothesis side if it's a two-tailed test we're going to divide alpha by two and go find z using the z values using the z alpha divide by two if it's a one-tailed test we just going to use z alpha to find those origin of rejection and then we're going to calculate and compute the test statistics and make a decision and then do a conclusion so using our statement for the marketing campaign stating the null hypothesis we know that they said that it was 8% so therefore our null hypothesis will mean will say the population proportion will be equals to 8% or 0,08 the alternative will say it is not so the alternative hypothesis says the population proportion is not equals to 0,08 step number two is to state what we are given our level of significance is 0,05 and is 500 which was the sample size and we needed to calculate P because P was 25 divided by the 500 which our P is 0,05 step number three is to state what test we're doing we're doing a z test so step number four is to find the critical value we know that if we doing z alpha divide by two because this will be the so we know that for to find the critical value this is z alpha divided by two and by now you should know that the z is 0,05 divided by two which is z of 0,0250 is the same as 1,96 and since it is a two-sided test so it will have the negative and the positive side of the rejection area so we can identify clearly identify where our regional rejections will be and we daily mark them step number five is to calculate the test statistic substituting the value into the formula our P is 0,05 our population proportion is 0,08 divide by the square root of population proportion of 0,08 1 minus 0,08 divide by 500 and solve the whole equation we get negative 2.47 so since it is a negative so it will fall inside the rejection area and therefore we can conclude by saying we reject the null hypothesis at alpha 0,05 and we make our conclusion by saying there is sufficient evidence to reject the company claim of 8% response rate so since we using the z test we can also make a decision because with this one we are making the decision based on the z test and the critical value so for z we can use the p-value we can use our z test to go find the p-value remember that this is the same as your z value and if I go to the normal the cumulative normal distribution table and I look for minus 2.47 on the table so it means if this is the table on the side I will look for 2.4 and then at the top I'll look for 0,07 and the value that I will find where they both meet there that will be my p-value so we can use the z table to go find the p-value and the p-value if you go to your table right now and look at your p-value I can quickly look at my one it is 0 I'm not gonna show you my table I'm just gonna go to the table straight from here I hope you still know how to find the values so have you found the value or what is the value there on the p p minus 2.47 it is 0,068 it's 0,068 so since this is a two-tail test remember when it is two-tail test we say two times the p-value the probability you find on the table remember that so you must always remember that for a two-tail test it will be two times the p-value or you're going to add the p-value to itself and that's how you will find the p-value and we know that we can make the same decision because the decision rule says if the value of your p-value is less than alpha then we reject the null hypothesis so based on the same information we know that our p-value on the table we found that it was 0,068 but because there are two sides we need to multiply those by two and we find that the p-value is 0,0136 and we're going to reject the null hypothesis because our p-value of 0,136 it is less than the level of significance which was 0,05 and then we make the same decision any question before we start with the exercises so we still repeat the same thing that we have learned for the past three weeks then always remember that you need to know all the six steps of hypothesis testing because the questions that might they might ask you might be relating to all the six in your options they might have given you all the six steps of hypothesis testing and ask you to make a decision are there any questions before we begin no questions now okay okay so let's look at exercises so this one we can do it together and then I will give me a chance to do the other exercises on your own then we do your feedback okay okay an airline claims that only six percent of all languages is never found in a random sample of 17 out of 200 pieces of lost luggage have not found test this hypothesis they gave us the null hypothesis that the population proportion is equals to 0,06 against the alternative hypothesis which states that the population proportion is greater than 0,06 which of the following statement is incorrect first let's start unpacking the question what have they given us on here yeah so that we we are given the population proportion of six percent we are given the x value we are given the n and we are told what the hypothesis testing is remember with the null hypothesis we said it always has to have an equality sign but we can just ignore it because it's always going to have an equal sign sometimes they just put equal but what is very important it is the value of the alternative or the sign in your alternative hypothesis and this sign it says it's greater than and when it's greater than therefore it means this is a one tail test and then it means if it's a one tail test our critical value when we go find the critical value we're going to use one side of things if we're going to make a decision we're going to find two side of the rejection areas if we're going to find the p value we're only going to find the value on the table so if I scan through the option so that we don't waste a lot of time I can see that on here they're asking for p standard error test statistics p value and the null and within the decision so I can use the six steps of or the five steps of making a decision using the p value so the first step was to state the null hypothesis and alternative hypothesis they already stated that so I don't have to worry about it the second step is state what you are given we already somehow stated what we are given but we can also calculate what p is in terms of that so our p is x over n and our x is 17 over 200 and what do you get when you do the calculation so number statement number one is correct our p is 0 comma 0 8 5 are you saying that is correct is okay so that is the p but we can just continue and validate the other statements as well unless the question was looking for the incorrect one but we know that the question says we need to find the correct one but we can do all of them so these two are related because the question number three says we need to find the test statistic and the question number three says we need to find the standard error and since we do win for the proportion we can go and calculate the standard error which will be the standard error of proportions will be the square root of your population proportion 1 minus population proportion divide by n so substitute the values our population proportion always given also in the now in the hypothesis testing so this will be 0 comma 0 6 times 1 minus 0 comma 0 6 divide by our n is 200 so do the calculation 0 comma 0 1679 0 comma 0 1679 which is not that and calculate the test statistic so our test statistic will be z that i'm just gonna write the formula and then you can let's do it this way so it will be the p minus the population proportion divide by the square root of your population proportion 1 minus population proportion divide by divide by n divide by n so we can substitute the values substituting the values into the we already calculated what our standard error is because we calculated it in number two so here we just substitute the values so we have 0 comma 0 8 5 0 comma 0 8 5 minus 0 comma 0 6 divide by 0 comma 0 1 6 7 9 because we already calculated the standard error and what do you get 0.08 1.48873 we get 1.48873 which is not which is not that then remember because this is a z test so we need to take it to two decimal so when we take it to two decimal this will be 1 comma 49 so we need to take this value we need to go to the z table and look for and remember you're going to get it on the bigger side of the table so we're going to get 1 1 comma 49 so you need to go to the positive side of the table and look for 1 comma 49 that will be the last column and that will give you 0 comma 3 0 comma 9 3 I think it's 0 comma 9 3 1 9 I think it's 1 9 at the end okay so it is 0 comma 9 3 1 1 9 okay so but you need to you need to be very careful with this because we used the greater than so therefore our p value here we're going to fight remember our p value it's always going to be for the small area so we always looking for the value at the small area so it's going to be 1 minus 0 comma 9 3 1 let me go back did you say 1 9 yes 1 9 yes 0 comma 9 3 1 9 and therefore that will give you how much 1 minus 0 comma 9 3 1 9 gives you 0 comma 0 6 8 1 0 comma 0 6 8 1 6 8 1 which then also this is not correct and therefore because we're using yes when you're calculating standard error on the formula the substitutions you said look at the formula then look at the substitution you said 0 comma 0 6 in state of 0 comma 0 8 1 0 comma 0 8 on the on the formula for standard error yeah are you referring to was it supposed to be p are you referring to these values here um it's 0.06 that's what I can see it's not 0.08 we're using the population proportions so our population proportion is 0 comma 0 6 so we substitute 0 comma 0 6 so 1 minus 1 minus 0 comma 0 6 I think what you say is you you you you see where it's 0.06 brackets 1 minus 0.0 instead of 8 you should have written 6 but my writing is bad again I'm going to assume that you guys think this is 8 this is 6 okay oh I thought it's 8 okay that is why we are used to writing with a what you call this thing now with laptops so this handwriting thing I've I've never been good with handwriting so also do not get confused yeah as well this is 6 you see my 6 looks like an 8 this is 6 yeah at the end and I'm going to hope and assume that everybody calculated this correctly okay so yes okay so now we need to come to step number five and step number five the decision says if the p value is less than alpha we reject the null hypothesis right so is the how much our alpha is they didn't give us alpha on the statement but they gave us alpha here so we know what alpha is our alpha is 0 comma 1 0 our p value is 0 comma 0 6 8 1 0 comma 0 6 8 1 and and 0 comma 0 6 8 1 our p value is less than our alpha so we reject the null hypothesis so then we have a problem because we have two statements that are the same unless if their p value they left it as a 0 comma 0 instead of they left the p value as 0 comma 0 931 0 comma 931 9 so therefore it's bigger than so it will not be less it will be greater than therefore we do not reject and the statement says we reject so that won't be correct try and answer exercise to find the incorrect answer are we winning yes just going through the current just going through the question okay we have two answers that one is option two and one the other one says option three others are you winning one minute you must let me know when you're done since you said one minute okay others are you all done yes done okay so let's let's do the feedback so we're gonna go through statement by statement because I'm not gonna go through and ask you for the six steps of hypothesis so is step number one correct based on the statement yes yes it is correct because this statement says we need to determine whether the true proportion of student oh sorry of children with ASD in special needs schools in the population is 0 comma 7 5 so they never mentioned anything about greater than or less than and so forth so therefore it means it's an equality and the alternative will be it is not equal so this statement is correct we're looking for the incorrect statement step number two if this is a two tail test what will be the critical value so we are given alpha so we know that our critical value we find it using z alpha divided by two and with alpha of zero comma zero five our z critical value will be zero comma two five and we've been dealing with this zero comma zero two five we know that this will be one comma nine six so step number option number two is correct so if it was a one tail test then the critical value will be one comma nine six so you need to also know how to work out the critical veil step number oh sorry option number three the value of the test statistic is minus zero minus one comma zero nine so we know that the formula is z is equals to or z that is equals to p minus the population proportion divide by the population proportion one minus population proportion divide by n and what is our p did you calculate p p is x over n so it's 0.7 which is 0.7 so 0.7 minus 0.75 because our population proportion we can find it in the hypothesis testing the null hypothesis testing or the alternative and zero comma seven five times one minus zero comma seven five divide by hundred and what do you get what is our what is the test statistic the minus one point five four so we need to leave it to two decimals so it's just one point one one five okay now therefore it means this is incorrect but we can go through the whole question number four says the p value is this so we need to go use this value of minus one comma five four go to the table look for the p value and once you get the p value you're going to say two times the value you find on the table so go find the value on the table using one comma one five let me also go to the table minus one comma one one comma one zero comma one two five one zero comma one two five one which is the same no no two times zero comma repeat sorry one zero comma one two five one and this is zero comma two five zero two zero comma zero comma two five zero two which means that is correct so you can use the critical value to make a decision or you can use the p value to make a decision um because now our critical value if we use the critical value we have two sides of the critical value and we know this is one comma nine six which is minus and this is one comma nine six and we take not that value but this value of ours where does it fall it falls in there do not reject I don't I sometimes I don't know where does minus one comma one five fall it will fall somewhere in they do not reject and we do not reject the null hypothesis which is correct therefore you know that option three is the only incorrect statement um sometimes if you don't want to use the critical value so this is the critical value and the test statistic you can use the p value so since we know what the p value is we can use the p value of zero comma two five and if it's less than zero comma zero five we reject the null hypothesis so we two five is greater than so therefore we do not reject so whether you use the p value or you use the critical value and the test statistic we can still find the same confusion okay so let's move on with other questions a practicing statistician wants to test the following hypothesis at five percent level of significance the null hypothesis is that population proportion is equals to zero point two five the alternative population proportion is not equal this is a two-tailed test from a sample of hundred our p we are given it's zero comma two two what is the value of our test statistic so it means you need to go calculate the test statistic you know the formula write the formula and calculate are we done it could be easy and quick are we winning i think so are we done let's substitute and calculate our p was given to us which is zero comma two two minus population proportion we find it in the hypothesis which is zero comma two five divide by zero comma two five times one minus zero comma two five divide by our n which is hundred and what do you get minus zero comma nine two eight minus zero comma zero six nine which is option option three next question same based on the same information that we had our z state is minus zero comma six nine and we know that we're doing a two a two-tailed test so you need to go to the table using these two values oh sorry this z value to go find the p value i'm not gonna tell you what you need to do i just want to see your answer are you winning should be easy straightforward you go to the table go look for the value and we're doing a two-tailed so if the two-tailed is the value multiplied by two am I right yes but then the value is not there yep okay so let's see so that the the table value is is number three and if you multiply that by two that is one of the options okay so because it's a two-tailed so we're going to say two times zero point two four five one that's what you get and when you multiply this you get 0.4902 i'm going to tell you that there is actually a a type a typo i'm going to assume on this it was a typo then option number one should be the right option um i don't know how i can find the erratas of the 2020 did i take this from the 2020 yes the 2020 tutorial letter 101 next question we give it at least 95 percent at least 95 percent of equipment that that he supplied to effectively conform to the specification an examination of 700 pieces of equipment reveals that 53 are full do this provide sufficient evidence to reject the manufacturer's lay if we use alpha at 0.01 to perform the test which one of the following statement is correct when you are done are we winning are we done okay let's start at the at the top the manufacturer wants to claim at least 95 percent therefore it means uh this will be greater than or equal of the equipment so at least greater than or equal that will be the equipment uh that he supplied to the factory which is conformed to the specification and 700 of them of the pieces of equipment equipment reveal that 53 are full t and we are also given the alpha of 0.01 so we know that we're given x and n so we can calculate p which is 53 over 700 what do you get 0.0757 0.0757 which means we have found our correct answer you can also check the rest of the other answers um you can calculate the z the z steps just to check the other question the other statements our p we just calculated it is 0.0757 minus our population 0.95 divide by the square root of 0.0 0.95 times 1 minus 0.95 divide by 700 what do you get did you calculate that negative of minus 106.14 0.14 so it means that is incorrect that is incorrect and we told that the alpha is 0.01 this is incorrect because it says it's 5 percent you can also use either the p value or the critical value because we're looking at one sided test so our critical value will be z z alpha and therefore our critical value will be z of 0.01 which will be minus 2.33 we will find it on 2.33 anyway um and then you can look at whether you are rejecting the null hypothesis or the or you accepting the null hypothesis based on the critical value and the and the z state or you can use your z state to go find the p value which you might not find because the table I don't think it goes up to 106 it tops 850 or something okay so our correct answer will be option number one next question let's check the time we ma I didn't even check the time we are way out of time so there are other exercises that you can do so you have the notes I've posted it there's exercise six exercise seven eight and I will see you on Saturday when we do questions relating to hypothesis testing so I will find more questions for this Saturday and then we will do again I think probably the following Wednesday just before you go submit I think we're still on time on track so on Saturday we will do and let me just go to the calendar quickly so we are on the 14th so Saturday we will do the activity um and then we I think I'm gonna give you a break on the 21st so we're not gonna have a class on the 21st but then we're going to meet on the 24th in preparation to do the final final exercises or activities relating to hypothesis testing and then after that then we introduce Chi squared if there are no questions thank you for coming I know that we took longer than we supposed to and enjoy the rest of the evening okay thank you very much thank you bye bye