Difference between revisions of "Manuals/calci/CHITEST"

From ZCubes Wiki
Jump to navigation Jump to search
Line 4: Line 4:
  
 
==Description==
 
==Description==
*This function gives the Average for given set of numbers.
+
*This function gives the the value from the chi-squared distribution. i.e it calculates <math>\chi^2</math> statistic and degrees of freedom, then calls CHIDIST.
*Average means Sum of all the given elements is divided by Number of the given elements.
+
The conditions of <math>\chi^2</math> test is
*It is also called Arithmetic mean. i.e If n numbers are given and each number is denoted by a<math>i</math>, where <math>i</math>=1 to n, then <math>A.M = \frac{1}{n}\sum_{i=1}^n (ai)= \frac{a1+a2+.....+an}{n} </math>.
+
The table should be 2x2 or more than 2x2
*In this function N1,N2,... are it can either be numbers,arrays,references of cells or we can enter the logical values directly.
+
Each observations should not be dependent
*This function will show the result as Error, when the numbers are error values or text that cannot change into numbers.
+
All expected values should be 10 or greater. 
*Also if the distribution is symmetric, then we can use this function to find the Central Tendency.
+
Each cell has an expected frequency of at least five.
*The three most common measures of Central Tendency are: A.M, Median,& Mode.
+
*The <math>\chi^2</math> test first calculates a <math>\chi^2</math> statistic using the formula:
'''A.M''':  It is calculated by adding the given set of numbers and divided by the count of the given set of numbers.  
+
X^2= summation(i=1 to columns)summation(j=1 to rows)(observed ij-expected ij)^2/grand total
E.g:Average of 2,4,2,7,2,3 and 5 is 3.6
+
*observed ij is the array of the observed values in a given set of values
'''Median''': It is the middle number of a sorted list(Ascending order) of numbers.
+
*expected ij = column i total*row j total/grand total
  E.g:The median of 2,2,2,3,4,5,7 is 3
+
*observed and expected must have the same number of rows and columns and there must be atleast 2 values in each.
'''Mode''': It is the most frequently  repeated number in a given set of numbers.
+
*A low result of <math>\chi^2</math> is an indicator of independence.
  E.g.The mode of 2,2,2,3,4,5 and 7 is 2
+
*From the formula of <math>\chi^2</math> we will get <math>\chi^2</math> is always positive or 0.
 
+
*0 only if observed ij=expected ij for each i and j.  
*Sometimes CHITEST returns the error value, when ‘a’ and ‘b’ have a different number of data points.
+
*CHITEST uses the <math>\chi^2</math> distribution with the number of Degrees of Freedom df.
 
+
  where df=(r-1)(c-1),r>1 and c>1.
 +
  If r=1 and c>1, then df = c-1 or if r>1 and c=1, then df=r-1.
 +
If r=c=1 then this function will give the error result
  
  

Revision as of 01:27, 25 November 2013

CHITEST(ar,er)


  • is the array of observed values
  • is the array of expected values

Description

  • This function gives the the value from the chi-squared distribution. i.e it calculates  statistic and degrees of freedom, then calls CHIDIST.

The conditions of test is

The table should be 2x2 or more than 2x2
Each observations should not be dependent
All expected values should be 10 or greater. 
Each cell has an expected frequency of at least five.
  • The test first calculates a statistic using the formula:

X^2= summation(i=1 to columns)summation(j=1 to rows)(observed ij-expected ij)^2/grand total

  • observed ij is the array of the observed values in a given set of values
  • expected ij = column i total*row j total/grand total
  • observed and expected must have the same number of rows and columns and there must be atleast 2 values in each.
  • A low result of is an indicator of independence.
  • From the formula of we will get is always positive or 0.
  • 0 only if observed ij=expected ij for each i and j.
  • CHITEST uses the distribution with the number of Degrees of Freedom df.
where df=(r-1)(c-1),r>1 and c>1.
If r=1 and c>1, then df = c-1 or if r>1 and c=1, then df=r-1.
If r=c=1 then this function will give the error result


Column1 Column2 Column3 Column4
Row1 45 38 0.000313
Row2 10 23
Row3 12 26
Row4 40.5 49.36
Row5 19.56 16.44
Row6 17.05 17.41
Let’s see an example
B C
45 38
10 23
12 26
40.5 49.36
19.56 16.44
17.05 17.41
CHITEST (a, b)
i.e. =CHITEST (B2; C4, B5:C7) is 0.003