help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
statsmodels-statistical
/
examples
RSK World
statsmodels-statistical
Statistical Modeling with Statsmodels
examples
  • advanced_time_series_example.py1.4 KB
  • hypothesis_testing_example.py1.4 KB
  • model_selection_example.py1.5 KB
  • regression_example.py1.5 KB
  • time_series_example.py1.6 KB
model_selection.cpython-313.pychypothesis_testing_example.py
model_selection.cpython-313.pyc

This file cannot be displayed in the browser.

Download File
examples/hypothesis_testing_example.py
Raw Download
Find: Go to:
"""
Hypothesis Testing Example

Author: RSK World
Website: https://rskworld.in
Email: help@rskworld.in
Phone: +91 93305 39277
"""

import numpy as np
import sys
import os

# Add parent directory to path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from hypothesis_testing import StatisticalTests


def main():
    print("Hypothesis Testing Example")
    print("=" * 70)
    
    # Generate sample data
    np.random.seed(42)
    sample1 = np.random.normal(100, 15, 30)
    sample2 = np.random.normal(105, 15, 30)
    sample3 = np.random.normal(110, 15, 30)
    
    # Create test object
    tests = StatisticalTests()
    
    # T-test
    print("\nT-Test:")
    print("=" * 70)
    tests.t_test(sample1, sample2)
    
    # ANOVA test
    print("\n" + "=" * 70)
    print("ANOVA Test:")
    print("=" * 70)
    tests.anova_test({
        'Group 1': sample1,
        'Group 2': sample2,
        'Group 3': sample3
    })
    
    # Normality test
    print("\n" + "=" * 70)
    print("Normality Test:")
    print("=" * 70)
    tests.normality_test(sample1)
    
    # Chi-square test
    print("\n" + "=" * 70)
    print("Chi-Square Test:")
    print("=" * 70)
    observed = np.array([30, 25, 20, 15, 10])
    expected = np.array([20, 20, 20, 20, 20])
    tests.chi_square_test(observed, expected)


if __name__ == "__main__":
    main()

66 lines•1.4 KB
python

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer