EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB31577: How to perform Chi Square test of indepdence in MicroStrategy 9.4.x and 10.x


Community Admin

• Strategy


Chi Square test of independence is used to assess whether paired observations on two variables, expressed in a contingency table, are independent of each other.

Chi Square test of independence is used to assess whether paired observations on two variables, expressed in a contingency table, are independent of each other.
 
For example, given the the contigency table shown below: 

ka04W000000Ohm9QAC_0EM440000002EK1.jpeg

 
A user can follow the steps below to set up a Strategy  project to get the Chi Square test statistics. 
 
1. Add the following three tables to Warehouse (number of rows or columns can be more than two)
    

ka04W000000Ohm9QAC_0EM440000002EKG.jpeg

 
2. Create the following schema objects
     - Attribute Row: Use ID_Row as ID form, DESC_Row as DESC form
     - Attribute Column: Use ID_Column as ID form, DESC_Column as DESC form
     - Fact Frequency: Map to Frequency column
 
3. Create the following Metrics
 
     - Frequency
       

ka04W000000Ohm9QAC_0EM440000002EKA.jpeg

 
     - RowTotal
       

ka04W000000Ohm9QAC_0EM440000002EK0.jpeg

 
     - ColumnTotal
       

ka04W000000Ohm9QAC_0EM440000002EKB.jpeg

 
     - GrandTotal
        

ka04W000000Ohm9QAC_0EM440000002EK9.jpeg

     - EstimatedFreq: ((RowTotal * ColumnTotal) / GrandTotal)
 
     - SquaredDiff: (((Frequency - EstimatedFreq) * (Frequency - EstimatedFreq)) / EstimatedFreq)
 
     - SumSquaredDiff: Sum(SquaredDiff) {~}
 
     - Number of Rows
       

ka04W000000Ohm9QAC_0EM440000002EJy.jpeg

     - Number of Columns
        

ka04W000000Ohm9QAC_0EM440000002EKJ.jpeg

 
     - DF: (( - 1) * ( -  1))
 
     - ChiSquareTest: ChiSquareDistribution(SumSquaredDiff, DF)
 
4. Create a report, put SumSquaredDiff and ChiSquareTest on the grid. Result is as follows,
 
       

ka04W000000Ohm9QAC_0EM440000002EKH.jpeg

  
 


Comment

0 comments

Details

Knowledge Article

Published:

April 14, 2017

Last Updated:

April 14, 2017