Difference between revisions of "Manuals/calci/CHITEST"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="6SpaceContent" class="zcontent" align="left">''' CHITEST ''' ('''a, b''') Where ‘a ‘is the observations to test against the expected values and ‘b’ is the ...")
 
 
(65 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<div id="6SpaceContent" class="zcontent" align="left">''' CHITEST ''' ('''a, b''')
+
<div style="font-size:30px">'''CHITEST (ActualRange,ExpectedRange)'''</div><br/>
 +
*<math>ActualRange</math> is the array of observed values.
 +
*<math>ExpectedRange</math> is the array of expected values.
 +
**CHITEST(), returns the test for independence.
  
Where ‘a ‘is the observations to test against the expected values and ‘b’ is the ratio of the product of row totals and column totals to the grand total.
+
==Description==
 +
* It is a test for independence.
 +
* This function gives the value from the chi-squared distribution and the appropriate degrees of freedom i.e it calculates <math>\chi^2</math> statistic and degrees of freedom, then calls CHIDIST.
 +
The conditions of <math>\chi^2</math> 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 <math>\chi^2</math> test first calculates a <math>\chi^2</math> statistic using the formula:
 +
<math>\chi^2 = \sum_{i=1}^{columns} \sum_{j=1}^{rows} \frac{(observed _{ij}-expected _{ij})^{2}}{grand total}</math>
 +
*<math>observed _{ij}</math> is the array of the observed values in a given set of values
 +
*<math>expected _{ij} = \frac{(column _i total)*(row _j total)}{grand total} </math>
 +
*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 <math>\chi^2</math> is an indicator of independence.
 +
*From the formula of <math>\chi^2</math> we will get <math>\chi^2</math> is always positive or 0.
 +
*0 only if <math>observed _{ij} = expected _{ij}</math> for each <math>i</math> and <math>j</math>.
 +
*CHITEST uses the <math>\chi^2</math> distribution with the number of Degrees of Freedom df.
 +
*where <math>df=(r-1)(c-1),r>1</math> and <math>c>1</math>.
 +
*If <math>r=1</math> and <math>c>1</math>, then <math>df = c-1</math> or if <math>r>1</math> and <math>c=1</math>, then <math>df = r-1</math>.
 +
If <math>r = c = 1</math> then this function will give the error result
 +
*The obtained result is entered in the Chi square distribution table with the obtained degrees of freedom.
 +
*This returns the test for independence (probability).
  
</div>
+
==ZOS==
----
+
*The syntax is to calculate CHITEST in ZOS is <math>CHITEST (ActualRange,ExpectedRange)</math>.
<div id="1SpaceContent" class="zcontent" align="left">
+
**where <math>ActualRange</math>is the array of observed values.
 +
**<math>ExpectedRange</math>is the array of expected values.
 +
*For e.g;CHITEST([60,72,86,45],[57.08,75.10,87.1,42.45])
 +
{{#ev:youtube|gh-b_MUMo9c|280|center|Chi-Squared Test}}
  
This function returns the test for independence.
+
==Examples==
 +
A student investigated the chance of getting viral fever in a school for a period that took vitamin tablets every day. The total number of students 880. In that 639 students didn't get viral fever and 241 students got fever .But the expected ratio is 1:3<br/>
 +
'''Answer'''
 +
*If the ratio is 1:3 and the total number of observed individuals is 880, then the expected numerical values should be: 660 will not get fever and 220 students will get fever. 
  
</div>
+
{| class="wikitable" style="width:50%" align="center"
----
+
|-  
<div id="7SpaceContent" class="zcontent" align="left">
+
!
 
+
! No Fever
Sometimes CHITEST returns the error value, when ‘a’ and ‘b’ have a different number of data points.
+
! Get Fever
 
+
|-
It is calculated using the formula:
+
! Observed Values
 
+
| 639
Where:
+
| 241
 
+
|-
A<sub>ij = actual frequency in the i-th row, j-th column</sub>
+
! Expected Values
 
+
| 660
Eij = expected frequency in the i-th row, j-th column
+
| 220
 
+
|-
r = number or rows and c = number of columns
+
! <math>\frac{(oi-ei)^2}{ei}</math>
 
+
| 0.668
χ<sup>2 is always positive or 0, and is 0 only if Aij = Eij for every i, j.</sup>
+
| 2
 
 
</div>
 
----
 
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">CHITEST</div></div>
 
----
 
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Syntax </div><div class="ZEditBox"><center></center></div></div>
 
----
 
<div id="4SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Remarks </div></div>
 
----
 
<div id="3SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Examples </div></div>
 
----
 
<div id="11SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Description </div></div>
 
----
 
<div id="2SpaceContent" class="zcontent" align="left">
 
 
 
{| id="TABLE3" class="SpreadSheet blue"
 
|- class="even"
 
| class="  " |
 
<div id="2Space_Copy" title="Click and Drag over to AutoFill other cells."></div>
 
| class="        " | Column1
 
| class="        " | Column2
 
| class="    " | Column3
 
| class="  " | Column4
 
|- class="odd"
 
| class=" " | Row1
 
| class="sshl_f " | 45
 
| class="sshl_f" | 38
 
| class="sshl_f" | 0.000313
 
| class="sshl_f" |
 
|- class="even"
 
| class="  " | Row2
 
| class="sshl_f  " | 10
 
| class="sshl_f" | 23
 
| class="SelectTD" |
 
| class="sshl_f" |
 
|- class="odd"
 
| Row3
 
| class="sshl_f" | 12
 
| class=" " | 26
 
| class="sshl_f" |
 
| class="sshl_f" |
 
|- class="even"
 
| Row4
 
| class="sshl_f " | 40.5
 
| class=" " | 49.36
 
| class="sshl_f" |
 
| class="sshl_f" |
 
|- class="odd"
 
| class="sshl_f" | Row5
 
| class="sshl_f" | 19.56
 
| class="sshl_f" | 16.44
 
| class="sshl_f" |
 
| class="sshl_f" |
 
|- class="even"
 
| class="sshl_f" | Row6
 
| class=" " | 17.05
 
| class="sshl_f " | 17.41
 
|
 
| class="sshl_f" |
 
 
|}
 
|}
  
</div>
+
*The <math>\chi^2</math> value is 2.668
----
+
*Now <math>df=(r-1)(c-1) = (2-1)(2-1) = 1 </math>
<div id="8SpaceContent" class="zcontent" align="left"><font size="3"><font face="Times New Roman">''' <font size="3"><font face="Times New Roman">AVEDEV (N1, N2...)</font></font> <font size="3"><font face="Times New Roman">Where N1, N 2 ...   are positive integers.</font></font> '''</font></font></div>
+
*From the Chi Squared Distribution probability table with <math>df</math> is 1, the <math>\chi^2</math> value of 2.668 is  0.10.<br/>
----
+
CHITEST(or,er) = 0.10
<div id="5SpaceContent" class="zcontent" align="left">
 
 
 
Let’s see an example
 
 
 
B C
 
  
45 38
+
==Related Videos==
  
10 23
+
{{#ev:youtube|UPawNLQOv-8|280|center|Chi Square Test}}
  
12 26
+
==See Also==
  
40.5 49.36
+
*[[Manuals/calci/CHIDIST | CHIDIST]]
  
19.56 16.44
+
==References==
 +
[http://en.wikipedia.org/wiki/Chi-squared_distribution  CHI-SQUARE Distribution]
  
17.05 17.41
 
  
CHITEST (a, b)
 
  
i.e. =CHITEST (B2; C4, B5:C7) is 0.003
+
*[[Z_API_Functions | List of Main Z Functions]]
  
</div>
+
*[[ Z3 |  Z3 home ]]
----
 

Latest revision as of 09:57, 2 June 2020

CHITEST (ActualRange,ExpectedRange)


  • is the array of observed values.
  • is the array of expected values.
    • CHITEST(), returns the test for independence.

Description

  • It is a test for independence.
  • This function gives the value from the chi-squared distribution and the appropriate degrees of freedom 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:

  • is the array of the observed values in a given set of values
  • 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 for each and .
  • CHITEST uses the distribution with the number of Degrees of Freedom df.
  • where and .
  • If and , then or if and , then .
If  then this function will give the error result
  • The obtained result is entered in the Chi square distribution table with the obtained degrees of freedom.
  • This returns the test for independence (probability).

ZOS

  • The syntax is to calculate CHITEST in ZOS is .
    • where is the array of observed values.
    • is the array of expected values.
  • For e.g;CHITEST([60,72,86,45],[57.08,75.10,87.1,42.45])
Chi-Squared Test

Examples

A student investigated the chance of getting viral fever in a school for a period that took vitamin tablets every day. The total number of students 880. In that 639 students didn't get viral fever and 241 students got fever .But the expected ratio is 1:3
Answer

  • If the ratio is 1:3 and the total number of observed individuals is 880, then the expected numerical values should be: 660 will not get fever and 220 students will get fever.
No Fever Get Fever
Observed Values 639 241
Expected Values 660 220
0.668 2
  • The value is 2.668
  • Now
  • From the Chi Squared Distribution probability table with is 1, the value of 2.668 is 0.10.

CHITEST(or,er) = 0.10

Related Videos

Chi Square Test

See Also

References

CHI-SQUARE Distribution