Posts

Showing posts from May, 2023

Excel Range vs Array

Image
As I worked more with LAMBDA, I discovered that Excel functions that take range parameters do not work with arrays . If a function's parameter mentions "range", you can be sure this will not work with arrays. Some examples of these functions are COUNTIF , COUNTIFS , AVERAGEIF , AVERAGEIFS , SUMIF , and SUMIFS . The other that I am aware of is RANK.AVG . What is an Array? A Range represents a cell, a row, a column, a selection of selections, or blocks of cells. Range will always have an address, for example B2:B5 is a range of values stored in a column. An Array is a set of values constructed using a formula. For example  ={1;2;3;4} is column of values. =VSTACK(1,2,3,4) is also a column of values. The FORMULATEXT function would return #N/A in a range cell that contains only values. On the other hand it returns the formula used to construct the array values. An array can be displayed on a spreadsheet. When displayed on the spreadsheet, the values can be referred by the

Creating One Sample Mean Test with LAMBDA

Image
Suppose you visited a village. The village elders claims to possess a secret elixir that makes their children grower taller! You are aware of the national 12-year old  average height is 150cm. And you could measure the village's 12-year old children's height. Plotting the village's children's height gives you a distribution like in the graph above. At first glance the village's children does seem taller than the national average. Is the village's children really taller? Is the distribution significantly different? One Sample Mean Test A one sample mean test compares a sample distribution's mean against a target value. It is similar to the one proportion test but the sample data is continuous, giving a normal distribution curve instead of a yes/no binary result. We write the Null Hypothesis as the sample mean equal to the population mean. `H_0: mu = mu_0` And the Alternative Hypothesis as the sample mean not equal to the population mean. `H_1: mu != mu_0` We

It's a Red Panda! *Shocker* but I am used to calling myself DC Racoon

Image
I discovered that the above stuff toy represents a Red Panda ! *Shocker* I thought it was a racoon. However I am in good company. I read that scientists in the past also thought the red panda was a racoon. As it turned out, the red panda is no where near the racoon family. If anything it is closer to that of a cat! While DC Red Panda or DC Panda sounds cool, I am too used to calling myself DC Racoon. Next time, I'll check with my child first.

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