Skip to content
Related Articles

Related Articles

Upper Tail Test of Population Proportion in R

View Discussion
Improve Article
Save Article
  • Last Updated : 02 Jun, 2022
View Discussion
Improve Article
Save Article

A statistical hypothesis test is a method of statistical inference used to decide whether the data at hand sufficiently support a particular hypothesis. The conventional steps that are followed while formulating the hypothesis test, are listed as follows

  • State null hypothesis (Ho) and alternate hypothesis (Ha)
  • Collect a relevant sample of data to test the hypothesis.
  • Choose a significance level for the hypothesis test.
  • Perform an appropriate statistical test.
  • Based on test statistics and p-value decide whether to reject or fail to reject your null hypothesis.

In this article let us discuss how to perform an upper-tailed population proportion test. An upper-tailed test is a one-tail test in which the critical area of a distribution is one-sided and tests if the test statistic is larger than the critical value

Let us take a more realistic example, Assume 15% of leads converted to customers in the last 6 months for a coupon selling company. 18 out of 250 leads have been converted into customers in the middle of the current 6-month cycle. At the .05 significance level, let us test a hypothesis to find whether we can reject the null hypothesis that the proportion of lead conversion is going to be less than 15% for the remaining period of the 6-month cycle.

Null Hypothesis: The % of lead conversion is lesser than or equal to 12%. p <= po (Here, po = 0.12)

Alternate Hypothesis: The % of lead conversion is greater than 12%.  p > po

alpha: 0.05

Let us define the test statistic as follows

z = \frac{\hat{p} - p}{\sqrt{\frac{p(1-p)}{n}}}

where,

  • \hat{p}  : Sample Proportion
  • p = population proportion

Let us compute the test statistic as shown below,

R




pbar = 18/250 # sample proportion 
p0 = .15 # hypothesized value 
n = 250 # sample size 
z = (pbar-p0)/sqrt(p0*(1-p0)/n) 
z # test statistic


Output:

-3.45389805360637

Now let us compute the critical values,

R




alpha = .05 
z.alpha = qnorm(1-alpha) 
z.alpha # critical value


Output:

1.6449

From the test results, we can conclude that The test statistic -3.45389805360637 is less than the critical value of 1.6449. Hence, at the 0.05 significance level, we fail to reject the null hypothesis that the proportion of lead conversion to customers is going to be less than or equal to 15% in the current 6-month cycle.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!