Posts

Showing posts with the label Proportion Test

Out-of-the-Box Part 1 - Proportion Testing with CHISQ.TEST

Image
So Excel Lambda is great! You can create custom functions that are not included in Excel. And we have seen in this blog how you could implement various statistical hypothesis testing .  But then what are those Excel TEST functions for? What hypothesis testing can I do with these Out-of-the-box TEST functions? In the next few posts, I will describe some common hypothesis testing you could do: Proportion Test with  CHISQ.TEST One Sample Mean Test with  Z.TEST Two Sample Mean Test with  T.TEST Variance Test with  F.TEST Excel's Chi Squared Test for One Proportion Testing In Excel's documentation, CHISQ.TEST is described as a test for independence . It does this by doing a goodness-to-fit test on how well the data matches the expected. This means we can also use it for one proportion testing. To use CHISQ.TEST we will need to compare the sample proportion against the expected proportion. But unlike DC-Den's One Proportion Testing  where we only need to specify the expected

Creating Two Proportion Test with LAMBDA

Image
What is Two Proportion Test Two Proportion Test compares one proportion to determine if it is equal to, lesser than or greater than another proportion. Unlike One Proportion Test , the size of the second proportion can have an effect on the results. Suppose you gave flavour X ice-cream to two groups of people. In the first group 65 of 100 people liked flavour X, and in the second group 90 of 130 people liked. Did this two groups responded similarly? We write our hypothesis statement as the "Did the two groups responded similiarly to flavour X ice-cream?" The Null and Alternative Hypothesis is written as: `H_0: p_1 = p_2` `H_1: p_1 != p_2` where `p_1` is proportion from group 1 `p_2` is proportion from group 2 Test Statistics The equation of a two proportion test statistics is written as `z = (p_1 - p_2) / sqrt( hat p(1 - hat p)(1/n_1 + 1 / n_2) )` where the pooled variance `hat p = (o_1 + o_2)/(n_1 + n_2)` and `p_1 = o_1 / n_1` is the proportion from group 1 `p_2 = o_2 / n_2

Creating One Proportion Test with LAMBDA

Image
What is One Proportion Test The One Proportion Test compares a sample proportion against a target proportion. For example, you observe that you get 6 heads when you flip a coin 10 times (sample). You expect with a fair coin, the probability of getting heads is 0.5 or 50% of the time (target). The One Proportion Test allows you to assess if the flipped coin is a fair coin based on the observations. The test proves this by statistically comparing the observed proportion of heads to number of flipping 0.6, is equal to the expected proportion 0.5. We write the Null Hypothesis as the observed proportion is equal to the hypothesised proportion. `H_0: p = p_0` And the Alternative Hypothesis is that the observed proportion is not equal to the hypothesised proportion (two-tailed test). `H_1: p != p_0` We could also test if the observed proportion is greater than the hypothesised proportion (left tail test). `H_0: p >= p_0` Or if the observed proportion is less than the hypothesised proporti