{"id":6026,"date":"2020-04-24T15:45:00","date_gmt":"2020-04-24T10:15:00","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/"},"modified":"2024-11-08T11:23:19","modified_gmt":"2024-11-08T05:53:19","slug":"hypothesis-testing-in-r-with-examples-and-case-study","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/","title":{"rendered":"Hypothesis Testing in R- Introduction Examples and Case Study"},"content":{"rendered":"\n<p><em>- By Dr. Masood H. Siddiqui, Professor &amp; Dean (Research) at Jaipuria Institute of Management, Lucknow<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"introduction-to-hypothesis-testing-in-r\"><strong>Introduction to Hypothesis Testing in R<\/strong><\/h2>\n\n\n\n<p>The premise of Data Analytics is based on the philosophy of the \u201c<strong>Data-Driven Decision Making<\/strong>\u201d that univocally states that decision-making based on data has less probability of error than those based on subjective judgement and gut-feeling. So, we require data to make decisions and to answer the business\/functional questions. Data may be collected from each and every unit\/person, connected with the problem-situation (totality related to the situation). This is known as <strong>Census<\/strong> or <strong>Complete Enumeration<\/strong> and the \u2018totality\u2019 is known as <strong>Population<\/strong>. Obv.iously, this will generally give the most optimum results with maximum correctness but this may not be always possible. Actually, it is rare to have access to information from all the members connected with the situation. So, due to practical considerations, we take up a representative<em> subset<\/em> from the population, known as <strong>Sample<\/strong>. A sample is a <em>representative<\/em> in the sense that it is expected to exhibit the properties of the population, from where it has been drawn.&nbsp;<\/p>\n\n\n\n<p>So, we have evidence (data) from the sample and we need to decide for the population on the basis of that data from the sample i.e. <em>inferring<\/em> about the population on the basis of a sample. This concept is known as <strong>Statistical Inference<\/strong>.&nbsp;<\/p>\n\n\n\n<p>Before going into details, we should be clear about certain terms and concepts that will be useful:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameter-and-statistic\"><strong>Parameter and Statistic<\/strong><\/h3>\n\n\n\n<p><strong>Parameters<\/strong> are <em>unknown constants<\/em> that <em>effectively define<\/em> the <em>population distribution<\/em>, and in turn, the <em>population<\/em>, e.g. population mean (\u00b5), population standard deviation (\u03c3), population proportion (P) etc. <strong>Statistics<\/strong> are the values <em>characterising the sample<\/em> i.e. characteristics of the sample. They are actually <em>functions of sample values<\/em> e. g. sample mean (x\u0304), sample standard deviation (s), sample proportion (p) etc.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sampling-distribution\"><strong>Sampling Distribution<\/strong><\/h3>\n\n\n\n<p>A large number of samples may be drawn from a population. Each sample may provide a value of sample statistic, so there will be a <em>distribution of sample statistic value<\/em> from all the possible samples i.e. <em>frequency distribution of sample statistic<\/em>. This is better known as <strong>Sampling distribution of the sample statistic<\/strong>. Alternatively, the sample statistic is a <em>random variable<\/em>, being a function of sample values (which are random variables themselves). The <em>probability distribution of the sample statistic<\/em> is known as sampling distribution of sample statistic. Just like any other distribution, sampling distribution may partially be described by its <em>mean<\/em> and <em>standard deviation<\/em>. The <em>standard deviation of sampling distribution of a sample statistic<\/em> is better known as the <strong>Standard Error<\/strong> of the sample statistic.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"standard-error\"><strong>Standard Error<\/strong> <\/h3>\n\n\n\n<p>It is a measure of the <em>extent of variation<\/em> among different values of statistics from different possible samples. Higher the standard error, higher is the variation among different possible values of statistics. Hence, less will be the confidence that we may place on the value of the statistic for estimation purposes. Hence, the sample statistic having a lower value of standard error is supposed to be better for estimation of the population parameter.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"example\"><span style=\"text-decoration: underline\">Example:<\/span><\/h4>\n\n\n\n<p><strong>1(a).<\/strong> A sample of size \u2018n\u2019 has been drawn for a normal population N (\u00b5, \u03c3). We are considering sample mean (x\u0304) as the sample statistic. Then, the sampling distribution of sample statistic x\u0304 will follow Normal Distribution with mean \u00b5<sub>x\u0304<\/sub> = \u00b5 and standard error \u03c3<sub>x\u0304<\/sub> = \u03c3\/<strong>\u221a<\/strong>n.<\/p>\n\n\n\n<p>Even if the population is not following the Normal Distribution but for a large sample (n = large), the sampling distribution of x\u0304 will approach to (approximated by) normal distribution with mean \u00b5<sub>x\u0304<\/sub> = \u00b5 and standard error \u03c3<sub>x\u0304<\/sub> = \u03c3\/<strong>\u221a<\/strong>n, as per the <em><a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/central-limit-theorem\" target=\"_blank\" rel=\"noreferrer noopener\">Central Limit Theorem<\/a><\/em>.&nbsp;<\/p>\n\n\n\n<p><strong>(b).<\/strong> A sample of size \u2018n\u2019 has been drawn for a normal population N (\u00b5, \u03c3), but population standard deviation \u03c3 is unknown, so in this case \u03c3 will be estimated by sample standard deviation(s). Then, sampling distribution of sample statistic x\u0304 will follow the student's t distribution (with degree of freedom = n-1) having mean \u00b5<sub>x\u0304<\/sub> = \u00b5 and standard error \u03c3<sub>x\u0304<\/sub> = s\/<strong>\u221a<\/strong>n.<\/p>\n\n\n\n<p><strong>2.<\/strong> When we consider proportions for categorical data. Sampling distribution of sample proportion p =x\/n (where x = Number of success out of a total of n) will follow Normal Distribution with mean \u00b5<sub>p<\/sub> = P and standard error \u03c3<sub>p<\/sub> = <strong>\u221a(<\/strong>PQ\/n), (where Q = 1-P). This is under the condition that n is large such that both np and nq should be minimum 5.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"statistical-inference\"><strong>Statistical Inference<\/strong><\/h3>\n\n\n\n<p>Statistical Inference encompasses two different but related problems:<\/p>\n\n\n\n<p>1. Knowing about the population-values on the basis of data from the sample. This is known as the problem of <strong>Estimation<\/strong>. This is a common problem in business decision-making because of lack of complete information and uncertainty but by using sample information, the estimate will be based on the concept of data based decision making. Here, the concept of probability is used through sampling distribution to deal with the uncertainty. If <em>sample statistics is used to estimate the population parameter<\/em>, then in that situation that is known as the <strong>Estimator; <\/strong>{like<strong> <\/strong>sample<strong> <\/strong>mean (x\u0304) to estimate population mean \u00b5, sample proportion (p) to estimate population proportion (P) etc.}. A <em>particular value of the estimator<\/em> for a given sample is known as <strong>Estimate<\/strong>. For example, if we want to estimate average sales of 1000+ outlets of a retail chain and we have taken a sample of 40 outlets and sample mean (<em>estimator<\/em>) x\u0304 is 40000. Then the estimate will be 40000.<\/p>\n\n\n\n<p>There are two types of estimation:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Point Estimation<\/strong>: Single value\/number of the estimator is used to estimate unknown population parameters. The example is given above.&nbsp;<\/li>\n\n\n\n<li><strong>Confidence Interval\/Interval Estimation<\/strong>: Interval Estimate gives two values of sample statistic\/estimator, forming an interval or range, within which an unknown population is expected to lie. This interval estimate provides confidence with the interval vis-\u00e0-vis the population parameter. For example: 95% confidence interval for population mean sale is (35000, 45000) i.e. we are 95% confident that interval estimate will contain the population parameter.<\/li>\n<\/ul>\n\n\n\n<p>2. Examining the <em>declaration\/perception\/claim<\/em> about the population for its correctness on the basis of sample data. This is known as the problem of <strong>Significant Testing<\/strong> or <strong>Testing of Hypothesis<\/strong>. This belongs to the <strong>Confirmatory Data Analysis<\/strong>,<strong> <\/strong>as<strong> <\/strong>to<strong> <\/strong>confirm or otherwise the hypothesis developed in the earlier Exploratory Data Analysis stage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"testing-of-hypothesis-in-r\"><strong>Testing of Hypothesis in R<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"one-sample-tests\"><strong>One Sample Tests<\/strong><\/h3>\n\n\n\n<p><strong>z-test - Hypothesis Testing of Population Mean when Population Standard Deviation is known:<\/strong><\/p>\n\n\n\n<p><strong>Hypothesis<\/strong> <strong>testing in R<\/strong> starts with a <em>claim or perception<\/em> of the population. <strong>Hypothesis<\/strong> may be defined as a <em>claim\/ positive declaration\/ conjecture<\/em> about the population parameter. If hypothesis defines the distribution completely, it is known as <strong>Simple Hypothesis,<\/strong> otherwise <strong>Composite Hypothesis<\/strong>.&nbsp; <\/p>\n\n\n\n<p>Hypothesis may be classified as:&nbsp;<\/p>\n\n\n\n<p><strong>Null Hypothesis (H<\/strong><strong><sub>0<\/sub><\/strong><strong>): <\/strong>Hypothesis to be tested is known as Null Hypothesis (H<sub>0<\/sub>). It is so known because it assumes no relationship or no difference from the hypothesized value of population parameter(s) or to be nullified.&nbsp;<\/p>\n\n\n\n<p><strong>Alternative Hypothesis (H<\/strong><strong><sub>1<\/sub><\/strong><strong>): <\/strong>The hypothesis <em>opposite\/complementary to the Null Hypothesis<\/em>.<\/p>\n\n\n\n<p><strong>Note:<\/strong> Here, two points are needed to be considered. First, both the hypotheses are to be constructed only for the population parameters. Second, since H<sub>0 <\/sub>is to be tested so it is H<sub>0 <\/sub>only that may be rejected or failed to be rejected (retained).<\/p>\n\n\n\n<p><strong>Hypothesis Testing: <\/strong><a href=\"\/academy\/learn-for-free\/courses\/hypothesis-testing\" target=\"_blank\" rel=\"noreferrer noopener\">Hypothesis testing<\/a> a <em>rule<\/em> or <em>statistical process<\/em> that may be resulted in either rejecting or failing to reject the null hypothesis (H<sub>0<\/sub>).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"the-five-steps-process-of-hypothesis-testing\"><strong>The Five Steps Process of Hypothesis Testing<\/strong><\/h3>\n\n\n\n<p>Here, we take an example of Testing of Mean:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"1-setting-up-the-hypothesis\"><strong>1. Setting up the Hypothesis: <\/strong><\/h4>\n\n\n\n<p>This step is used to <em>define the problem<\/em> after considering the business situation and deciding the relevant hypotheses H<sub>0<\/sub> and H<sub>1<\/sub>, after mentioning the hypotheses in the business language.<\/p>\n\n\n\n<p>We are considering the random variable X = Quarterly sales of the sales executive working in a big FMCG company. <strong>Here, we assume that sales follow normal distribution with mean \u00b5 (unknown) and standard deviation<\/strong><strong> \u03c3<\/strong><strong> (known)<\/strong>. The value of the population parameter (population mean) to be tested be \u00b5<sub>0 <\/sub>(Hypothesised Value).<\/p>\n\n\n\n<p>Here the hypothesis may be:<\/p>\n\n\n\n<p>H<sub>0<\/sub>: \u00b5 = \u00b5<sub>0&nbsp; <\/sub>or \u00b5 \u2264 \u00b5<sub>0&nbsp; <\/sub>or \u00b5 \u2265 \u00b5<sub>0 <\/sub>&nbsp;(here, the first one is <em>Simple Hypothesis<\/em>, rest two variants are <em>composite hypotheses<\/em>)&nbsp;<\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5 &gt; \u00b5<sub>0 <\/sub>or<\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5 &lt; \u00b5<sub>0 <\/sub>or<\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5 \u2260 \u00b5<sub>0&nbsp;<\/sub><\/p>\n\n\n\n<p>(Here, all three variants are <em>Composite Hypothesis<\/em>)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"2-defining-test-and-test-statistic\"><strong>2. Defining Test and Test Statistic:<\/strong><\/h4>\n\n\n\n<p>The test is the statistical rule\/process of deciding to \u2018reject\u2019 or \u2018fail to reject\u2019 (retain) the H0. It consists of dividing the sample space (the totality of all the possible outcomes) into two complementary parts. One part, providing the <em>rejection of H<sub>0<\/sub><\/em>, known as <strong>Critical Region<\/strong>. The other part, representing the <em>failing to reject H<sub>0 <\/sub>situation<\/em>, is known as <strong>Acceptance Region<\/strong>.<\/p>\n\n\n\n<p>The logic is, since we have evidence only from the sample, we use sample data to decide about the rejection\/retaining of the hypothesised value. Sample, in principle, can never be a perfect replica of the population so we do expect that there will be variation in between population and sample values. So the issue is not the difference but <em>actually the magnitude of difference<\/em>. Suppose, we want to test the claim that the average quarterly sale of the executive is 75k vs sale is below 75k. Here, the hypothesised value for the population mean is \u00b5<sub>0<\/sub>=75 i.e.<\/p>\n\n\n\n<p>H<sub>0<\/sub>: \u00b5 = 75<\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5 &lt; 75.<\/p>\n\n\n\n<p>Suppose from a sample, we get a value of sample mean x\u0304=73. Here, the difference is too small to reject the claim under H<sub>0 <\/sub>since the chances (probability) of happening of such a random sample is quite large so we will retain H<sub>0<\/sub>. Suppose, in some other situation, we get a sample with a sample mean x\u0304=33. Here, the difference between the sample mean and hypothesised population mean is too large. So the claim under H<sub>0<\/sub> may be rejected as the chance of having such a sample for this population is quite low.<\/p>\n\n\n\n<p>So, there must be some dividing value (s) that differentiates between the two decisions: rejection (critical region) and retention (acceptance region), this boundary value is known as the <strong>critical value<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"type-i-and-type-ii-error\"><strong><span style=\"text-decoration: underline\">Type I and Type II Error: <\/span><\/strong><\/h4>\n\n\n\n<p>There are two types of situations (H<sub>0 <\/sub>is true or false) which are complementary to each other and two types of complementary decisions (Reject H<sub>0<\/sub> or Failing to Reject H<sub>0<\/sub>). So we have four types of cases:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><br><\/td><td> H<sub>0 <\/sub>is True<\/td><td>H<sub>0 <\/sub>is False<\/td><\/tr><tr><td>Reject H<sub>0<\/sub><\/td><td>Type I Error<\/td><td>Correct Decision<\/td><\/tr><tr><td>Fails to Reject H<sub>0<\/sub><\/td><td>Correct Decision<\/td><td>Type II Error<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>So, the two possible errors in hypothesis testing can be:<\/p>\n\n\n\n<p>Type I Error = [Reject H<sub>0<\/sub> when H<sub>0<\/sub> is true]<\/p>\n\n\n\n<p>Type II Error = [Fails to reject H<sub>0 <\/sub>when H<sub>0 <\/sub>is false].<\/p>\n\n\n\n<p><strong>Type I Error<\/strong> is also known as <strong>False Positive<\/strong> and <strong>Type II Error<\/strong> is also known as <strong>False Negative<\/strong> in the language of Business Analytics.<\/p>\n\n\n\n<p>Since these two are probabilistic events, so we measure them using probabilities:<\/p>\n\n\n\n<p>\u03b1 = Probability of committing Type I error = P [Reject H<sub>0<\/sub> \/ H<sub>0<\/sub> is true]&nbsp;<\/p>\n\n\n\n<p>\u03b2 = Probability of committing Type II error = P [Fails to reject H<sub>0 <\/sub>\/ H<sub>0 <\/sub>is false].<\/p>\n\n\n\n<p>For a good testing procedure, both types of errors should be low (minimise \u03b1 and \u03b2) but simultaneous minimisation of both the errors is not possible because they are interconnected. If we minimize one, the other will increase and vice versa. So, one error is fixed and another is tried to be minimised. <em>Normally \u03b1 is fixed and we try to minimise <\/em>\u03b2. If Type I error is critical, \u03b1 is fixed at a <em>low value <\/em>(allowing \u03b2 to take relatively high value) otherwise at <em>relatively high value<\/em> (to minimise \u03b2 to a low value, Type II error being critical).<\/p>\n\n\n\n<p>Example: In Indian Judicial System we have H<sub>0<\/sub>: Under trial is innocent. Here, Type I Error = An innocent person is sentenced, while Type II Error = A guilty person is set free. Indian (Anglo Saxon) Judicial System considers type I error to be critical so it will have low \u03b1 for this case.<\/p>\n\n\n\n<p><strong>Power of the test <\/strong>= 1- \u03b2 = P [Reject H<sub>0 <\/sub>\/ H<sub>0 <\/sub>is false].<\/p>\n\n\n\n<p>Higher the power of the test, better it is considered and we look for the Most Powerful Test since <strong>power of test<\/strong> can be taken as the probability that the test will detect a deviation from H<sub>0<\/sub> given that the deviation exists.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"one-tailed-and-two-tailed-tests-of-hypothesis\"><strong><span style=\"text-decoration: underline\">One Tailed and Two Tailed Tests of Hypothesis:<\/span><\/strong><\/h4>\n\n\n\n<p><strong>Case I:<\/strong><\/p>\n\n\n\n<p>H<sub>0<\/sub>: \u00b5 \u2264 \u00b5<sub>0&nbsp;&nbsp;<\/sub><\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5 &gt; \u00b5<sub>0&nbsp;<\/sub><\/p>\n\n\n\n<p>When x\u0304 is significantly above the hypothesized population mean \u00b5<sub>0<\/sub> then H<sub>0<\/sub> will be rejected and the test used will be right tailed test (upper tailed test) since the critical region (denoting rejection of H<sub>0<\/sub> will be in the right tail of the normal curve (representing sampling distribution of sample statistic x\u0304). (The critical region is shown as a shaded portion in the figure).<\/p>\n\n\n\n<p><strong>Case II:<\/strong><\/p>\n\n\n\n<p>H<sub>0<\/sub>: \u00b5 \u2265 \u00b5<sub>0<\/sub><\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5 &lt; \u00b5<sub>0&nbsp;<\/sub><\/p>\n\n\n\n<p>In<sub> <\/sub>this case, if x\u0304 is significantly below the hypothesised population mean \u00b5<sub>0<\/sub> then H<sub>0<\/sub> will be rejected and the test used will be the left tailed test (lower tailed test) since the critical region (denoting rejection of H<sub>0<\/sub>) will be in the left tail of the normal curve (representing sampling distribution of sample statistic x\u0304). (The critical region is shown as a shaded portion in the figure).<\/p>\n\n\n\n<p>These two tests are also known as <strong>One-tailed tests<\/strong> as there will be a critical region in only one tail of the sampling distribution.<\/p>\n\n\n\n<p><strong>Case III:<\/strong><\/p>\n\n\n\n<p>H<sub>0<\/sub>: \u00b5 = \u00b5<sub>0<\/sub><\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5 \u2260 \u00b5<sub>0<\/sub><\/p>\n\n\n\n<p>When x\u0304 is significantly different (significantly higher or lower than) from the hypothesised population mean \u00b5<sub>0<\/sub>, then H<sub>0<\/sub> will be rejected. In<sub> <\/sub>this case, the two tailed test will be applicable because there will be two critical regions (denoting rejection of H<sub>0<\/sub>) on both the tails of the normal curve (representing sampling distribution of sample statistic x\u0304). (The critical regions are shown as shaded portions in the figure).&nbsp;<\/p>\n\n\n\n<p><strong>Hypothesis Testing using Standardized Scale: <\/strong>Here, instead of measuring sample statistic (variable) in the original unit, standardised value is taken (better known as <strong>test statistic<\/strong>). So, the comparison will be between observed value of test statistic (estimated from sample), and critical value of test statistic (obtained from relevant theoretical probability distribution).<\/p>\n\n\n\n<p>Here, since population standard deviation (\u03c3) is known, so the <em>test statistics<\/em>:<\/p>\n\n\n\n<p>Z= &nbsp;(x- \u00b5x\u0304<sub>x<\/sub>)\/\u03c3 x\u0304 = (x- \u00b5<sub>0<\/sub>)\/(\u03c3\/\u221an)&nbsp; follows Standard Normal Distribution N (0, 1).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"3-deciding-the-criteria-for-rejection-or-otherwise\"><strong>3.Deciding the Criteria for Rejection or otherwise:<\/strong><\/h4>\n\n\n\n<p>As discussed, hypothesis testing means deciding a rule for rejection\/retention of H<sub>0<\/sub>. Here, the critical region decides rejection of H<sub>0 <\/sub>and there will be a value, known as <strong>Critical Value<\/strong>, to define the boundary of the critical region\/acceptance region. The size (probability\/area) of a critical region is taken as <strong>\u03b1<\/strong>. Here, \u03b1 may be known as <strong>Significance Level<\/strong>, the level at which hypothesis testing is performed. It is equal to <em>type I error<\/em>, as discussed earlier.<\/p>\n\n\n\n<p>Suppose, \u03b1 has been decided as 5%, so the critical value of test statistic (Z) will be +1.645 (for right tail test), -1.645 (for left tail test). For the two tails test, the critical value will be -1.96 and +1.96 (as per the Standard Normal Distribution Z table). The value of \u03b1 may be chosen as per the criticality of type I and type II. Normally, the value of \u03b1 is taken as 5% in most of the analytical situations (Fisher, 1956).&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"4-taking-sample-data-collection-and-estimating-the-observed-value-of-test-statistic\"><strong>4. Taking sample, data collection and estimating the observed value of test statistic:<\/strong><\/h4>\n\n\n\n<p>In this stage, a proper sample of size n is taken and after collecting the data, the values of sample mean (x\u0304) and the observed value of test statistic Z<sub>obs<\/sub> is being estimated, as per the test statistic formula.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"5-taking-the-decision-to-reject-or-otherwise\"><strong>5. Taking the Decision to reject or otherwise:<\/strong><\/h4>\n\n\n\n<p>On <em>comparing<\/em> the observed value of Test statistic with that of the critical value, we may identify whether the observed value lies in the critical region (reject H<sub>0<\/sub>) or in the acceptance region (do not reject H<sub>0<\/sub>) and decide accordingly.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Right Tailed Test:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Z<sub>obs<\/sub> &gt; 1.645&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: Reject H<sub>0<\/sub> at 5% Level of Significance.<\/li>\n\n\n\n<li>Left Tailed Test: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If Z<sub>obs<\/sub> &lt; -1.645 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: Reject H<sub>0<\/sub> at 5% Level of Significance.<\/li>\n\n\n\n<li>Two Tailed Test:&nbsp; &nbsp; If Z<sub>obs<\/sub> &gt; 1.96 or If Z<sub>obs<\/sub> &lt; -1.96&nbsp;  : Reject H<sub>0<\/sub> at 5% Level of Significance.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"p-value-an-alternative-way-of-hypothesis-testing\"><strong>p-value: An Alternative way of Hypothesis Testing:<\/strong><\/h2>\n\n\n\n<p>There is an alternative approach for hypothesis testing, this approach is very much used in all the software packages. It is known as <strong>probability value\/ prob. value\/ p-value. <\/strong>It gives the probability of getting a value of statistic this far or farther from the hypothesised value if H0 is true. This denotes how likely is the result that we have observed. It may be further explained as the probability of observing the test statistic if H<sub>0 <\/sub>is true i.e. what are the chances in support of occurrence of H<sub>0<\/sub>. If p-value is small, it means there are less chances (rare case) in favour of H<sub>0<\/sub> occuring, as the difference between a sample value and hypothesised value is significantly large so H<sub>0 <\/sub>may be rejected, otherwise it may be retained.<\/p>\n\n\n\n<p>If p-value &lt; \u03b1 &nbsp; &nbsp; &nbsp; \t: Reject H<sub>0<\/sub><\/p>\n\n\n\n<p>If p-value \u2265 \u03b1        : Fails to Reject H<sub>0<\/sub> <\/p>\n\n\n\n<p>So, it may be mentioned that the level of significance (\u03b1) is the maximum threshold for p-value. It should be noted that p-value (two tailed test) = 2* p-value (one tailed test).&nbsp;<\/p>\n\n\n\n<p><strong>Note: <\/strong>Though the application of z-test requires the \u2018Normality Assumption\u2019 for the parent population with known standard deviation\/ variance but if sample is large (n&gt;30), the normality assumption for the parent population may be relaxed, provided population standard deviation\/variance is known (as per Central Limit Theorem).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"t-test-hypothesis-testing-of-population-mean-when-population-standard-deviation-is-unknown\"><strong>t-test: Hypothesis Testing of Population Mean when Population Standard Deviation is Unknown:<\/strong><\/h2>\n\n\n\n<p>As we discussed in the previous case, for testing of population mean, we assume that sample has been drawn from the population following normal distribution mean \u00b5 and standard deviation \u03c3. In this case test statistic Z = (x- \u00b5<sub>0<\/sub>)\/(\u03c3\/\u221an)&nbsp; ~ Standard Normal Distribution N (0, 1). But in the situations where population s.d. \u03c3 is not known (it is a very common situation in all the real life business situations), we estimate population s.d. (\u03c3) by sample s.d. (s).<\/p>\n\n\n\n<p>Hence the corresponding test statistic:&nbsp;<\/p>\n\n\n\n<p>t= &nbsp;(x- \u00b5x\u0304<sub>x<\/sub>)\/\u03c3 x\u0304 = (x- \u00b5<sub>0<\/sub>)\/(s\/\u221an)&nbsp;follows Student\u2019s t distribution with (n-1) degrees of freedom. One degree of freedom has been sacrificed for estimating population s.d. (\u03c3) by sample s.d. (s).<\/p>\n\n\n\n<p>Everything else in the testing process remains the same.&nbsp;<\/p>\n\n\n\n<p>t-test is not much affected if assumption of normality is violated provided data is slightly asymmetrical (near to symmetry) and data-set does not contain outliers.&nbsp;&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"t-distribution\"><strong>t-distribution: <\/strong><\/h4>\n\n\n\n<p>The Student's t-distribution, is much similar to the normal distribution. It is a symmetric distribution (bell shaped distribution). In general Student\u2019s t distribution is flatter i.e. having heavier tails. Shape of t distribution changes with degrees of freedom (exact distribution) and becomes approximately close to Normal distribution for large n.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"two-samples-tests-hypothesis-testing-for-the-difference-between-two-population-means\"><strong>Two Samples Tests: Hypothesis Testing for the difference between two population means<\/strong><\/h2>\n\n\n\n<p>In many business decision making situations, decision makers are interested in comparison of two populations i.e. interested in examining the difference between two population parameters. Example: comparing sales of rural and urban outlets, comparing sales before the advertisement and after advertisement, comparison of salaries in between male and female employees, comparison of salary before and after joining the data science courses etc.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"independent-samples-and-dependent-paired-samples\"><strong>Independent Samples and Dependent (Paired Samples): <\/strong><\/h3>\n\n\n\n<p>Depending on method of collection data for the two samples, samples may be termed as <strong>independent<\/strong> or <strong>dependent<\/strong> samples. If two samples are drawn independently without any relation (may be from different units\/respondents in the two samples), then it is said that samples are drawn <strong>independently<\/strong>. If samples are related or paired or having two observations at different points of time on the same unit\/respondent, then the samples are said to be <strong>dependent<\/strong> or <strong>paired<\/strong>.&nbsp; This approach (paired samples) enables us to compare two populations after controlling the extraneous effect on them.&nbsp;&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"testing-the-difference-between-means-independent-samples\"><strong>Testing the Difference Between Means: Independent Samples<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"two-samples-z-test\"><strong><span style=\"text-decoration: underline\">Two Samples Z Test:<\/span><\/strong><\/h4>\n\n\n\n<p>We have two populations, both following Normal populations as N (\u00b5<sub>1<\/sub>, \u03c3<sub>1<\/sub>) and N (\u00b5<sub>2<\/sub>, \u03c3<sub>2<\/sub>). We want to test the Null Hypothesis:<\/p>\n\n\n\n<p>H<sub>0<\/sub>: \u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub>= \u03b8 or \u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub>\u2264 \u03b8 or \u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub>\u2265 \u03b8&nbsp;<\/p>\n\n\n\n<p>Alternative hypothesis:<\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub>&gt; \u03b8 or<\/p>\n\n\n\n<p>H<sub>0<\/sub>: \u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub>&lt; \u03b8 or<\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub>\u2260 \u03b8&nbsp;<\/p>\n\n\n\n<p>(where \u03b8 may take any value as per the situation or \u03b8 =0).&nbsp;<\/p>\n\n\n\n<p>Two samples of size n<sub>1<\/sub> and n<sub>2<\/sub> have been taken randomly from the two normal populations respectively and the corresponding sample means are x\u0304<sub>1<\/sub> and x\u0304<sub>2<\/sub>.<\/p>\n\n\n\n<p>Here, we are not interested in individual population parameters (means) but in the difference of population means (\u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub>). So, the corresponding statistic is = (x\u0304<sub>1<\/sub> - x\u0304<sub>2<\/sub>).<\/p>\n\n\n\n<p>According, sampling distribution of the statistic (x\u0304<sub>1<\/sub> - x\u0304<sub>2<\/sub>) will follow Normal distribution with mean \u00b5<sub>x\u0304<\/sub> = \u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub> and standard error \u03c3<sub>x\u0304 <\/sub>= \u221a (\u03c3\u00b2<sub>1<\/sub>\/ n<sub>1 <\/sub>+ \u03c3\u00b2<sub>2<\/sub>\/ n<sub>2<\/sub>). So, the corresponding Test Statistics will be:&nbsp;<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-1-2.png\"><img decoding=\"async\" width=\"239\" height=\"61\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-1-2.png\" alt=\"\" class=\"wp-image-13765\"><\/figure>\n\n\n\n<p>Other things remaining the same as per the One Sample Tests (as explained earlier).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"two-independent-samples-t-test-when-population-standard-deviations-are-unknown\"><strong><span style=\"text-decoration: underline\">Two Independent Samples t-Test (when Population Standard Deviations are Unknown):<\/span><\/strong><\/h4>\n\n\n\n<p>Here, for testing the difference of two population mean, we assume that samples have been drawn from populations following Normal Distributions, but it is a very common situation that population standard deviations (\u03c3<sub>1<\/sub> and \u03c3<sub>2<\/sub>) are unknown. So they are estimated by sample standard deviations (s<sub>1<\/sub> and s<sub>2<\/sub>) from the respective two samples.<\/p>\n\n\n\n<p>Here, two situations are possible:<\/p>\n\n\n\n<p><strong>(a)<\/strong> <strong>Population Standard Deviations are unknown but equal:<\/strong><\/p>\n\n\n\n<p>In this situation (where \u03c3<sub>1<\/sub> and \u03c3<sub>2 <\/sub>are unknown but assumed to be equal), sampling distribution of the statistic (x\u0304<sub>1<\/sub> - x\u0304<sub>2<\/sub>) will follow Student\u2019s t distribution with mean \u00b5<sub>x\u0304<\/sub> = \u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub> and standard error \u03c3<sub>x\u0304 <\/sub>= \u221a Sp<sup>2<\/sup>(1\/ n<sub>1 <\/sub>+ 1\/ n<sub>2<\/sub>).&nbsp; Where Sp<sup>2<\/sup> is the pooled estimate, given by:<\/p>\n\n\n\n<p>Sp<sup>2<\/sup> = (n<sub>1<\/sub>-1) S<sub>1<\/sub><sup>2<\/sup>+(n<sub>2<\/sub>-1) S<sub>2<\/sub><sup>2 <\/sup>\/(n<sub>1<\/sub>+n<sub>2<\/sub>-2)<\/p>\n\n\n\n<p>So, the corresponding Test Statistics will be:&nbsp;<\/p>\n\n\n\n<p>t =&nbsp; {(x\u0304<sub>1<\/sub> - x\u0304<sub>2<\/sub>) \u2013 (\u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub>)}\/{\u221a Sp<sup>2<\/sup>(1\/n<sub>1 <\/sub>+1\/n<sub>2<\/sub>)}<\/p>\n\n\n\n<p>Here, t statistic will follow t distribution with d.f. (n<sub>1<\/sub>+n<sub>2<\/sub>-2).<\/p>\n\n\n\n<p><strong>(b) Population Standard Deviations are unknown but unequal:<\/strong><\/p>\n\n\n\n<p>In this situation (where \u03c3<sub>1<\/sub> and \u03c3<sub>2 <\/sub>are unknown and unequal).<\/p>\n\n\n\n<p>Then the sampling distribution of the statistic (x\u0304<sub>1<\/sub> - x\u0304<sub>2<\/sub>) will follow Student\u2019s t distribution with mean \u00b5<sub>x\u0304<\/sub> = \u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub> and standard error Se<sub> <\/sub>=\u221a (s\u00b2<sub>1<\/sub>\/ n<sub>1 <\/sub>+ s\u00b2<sub>2<\/sub>\/ n<sub>2<\/sub>).&nbsp;<\/p>\n\n\n\n<p>So, the corresponding Test Statistics will be:&nbsp;<\/p>\n\n\n\n<p>t =&nbsp; {(x\u0304<sub>1<\/sub> - x\u0304<sub>2<\/sub>) \u2013 (\u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub>)}\/{\u221a (s2<sub>1<\/sub>\/n<sub>1 <\/sub>+s2<sub>2<\/sub>\/n<sub>2<\/sub>)}<\/p>\n\n\n\n<p>The test statistic will follow Student\u2019s t distribution with degrees of freedom (rounding down to nearest integers):<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo2-2.png\"><img decoding=\"async\" width=\"168\" height=\"54\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo2-2.png\" alt=\"\" class=\"wp-image-13766\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"hypothesis-testing-for-equality-of-population-variances\"><strong>Hypothesis Testing for Equality of Population Variances<\/strong><\/h2>\n\n\n\n<p>As discussed in the aforementioned two cases, it is important to figure out whether the two population variances are equal or otherwise. For this purpose, F test can be employed as:<\/p>\n\n\n\n<p>H<sub>0<\/sub>: \u03c3\u00b2<sub>1<\/sub> = \u03c3\u00b2<sub>2 <\/sub>and H<sub>1<\/sub>: \u03c3\u00b2<sub>1<\/sub> \u2260 \u03c3\u00b2<sub>2<\/sub><\/p>\n\n\n\n<p>Two samples of sizes n<sub>1<\/sub> and n<sub>2<\/sub> have been drawn from two populations respectively. They provide sample standard deviations s<sub>1<\/sub> and s<sub>2<\/sub>. The test statistic is F =&nbsp; s<sub>1<\/sub>\u00b2\/s<sub>2<\/sub>\u00b2<\/p>\n\n\n\n<p>The test statistic will follow F-distribution with (n<sub>1<\/sub>-1) df for numerator and (n<sub>2<\/sub>-1) df for denominator.<\/p>\n\n\n\n<p><strong>Note: <\/strong>There are many other tests that are applied for this purpose.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"paired-sample-t-test-testing-difference-between-means-with-dependent-samples\"><strong>Paired Sample t-Test (Testing Difference between Means with Dependent Samples):<\/strong><\/h3>\n\n\n\n<p>As discussed earlier, in the situation of Before-After Tests, to examine the impact of any intervention like a training program, health program, any campaign to change status, we have two set of observations (x<sub>i <\/sub>and y<sub>i<\/sub>) on the same test unit (respondent or units) before and after the program. Each sample has \u201cn\u201d paired observations. The Samples are said to be dependent or paired.<\/p>\n\n\n\n<p>Here, we consider a random variable: d<sub>i <\/sub>= x<sub>i <\/sub>- y<sub>i<\/sub>.&nbsp;<\/p>\n\n\n\n<p>Accordingly, the sampling distribution of the sample statistic (sample mean of the differentces d<sub>i<\/sub>\u2019s) will follow Student\u2019s t distribution with mean = \u03b8 and standard error = sd\/<strong>\u221a<\/strong>n, where sd is the sample standard deviation of d<sub>i<\/sub>\u2019s.<\/p>\n\n\n\n<p>Hence, the corresponding test statistic: t = (d\u0305- \u03b8)\/sd\/\u221an will follow t distribution with (n-1).<\/p>\n\n\n\n<p>As we have observed, paired t-test is actually one sample test since two samples got converted into one sample of differences. If \u2018Two Independent Samples t-Test\u2019 and \u2018Paired t-test\u2019 are applied on the same data set then two tests will give much different results because in case of Paired t-Test, standard error will be quite low as compared to Two Independent Samples t-Test. The Paired t-Test is applied essentially on one sample while the earlier one is applied on two samples. The result of the difference in standard error is that t-statistic will take larger value in case of \u2018Paired t-Test\u2019 in comparison to the \u2018Two Independent Samples t-Test and finally p-values get affected accordingly.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"t-test-in-spss\"><strong>t-Test in SPSS:<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"one-sample-t-test\"><strong><span style=\"text-decoration: underline\">One Sample t-test<\/span><\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Analyze<\/strong> =&gt; <strong>Compare Means<\/strong>=&gt; <strong>One-Sample T-Test<\/strong> to open relevant dialogue box.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Test variable (variable under consideration) in the <strong>Test variable(s)<\/strong> box and hypothesised value \u00b5<sub>0<\/sub>= 75 (for example) in the <strong>Test Value<\/strong> box are to be entered.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Press <strong>Ok<\/strong> to have the output.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Here, we consider the example of Ventura Sales, and want to examine the perception that average sales in the first quarter is 75 (thousand) vs it is not. So, the Hypotheses:<\/p>\n\n\n\n<p>Null Hypothesis H<sub>0<\/sub>: \u00b5=75<sub>&nbsp;<\/sub><\/p>\n\n\n\n<p>Alternative Hypothesis H<sub>1<\/sub>: \u00b5\u226075<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"t-test\"><strong><span style=\"text-decoration: underline\">T-Test<\/span><\/strong><\/h4>\n\n\n\n<p> <strong>One-Sample Statistics<\/strong> <\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><br><\/td><td>N<\/td><td>Mean<\/td><td>Std. Deviation<\/td><td>Std. Error Mean<\/td><\/tr><tr><td>Sale of the outlet in 1st Quarter(Rs.'000)<\/td><td>60<\/td><td>72.02<\/td><td>9.724<\/td><td>1.255<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Descriptive table showing the sample size n = 60, sample mean x\u0304=72.02, sample sd s=9.724.<\/p>\n\n\n\n<p> <strong>One-Sample Test<\/strong> <\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-3-2.png\"><img decoding=\"async\" width=\"733\" height=\"117\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-3-2.png\" alt=\"\" class=\"wp-image-13771\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-3-2.png 733w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-3-2-300x48.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-3-2-696x111.png 696w\" sizes=\"(max-width: 733px) 100vw, 733px\" \/><\/figure>\n\n\n\n<p>One Sample Test Table shows the result of the t-test. Here, test statistic value (from the sample) is t = -2.376 and the corresponding p-value (2 tailed) = 0.021 &lt;0.05. So, H<sub>0<\/sub> got rejected and it can be said that the claim of average first quarterly sales being 75 (thousand) does not hold.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"two-independent-samples-t-test\"><strong><span style=\"text-decoration: underline\">Two Independent Samples t-Test<\/span><\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Analyze<\/strong> =&gt; <strong>Compare Means<\/strong>=&gt; <strong>Independent-Samples T-Test to open the dialogue box.<\/strong><\/li>\n\n\n\n<li><strong>Enter the Test variable (variable under consideration) in the Test Variable(s)<\/strong> box and variable categorising the groups in the <strong>Grouping Variable<\/strong> box.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Define the groups by clicking on <strong>Define Groups<\/strong> and enter the relevant numeric-codes into the relevant groups in the <strong>Define Groups<\/strong> sub-dialogue box. Press <strong>Continue<\/strong> to return back to the main dialogue box.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Press <strong>Ok<\/strong> to have the output.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>We continue with the example of Ventura Sales, and want to compare the average first quarter sales with respect to Urban Outlets and Rural Outlets (two independent samples\/groups). Here, the claim is that urban outlets are giving lower sales as compared to rural outlets. So, the Hypotheses:<\/p>\n\n\n\n<p>H<sub>0<\/sub>: \u00b5<sub>1<\/sub>- \u00b5<sub>2<\/sub>= 0 or \u00b5<sub>1<\/sub>= \u00b5<sub>2<\/sub>&nbsp; (Where, \u00b5<sub>1<\/sub>= Population Mean Sale of Urban Outlets and \u00b5<sub>2 <\/sub>= Population Mean Sale of Rural Outlets)<\/p>\n\n\n\n<p>Alternative hypothesis:<\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5<sub>1<\/sub>&lt; \u00b5<sub>2<\/sub>&nbsp;<\/p>\n\n\n\n<p> <strong>Group Statistics<\/strong> <\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><br><\/td><td>Type of Outlet<\/td><td>N<\/td><td>Mean<\/td><td>Std. Deviation<\/td><td>Std. Error Mean<\/td><\/tr><tr><td>Sale of the outlet in 1st Quarter(Rs.'000)<\/td><td>Urban Outlet<\/td><td>37<\/td><td>67.86<\/td><td>8.570<\/td><td>1.409<\/td><\/tr><tr><td> Rural Outlet <\/td><td> Rural Outlet <\/td><td> 23 <\/td><td> 78.70 <\/td><td> 7.600 <\/td><td>1.585<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Descriptive table showing the sample sizes n<sub>1<\/sub>=37 and n<sub>2<\/sub>=23, sample means x\u0304<sub>1<\/sub>=67.86 and x\u0304<sub>2<\/sub>=78.70, sample standard deviations s<sub>1<\/sub>=8.570 and s<sub>2<\/sub>= 7.600.<\/p>\n\n\n\n<p>The below table is the Independent Sample Test Table, proving all the relevant test statistics and p-values.&nbsp; Here, both the outputs for Equal Variance (assumed) and Unequal Variance (assumed) are presented.<\/p>\n\n\n\n<p> <strong>Independent Samples Test<\/strong> <\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo4-2.png\"><img decoding=\"async\" width=\"732\" height=\"299\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo4-2.png\" alt=\"\" class=\"wp-image-13774\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo4-2.png 732w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo4-2-300x123.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo4-2-696x284.png 696w\" sizes=\"(max-width: 732px) 100vw, 732px\" \/><\/figure>\n\n\n\n<p>So, we have to figure out whether we should go for \u2018equal variance\u2019 case or for \u2018unequal variances\u2019 case.&nbsp;<\/p>\n\n\n\n<p>Here, Levene's Test for Equality of Variances has to be applied for this purpose with the hypotheses: H<sub>0<\/sub>: \u03c3\u00b2<sub>1<\/sub> = \u03c3\u00b2<sub>2 <\/sub>and H<sub>1<\/sub>: \u03c3\u00b2<sub>1<\/sub> \u2260 \u03c3\u00b2<sub>2<\/sub>. The p-value (Sig) = 0.460 &gt;0.05, so we can\u2019t reject (so retained) H<sub>0<\/sub>. Hence, variances can be assumed to be equal.&nbsp;<\/p>\n\n\n\n<p>So, \u201cEqual Variances assumed\u201d case is to be taken up. Accordingly, the value of t statistic = -4.965 and the p-value (two tailed) = 0.000, so the p-value (one tailed) = 0.000\/2 = 0.000 &lt;0.05. Hence, H<sub>0<\/sub> got rejected and it can be said that urban outlets are giving lower sales in the first quarter. So, the claim stands.<\/p>\n\n\n\n<p><strong>Paired t-Test (Testing Difference between Means with Dependent Samples):<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&nbsp;<strong>Analyze<\/strong> =&gt; <strong>Compare Means<\/strong>=&gt; <strong>Paired-Samples T-Test<\/strong> to open the dialogue box.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter the relevant pair of variables (paired samples) in the <strong>Paired Variables<\/strong> box.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After entering the paired samples, press <strong>Ok<\/strong> to have the output.<\/li>\n<\/ul>\n\n\n\n<p>We continue with the example of Ventura Sales, and want to compare the average first quarter sales with the second quarter sales. Some sales promotion interventions were executed with an expectation of increasing sales in the second quarter. So, the Hypotheses:<\/p>\n\n\n\n<p>H<sub>0<\/sub>: \u00b5<sub>1<\/sub>= \u00b5<sub>2<\/sub> (Where, \u00b5<sub>1<\/sub>= Population Mean Sale of Quarter-I and \u00b5<sub>2 <\/sub>= Population Mean Sale of Quarter-II)<\/p>\n\n\n\n<p>Alternative hypothesis:<\/p>\n\n\n\n<p>H<sub>1<\/sub>: \u00b5<sub>1<\/sub>&lt; \u00b5<sub>2<\/sub> (representing the increase of sales i.e. implying the success of sales interventions)<\/p>\n\n\n\n<p> <strong>Paired Samples Statistics<\/strong> <\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo5-2.png\"><img decoding=\"async\" width=\"711\" height=\"109\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo5-2.png\" alt=\"\" class=\"wp-image-13775\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo5-2.png 711w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo5-2-300x46.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo5-2-696x107.png 696w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><\/figure>\n\n\n\n<p>Descriptive table showing the sample size n=60, sample means x\u0304<sub>1<\/sub>=72.02 and x\u0304<sub>2<\/sub>=72.43.<\/p>\n\n\n\n<p>As per the following output table (Paired Samples Test), sample mean of differences d\u0305 = -0.417 with standard deviation of differences sd = 8.011 and value of t statistic = -0.403. Accordingly, the p-value (two tailed) = 0.688, so the p-value (one tailed) = 0.688\/2 = 0.344 &gt; 0.05. So, there have not been sufficient reasons to Reject H<sub>0<\/sub> i.e. H<sub>0<\/sub> should be retained. So, the effectiveness (success) of the sales promotion interventions is doubtful i.e. it didn\u2019t result in significant increase in sales, provided all other extraneous factors remain the same.<\/p>\n\n\n\n<p> <strong>Paired Samples Test<\/strong> &nbsp;&nbsp;<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-6-2.png\"><img decoding=\"async\" width=\"716\" height=\"315\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-6-2.png\" alt=\"\" class=\"wp-image-13783\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-6-2.png 716w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-6-2-300x132.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/03\/hypo-6-2-696x306.png 696w\" sizes=\"(max-width: 716px) 100vw, 716px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"lets-look-at-some-case-studies\"><b>Let\u2019s Look at some Case studies:<\/b><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"t-test-application-one-sample\"><strong>t-Test Application One Sample<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">Experience Marketing Services reported that the typical American spends a mean of 144 minutes (2.4 hours) per day accessing the Internet via a mobile device. (Source: The 2014 Digital Marketer, available at ex.pn\/1kXJifX.) To test the validity of this statement, you select a sample of 30 friends and family. The result for the time spent per day accessing the Internet via a mobile device (in minutes) are stored in Internet_Mobile_Time.csv file.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">Is there evidence that the populations mean time spent per day accessing the Internet via a mobile device is different from 144 minutes? Use the p-value approach and a level of significance of 0.05<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">What assumption about the population distribution is needed to conduct the test in A?<\/span><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"solution-in-r\"><span style=\"font-weight: 400\"><strong>Solution In R<\/strong><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">&gt;setwd(\"D:\/Hypothesis\")\n&gt; Mydata=read.csv(\"InternetMobileTime.csv\", header = TRUE)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400\">&gt; attach(mydata)<\/span>\n<span style=\"font-weight: 400\">&gt; xbar=mean(Minutes)<\/span>\n<span style=\"font-weight: 400\">&gt; s=sd(Minutes)<\/span>\n<span style=\"font-weight: 400\">&gt; n=length(Minutes)<\/span>\n<span style=\"font-weight: 400\">&gt; Mu=144 #null hypothesis<\/span>\n<span style=\"font-weight: 400\">&gt; tstat=(xbar-Mu)\/(s\/(n^0.5))<\/span>\n<span style=\"font-weight: 400\">&gt; tstat<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400\">[1] 1.224674<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400\">&gt; Pvalue=2*pt(tstat, df=n-1, lower=FALSE)<\/span>\n<span style=\"font-weight: 400\">&gt; Pvalue<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400\">[1] 0.2305533<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400\">&gt; if(Pvalue&lt;0.05)NullHypothesis else \"Accepted\"<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400\">[1] \u201cAccepted\u201d<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"independent-t-test-two-sample\"><strong>Independent t-test two sample<\/strong><\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">A hotel manager looks to enhance the initial impressions that hotel guests have when they check-in. Contributing to initial impressions is the time it takes to deliver a guest\u2019s luggage to the room after check-in. A random sample of 20 deliveries on a particular day was selected each from Wing A and Wing B of the hotel. The data collated is given in Luggage.csv file. Analyze the data and determine whether there is a difference in the mean delivery times in the two wings of the hotel. (use alpha = 0.05).<\/span><br><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"solution-in-r\"><b>Solution In R<\/b><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400\">&gt; t.test(WingA,WingB, var.equal = TRUE, alternative = \"greater\")<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400\">&nbsp;&nbsp;&nbsp;&nbsp;Two Sample t-test<\/span><br><span style=\"font-weight: 400\">data:&nbsp; WingA and WingB<\/span><br><span style=\"font-weight: 400\">t = 5.1615,<\/span><br><span style=\"font-weight: 400\">df = 38,<\/span><br><span style=\"font-weight: 400\">p-value = 4.004e-06<\/span><br><span style=\"font-weight: 400\">alternative hypothesis: true difference in means is greater than 0<\/span><br><span style=\"font-weight: 400\">95 percent confidence interval:<\/span><br><span style=\"font-weight: 400\">1.531895 &nbsp; Inf<\/span><br><span style=\"font-weight: 400\">sample estimates:<\/span><br><span style=\"font-weight: 400\">mean of x mean of y<\/span><br><span style=\"font-weight: 400\">&nbsp;10.3975 8.1225<\/span><br><span style=\"font-weight: 400\">&gt; t.test(WingA,WingB)<\/span><br><span style=\"font-weight: 400\">&nbsp;&nbsp;&nbsp;Welch Two Sample t-test<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span style=\"font-weight: 400\">data:&nbsp; WingA and WingB<\/span><\/pre>\n\n\n\n<p><span style=\"font-weight: 400\">t = 5.1615, df = 37.957, p-value = 8.031e-06<\/span><br><span style=\"font-weight: 400\">alternative hypothesis: true difference in means is not equal to 0<\/span><br><span style=\"font-weight: 400\">95 per cent confidence interval:<\/span><br><span style=\"font-weight: 400\">1.38269 3.16731<\/span><br><span style=\"font-weight: 400\">sample estimates:<\/span><br><span style=\"font-weight: 400\">mean of x mean of y<\/span><br><span style=\"font-weight: 400\">&nbsp;10.3975 8.1225<\/span><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">boxplot(WingA,WingB, col = c(\"Red\",\"Pink\"), horizontal = TRUE)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"case-study-titan-insurance-company\"><span style=\"font-weight: 400\"><b>Case Study- Titan Insurance Company<\/b><\/span><\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">The Titan Insurance Company has just installed a new incentive payment scheme for its lift policy salesforce. It wants to have an early view of the success or failure of the new scheme. Indications are that the sales force is selling more policies, but sales always vary in an unpredictable pattern from month to month and it is not clear that the scheme has made a significant difference.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">Life Insurance companies typically measure the monthly output of a salesperson as the total sum assured for the policies sold by that person during the month. For example, suppose salesperson X has, in the month, sold seven policies for which the sums assured are \u00a31000, \u00a32500, \u00a33000, \u00a35000, \u00a310000, \u00a335000. X\u2019s output for the month is the total of these sums assured, \u00a361,500. <\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">Titan\u2019s new scheme is that the sales force receives low regular salaries but are paid large bonuses related to their output (i.e. to the total sum assured of policies sold by them). The scheme is expensive for the company, but they are looking for sales increases which more than compensate. The agreement with the sales force is that if the scheme does not at least break even for the company, it will be abandoned after six months.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">The scheme has now been in operation for four months. It has settled down after fluctuations in the first two months due to the changeover.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">To test the effectiveness of the scheme, Titan has taken a random sample of 30 salespeople measured their output in the penultimate month before changeover and then measured it in the fourth month after the changeover (they have deliberately chosen months not too close to the changeover). Ta<\/span>ble 1 shows t<span style=\"font-weight: 400\">he outputs of the salespeople in Table 1<\/span><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>SALESPERSON<\/strong><\/td><td><strong>Old_Scheme<\/strong><\/td><td><strong>New_Scheme<\/strong><\/td><\/tr><tr><td><span style=\"font-weight: 400\">1<\/span><\/td><td><span style=\"font-weight: 400\">57<\/span><\/td><td><span style=\"font-weight: 400\">62<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">2<\/span><\/td><td><span style=\"font-weight: 400\">103<\/span><\/td><td><span style=\"font-weight: 400\">122<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">3<\/span><\/td><td><span style=\"font-weight: 400\">59<\/span><\/td><td><span style=\"font-weight: 400\">54<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">4<\/span><\/td><td><span style=\"font-weight: 400\">75<\/span><\/td><td><span style=\"font-weight: 400\">82<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">5<\/span><\/td><td><span style=\"font-weight: 400\">84<\/span><\/td><td><span style=\"font-weight: 400\">84<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">6<\/span><\/td><td><span style=\"font-weight: 400\">73<\/span><\/td><td><span style=\"font-weight: 400\">86<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">7<\/span><\/td><td><span style=\"font-weight: 400\">35<\/span><\/td><td><span style=\"font-weight: 400\">32<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">8<\/span><\/td><td><span style=\"font-weight: 400\">110<\/span><\/td><td><span style=\"font-weight: 400\">104<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">9<\/span><\/td><td><span style=\"font-weight: 400\">44<\/span><\/td><td><span style=\"font-weight: 400\">38<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">10<\/span><\/td><td><span style=\"font-weight: 400\">82<\/span><\/td><td><span style=\"font-weight: 400\">107<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">11<\/span><\/td><td><span style=\"font-weight: 400\">67<\/span><\/td><td><span style=\"font-weight: 400\">84<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">12<\/span><\/td><td><span style=\"font-weight: 400\">64<\/span><\/td><td><span style=\"font-weight: 400\">85<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">13<\/span><\/td><td><span style=\"font-weight: 400\">78<\/span><\/td><td><span style=\"font-weight: 400\">99<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">14<\/span><\/td><td><span style=\"font-weight: 400\">53<\/span><\/td><td><span style=\"font-weight: 400\">39<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">15<\/span><\/td><td><span style=\"font-weight: 400\">41<\/span><\/td><td><span style=\"font-weight: 400\">34<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">16<\/span><\/td><td><span style=\"font-weight: 400\">39<\/span><\/td><td><span style=\"font-weight: 400\">58<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">17<\/span><\/td><td><span style=\"font-weight: 400\">80<\/span><\/td><td><span style=\"font-weight: 400\">73<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">18<\/span><\/td><td><span style=\"font-weight: 400\">87<\/span><\/td><td><span style=\"font-weight: 400\">53<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">19<\/span><\/td><td><span style=\"font-weight: 400\">73<\/span><\/td><td><span style=\"font-weight: 400\">66<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">20<\/span><\/td><td><span style=\"font-weight: 400\">65<\/span><\/td><td><span style=\"font-weight: 400\">78<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">21<\/span><\/td><td><span style=\"font-weight: 400\">28<\/span><\/td><td><span style=\"font-weight: 400\">41<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">22<\/span><\/td><td><span style=\"font-weight: 400\">62<\/span><\/td><td><span style=\"font-weight: 400\">71<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">23<\/span><\/td><td><span style=\"font-weight: 400\">49<\/span><\/td><td><span style=\"font-weight: 400\">38<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">24<\/span><\/td><td><span style=\"font-weight: 400\">84<\/span><\/td><td><span style=\"font-weight: 400\">95<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">25<\/span><\/td><td><span style=\"font-weight: 400\">63<\/span><\/td><td><span style=\"font-weight: 400\">81<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">26<\/span><\/td><td><span style=\"font-weight: 400\">77<\/span><\/td><td><span style=\"font-weight: 400\">58<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">27<\/span><\/td><td><span style=\"font-weight: 400\">67<\/span><\/td><td><span style=\"font-weight: 400\">75<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">28<\/span><\/td><td><span style=\"font-weight: 400\">101<\/span><\/td><td><span style=\"font-weight: 400\">94<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">29<\/span><\/td><td><span style=\"font-weight: 400\">91<\/span><\/td><td><span style=\"font-weight: 400\">100<\/span><\/td><\/tr><tr><td><span style=\"font-weight: 400\">30<\/span><\/td><td><span style=\"font-weight: 400\">50<\/span><\/td><td><span style=\"font-weight: 400\">68<\/span><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"data-preparation\"><span style=\"font-weight: 400\"><strong>Data preparation<\/strong><\/span><\/h4>\n\n\n\n<p><span style=\"font-weight: 400\">Since the given data are in 000, it will be better to convert them in thousands.<\/span><br><br><span style=\"font-weight: 400\"><b>Problem 1<\/b><\/span><br><span style=\"font-weight: 400\">Describe the five per cent significance test you would apply to these data to determine whether the new scheme has significantly raised outputs? What conclusion does the test lead to?<\/span><br><b>Solution:<\/b><br><span style=\"font-weight: 400\">It is asked that whether the new scheme has significantly <\/span><b>raised<\/b><span style=\"font-weight: 400\"> the output, it is an example of the one-tailed t-test.<\/span><br><b>Note:<\/b><i><span style=\"font-weight: 400\"> Two-tailed test could have been used if it was asked \u201cnew scheme has significantly <\/span><\/i><b><i>changed<\/i><\/b><i><span style=\"font-weight: 400\"> the output\u201d<\/span><\/i><br><span style=\"font-weight: 400\">Mean of amount assured before the introduction of scheme = 68450<\/span><br><span style=\"font-weight: 400\">Mean of amount assured after the introduction of scheme = 72000<\/span><br><span style=\"font-weight: 400\">Difference in mean = 72000 \u2013 68450 = 3550<\/span><br><span style=\"font-weight: 400\">Let,<\/span><br><span style=\"font-weight: 400\">\u03bc1 = Average sums assured by salesperson BEFORE changeover. \u03bc2 = Average sums assured by salesperson <\/span><b>AFTER<\/b><span style=\"font-weight: 400\"> changeover.<\/span><br><span style=\"font-weight: 400\">H0: \u03bc1 = \u03bc2&nbsp; ; \u03bc2 \u2013 \u03bc1 = 0<\/span><br><span style=\"font-weight: 400\">HA: \u03bc1 &lt; \u03bc2 &nbsp; ; \u03bc2 \u2013 \u03bc1 &gt; 0 ; true difference of means is greater than zero.<\/span><br><span style=\"font-weight: 400\">Since population standard deviation is unknown, <\/span><b>paired sample t-test<\/b><span style=\"font-weight: 400\"> will be used.<\/span><br><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">Since p-value (=0.06529) is higher than 0.05, we accept (fail to reject) NULL hypothesis. <\/span><b><i>The new scheme has NOT significantly raised outputs<\/i><\/b><span style=\"font-weight: 400\">.<\/span><br><\/p>\n\n\n\n<p><b>Problem 2<\/b><br><span style=\"font-weight: 400\">Suppose it has been calculated that for Titan to break even, the average output must increase by \u00a35000. If this figure is an alternative hypothesis, what is:<\/span><br><span style=\"font-weight: 400\">(a)&nbsp; The probability of a type 1 error?<\/span><br><span style=\"font-weight: 400\">(b)&nbsp; What is the p-value of the hypothesis test if we test for a difference of $5000?<\/span><br><span style=\"font-weight: 400\">(c) &nbsp; Power of the test:<\/span><br><b>Solution:<\/b><br><strong>2.a.&nbsp; The probability of a type 1 error?<\/strong><br><span style=\"font-weight: 400\">Solution: Probability of Type I error = significant level = 0.05 or 5%<\/span><br><b>2.b.&nbsp; What is the p-value of the hypothesis test if we test for a difference of $5000?<\/b><br><span style=\"font-weight: 400\">Solution:<\/span><br><span style=\"font-weight: 400\">Let&nbsp; \u03bc2 = Average sums assured by salesperson AFTER changeover.<\/span><br><span style=\"font-weight: 400\">\u03bc1 = Average sums assured by salesperson BEFORE changeover.<\/span><br><span style=\"font-weight: 400\">\u03bcd = \u03bc2 \u2013 \u03bc1 &nbsp; H0: \u03bcd \u2264 5000 HA: \u03bcd &gt; 5000<\/span><br><span style=\"font-weight: 400\">This is a right tail test.<\/span><br><\/p>\n\n\n\n<p><b>R code:<\/b><\/p>\n\n\n\n<p>P-value = 0.6499<br>2.c. Power of the test.<br>Solution:<br><span style=\"font-weight: 400\">Let&nbsp; \u03bc2 = Average sums assured by salesperson AFTER changeover. \u03bc1 = Average sums assured by salesperson BEFORE changeover. \u03bcd = \u03bc2 \u2013 \u03bc1 &nbsp; H0: \u03bcd = 4000<\/span><br><span style=\"font-weight: 400\">HA: \u03bcd &gt; 0<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">H0 will be rejected if test statistics &gt; t_critical.<\/span><br><span style=\"font-weight: 400\">With \u03b1 = 0.05 and df = 29, critical value for t statistic (or t_critical ) will be &nbsp; 1.699127.<\/span><br><span style=\"font-weight: 400\">Hence, H0 will be rejected for test statistics \u2265&nbsp; 1.699127.<\/span><br><span style=\"font-weight: 400\">Hence, H0 will be rejected if for&nbsp; \ud835\udc65\u0305 \u2265 4368.176<\/span><\/p>\n\n\n\n<p><br><b>R Code:<\/b><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Probability (type II error) is P(Do not reject H0 | H0 is false)<\/span><br><span style=\"font-weight: 400\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Our NULL hypothesis is TRUE at \u03bcd = 0 so that&nbsp; H0: \u03bcd = 0 ; HA: \u03bcd &gt; 0<\/span><br><span style=\"font-weight: 400\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Probability of type II error at \u03bcd = 5000<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">= P (Do not reject H0 | H0 is false)<\/span><br><span style=\"font-weight: 400\">= P (Do not reject H0 | \u03bcd = 5000)&nbsp; = P (\ud835\udc65\u0305 &lt; 4368.176 | \u03bcd = 5000)<\/span><br><span style=\"font-weight: 400\">= P (t &lt;&nbsp; | \u03bcd = 5000)<\/span><br><span style=\"font-weight: 400\">= P (t &lt; -0.245766)<\/span><br><span style=\"font-weight: 400\">= 0.4037973<\/span><br><\/p>\n\n\n\n<p><b>R Code:<\/b><br><span style=\"font-weight: 400\">Now,&nbsp; \u03b2=0.5934752,<\/span><br><span style=\"font-weight: 400\">Power of test = 1- \u03b2 = 1- 0.5934752<\/span><br><span style=\"font-weight: 400\">= <\/span><b>0.4065248<\/b><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Statistics for Data Science | Probability and Statistics | Statistics Tutorial | Ph.D. (Stanford)\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/Vfo5le26IhY?start=9235&feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"note\"><strong>Note:<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>While performing Hypothesis-Testing, Hypotheses can\u2019t be proved or disproved since we have evidence from sample (s) only. At most, Hypotheses may be rejected or retained.<\/li>\n\n\n\n<li>Use of the term \u201caccept H<sub>0<\/sub>\u201d in place of \u201cdo not reject\u201d should be avoided even if the test statistic falls in the Acceptance Region or p-value \u2265 \u03b1. This simply means that the sample does not provide sufficient statistical evidence to reject the H<sub>0<\/sub>. Since we have tried to nullify (reject) H<sub>0 <\/sub>but we haven\u2019t found sufficient support to do so, we may retain it but it won\u2019t be accepted.<\/li>\n\n\n\n<li>Confidence Interval (Interval Estimation) can also be used for testing of hypotheses. If the hypothesis parameter falls within the confidence interval, we do not reject H<sub>0<\/sub>. Otherwise, if the hypothesised parameter falls outside the confidence interval i.e. confidence interval does not contain the hypothesized parameter, we reject H<sub>0<\/sub>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"references\"><strong>References:<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Downey, A. B. (2014). <em>Think Stat: Exploratory Data Analysis<\/em>, 2<sup>nd<\/sup> Edition, Sebastopol, CA: O\u2019Reilly Media Inc<\/li>\n\n\n\n<li>Fisher, R. A. (1956). <em>Statistical Methods and Scientific Inference<\/em>, New York: Hafner Publishing Company.<\/li>\n\n\n\n<li>Hogg, R. V.; McKean, J. W. &amp; Craig, A. T. (2013). <em>Introduction to Mathematical Statistics<\/em>, 7<sup>th<\/sup> Edition, New Delhi: Pearson India.<\/li>\n\n\n\n<li>IBM SPSS Statistics. (2020). IBM Corporation.&nbsp;<\/li>\n\n\n\n<li>Levin, R. I.; Rubin, D. S; Siddiqui, M. H. &amp; Rastogi, S. (2017). <em>Statistics for Management<\/em>, 8<sup>th<\/sup> Edition, New Delhi: Pearson India.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>If you want to get a detailed understanding of Hypothesis testing, you can take up this <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/hypothesis-testing\" target=\"_blank\" rel=\"noreferrer noopener\">hypothesis testing in machine learning<\/a> course. This  course will also provide you with a certificate at the end of the course. <\/p>\n\n\n\n<p>If you want to learn more about R programming and other concepts of Business Analytics or Data Science, sign up for Great Learning's <a href=\"https:\/\/www.mygreatlearning.com\/pg-program-data-science-and-business-analytics-course\" target=\"_blank\" rel=\"noreferrer noopener\">PG program in Data Science. <\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>- By Dr. Masood H. Siddiqui, Professor &amp; Dean (Research) at Jaipuria Institute of Management, Lucknow Introduction to Hypothesis Testing in R The premise of Data Analytics is based on the philosophy of the \u201cData-Driven Decision Making\u201d that univocally states that decision-making based on data has less probability of error than those based on subjective [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":6054,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[9],"tags":[],"content_type":[],"class_list":["post-6026","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-science"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Introduction to Hypothesis Testing in R Case Studies, Concept and Examples<\/title>\n<meta name=\"description\" content=\"Hypothesis Testing in R with Examples: Learn every concept of Hypothesis Testing in R and case studies. Hypothesis Testing is an essential part of statistics for Data Analytics.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hypothesis Testing in R- Introduction Examples and Case Study\" \/>\n<meta property=\"og:description\" content=\"Hypothesis Testing in R with Examples: Learn every concept of Hypothesis Testing in R and case studies. Hypothesis Testing is an essential part of statistics for Data Analytics.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-24T10:15:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-08T05:53:19+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"31 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Hypothesis Testing in R- Introduction Examples and Case Study\",\"datePublished\":\"2020-04-24T10:15:00+00:00\",\"dateModified\":\"2024-11-08T05:53:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/\"},\"wordCount\":6149,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/hypothesis-testing-in-R-1.jpg\",\"articleSection\":[\"Data Science and Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/\",\"name\":\"Introduction to Hypothesis Testing in R Case Studies, Concept and Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/hypothesis-testing-in-R-1.jpg\",\"datePublished\":\"2020-04-24T10:15:00+00:00\",\"dateModified\":\"2024-11-08T05:53:19+00:00\",\"description\":\"Hypothesis Testing in R with Examples: Learn every concept of Hypothesis Testing in R and case studies. Hypothesis Testing is an essential part of statistics for Data Analytics.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/hypothesis-testing-in-R-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/hypothesis-testing-in-R-1.jpg\",\"width\":1000,\"height\":667,\"caption\":\"hypothesis testing in R\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/hypothesis-testing-in-r-with-examples-and-case-study\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data Science and Analytics\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/data-science\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Hypothesis Testing in R- Introduction Examples and Case Study\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Introduction to Hypothesis Testing in R Case Studies, Concept and Examples","description":"Hypothesis Testing in R with Examples: Learn every concept of Hypothesis Testing in R and case studies. Hypothesis Testing is an essential part of statistics for Data Analytics.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/","og_locale":"en_US","og_type":"article","og_title":"Hypothesis Testing in R- Introduction Examples and Case Study","og_description":"Hypothesis Testing in R with Examples: Learn every concept of Hypothesis Testing in R and case studies. Hypothesis Testing is an essential part of statistics for Data Analytics.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2020-04-24T10:15:00+00:00","article_modified_time":"2024-11-08T05:53:19+00:00","og_image":[{"width":1000,"height":667,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"31 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Hypothesis Testing in R- Introduction Examples and Case Study","datePublished":"2020-04-24T10:15:00+00:00","dateModified":"2024-11-08T05:53:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/"},"wordCount":6149,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg","articleSection":["Data Science and Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/","url":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/","name":"Introduction to Hypothesis Testing in R Case Studies, Concept and Examples","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg","datePublished":"2020-04-24T10:15:00+00:00","dateModified":"2024-11-08T05:53:19+00:00","description":"Hypothesis Testing in R with Examples: Learn every concept of Hypothesis Testing in R and case studies. Hypothesis Testing is an essential part of statistics for Data Analytics.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg","width":1000,"height":667,"caption":"hypothesis testing in R"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/hypothesis-testing-in-r-with-examples-and-case-study\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Data Science and Analytics","item":"https:\/\/www.mygreatlearning.com\/blog\/data-science\/"},{"@type":"ListItem","position":3,"name":"Hypothesis Testing in R- Introduction Examples and Case Study"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg",1000,667,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1-768x512.jpg",768,512,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg",1000,667,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg",1000,667,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg",1000,667,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg",640,427,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg",96,64,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2019\/08\/hypothesis-testing-in-R-1.jpg",150,100,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":0,"uagb_excerpt":"- By Dr. Masood H. Siddiqui, Professor &amp; Dean (Research) at Jaipuria Institute of Management, Lucknow Introduction to Hypothesis Testing in R The premise of Data Analytics is based on the philosophy of the \u201cData-Driven Decision Making\u201d that univocally states that decision-making based on data has less probability of error than those based on subjective&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/6026","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=6026"}],"version-history":[{"count":29,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/6026\/revisions"}],"predecessor-version":[{"id":108996,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/6026\/revisions\/108996"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/6054"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=6026"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=6026"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=6026"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=6026"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}