> ## Documentation Index
> Fetch the complete documentation index at: https://docs.repdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Significance Testing Analysis

> # Description

Get significance testing analysis data for multiple choice questions.

# Payload

```json
{
    "fromDate": string,
    "toDate": string,
    "filter": array,
    "groups": object
    "excludeQuestions": array,
    "questionId1": string,
    "questionId2": string,
}
```

where:

* `fromDate`: start date in ISO format. **Required**.
* `toDate`: end date in ISO format. **Required**.
* `filter`: array of filters to filter the responses. Optional.
* `groups`: Object indexed by question id with a `q` as prefix. Every key has assigned an array with the question ids with `q` prefix that are the same question through different concepts inside a concept test. Only needed for project with Concept Tests or Question Loops. Optional.
* `aggregateOptions`: Used when filtering with a bucket. Specifies the bucket configuration applied. Optional.
* `excludeQuestions`: Array of question ids. Questions specified in this array belong to a Contact Info item, specifically the country and state questions that should be excluded from analysis. Optional.
* `questionId1` and `questionId2`: For significance testing to work, 2 questions must be selected first, these field are those 2 questions. **Required**.

# Response 

## 200 OK

```json
{
  "criticalValue": number,
  "pValue": number,
  "df": number,
  "matrix": object
}
```
where:

* `criticalValue`: Chi square critical value.
* `df`: Chi square degrees of freedom.
* `matrix`: Chi square resulting matrix.
* `pValue`: Chi square p-value.

## 400 Bad Request
> Missing or invalid `projectId`/`fromDate`/`toDate` fields.

## 401 Unauthorized
> Invalid authorization.

## 404 Not Found
> Resource not found.

## 500 Internal Server Error
> Error occurred in the service.

# Description

Get significance testing analysis data for multiple choice questions.

# Payload

```json theme={null}
{
    "fromDate": string,
    "toDate": string,
    "filter": array,
    "groups": object
    "excludeQuestions": array,
    "questionId1": string,
    "questionId2": string,
}
```

where:

* `fromDate`: start date in ISO format. **Required**.
* `toDate`: end date in ISO format. **Required**.
* `filter`: array of filters to filter the responses. Optional.
* `groups`: Object indexed by question id with a `q` as prefix. Every key has assigned an array with the question ids with `q` prefix that are the same question through different concepts inside a concept test. Only needed for project with Concept Tests or Question Loops. Optional.
* `aggregateOptions`: Used when filtering with a bucket. Specifies the bucket configuration applied. Optional.
* `excludeQuestions`: Array of question ids. Questions specified in this array belong to a Contact Info item, specifically the country and state questions that should be excluded from analysis. Optional.
* `questionId1` and `questionId2`: For significance testing to work, 2 questions must be selected first, these field are those 2 questions. **Required**.

# Response

## 200 OK

```json theme={null}
{
  "criticalValue": number,
  "pValue": number,
  "df": number,
  "matrix": object
}
```

where:

* `criticalValue`: Chi square critical value.
* `df`: Chi square degrees of freedom.
* `matrix`: Chi square resulting matrix.
* `pValue`: Chi square p-value.

## 400 Bad Request

> Missing or invalid `projectId`/`fromDate`/`toDate` fields.

## 401 Unauthorized

> Invalid authorization.

## 404 Not Found

> Resource not found.

## 500 Internal Server Error

> Error occurred in the service.


## OpenAPI

````yaml POST /multiple-question-analysis-service/chiSquare/{projectId}
openapi: 3.0.3
info:
  title: SightX API
  version: 1.0.0
  description: >-
    SightX REST API documentation. Most responses are JSON; some export
    endpoints return files. API access is a paid add-on — contact
    sales@sightx.io for details.
servers:
  - url: https://auth.admin.sightx.io
    description: Authentication (Production)
  - url: https://auth.staging-admin.sightx.io
    description: Authentication (Staging)
security:
  - AuthorizationHeader: []
paths:
  /multiple-question-analysis-service/chiSquare/{projectId}:
    post:
      summary: Fetch Significance Testing Analysis
      description: >-
        # Description


        Get significance testing analysis data for multiple choice questions.


        # Payload


        ```json

        {
            "fromDate": string,
            "toDate": string,
            "filter": array,
            "groups": object
            "excludeQuestions": array,
            "questionId1": string,
            "questionId2": string,
        }

        ```


        where:


        * `fromDate`: start date in ISO format. **Required**.

        * `toDate`: end date in ISO format. **Required**.

        * `filter`: array of filters to filter the responses. Optional.

        * `groups`: Object indexed by question id with a `q` as prefix. Every
        key has assigned an array with the question ids with `q` prefix that are
        the same question through different concepts inside a concept test. Only
        needed for project with Concept Tests or Question Loops. Optional.

        * `aggregateOptions`: Used when filtering with a bucket. Specifies the
        bucket configuration applied. Optional.

        * `excludeQuestions`: Array of question ids. Questions specified in this
        array belong to a Contact Info item, specifically the country and state
        questions that should be excluded from analysis. Optional.

        * `questionId1` and `questionId2`: For significance testing to work, 2
        questions must be selected first, these field are those 2 questions.
        **Required**.


        # Response 


        ## 200 OK


        ```json

        {
          "criticalValue": number,
          "pValue": number,
          "df": number,
          "matrix": object
        }

        ```

        where:


        * `criticalValue`: Chi square critical value.

        * `df`: Chi square degrees of freedom.

        * `matrix`: Chi square resulting matrix.

        * `pValue`: Chi square p-value.


        ## 400 Bad Request

        > Missing or invalid `projectId`/`fromDate`/`toDate` fields.


        ## 401 Unauthorized

        > Invalid authorization.


        ## 404 Not Found

        > Resource not found.


        ## 500 Internal Server Error

        > Error occurred in the service.
      operationId: >-
        fetch-significance-testing-analysis-post-multiple-question-analysis-service-chisquare-projectid
      parameters:
        - name: Authorization
          in: header
          required: true
          description: Authorization token
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              fromDate: '2019-01-01'
              toDate: '2022-12-31'
              filter: []
              groups:
                questionId:
                  - qRelatedQuestionId1
              questionId1: questionId1
              questionId2: questionId2
              excludeQuestions: []
      responses:
        '200':
          description: Fetch Significance Testing Analysis
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              example:
                criticalValue: 0
                pValue: 1
                df: 25
                matrix:
                  '1':
                    '1': 1
                    '2': 1
                    '3': 1
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      servers:
        - url: https://multiple-question-analysis.sightx.io
components:
  securitySchemes:
    AuthorizationHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Access token obtained from the m2m-token endpoint.

````