Home  >  Article  >  Backend Development  >  ZED-Score Calculator

ZED-Score Calculator

王林
王林Original
2024-08-05 15:19:50554browse

ZED-Score Calculator

`# import the important packages
import pandas as pd # library used for data manipulation and analysis
import numpy as np # library used for working with arrays
import matplotlib.pyplot as plt # library for plots and visualizations
import seaborn as sns # library for visualizations
%matplotlib inline

import scipy.stats as stats # this library contains a large number of probability distributions as well as a growing library of statistical functions
# ZED score comparison

The Z-score formula is:

Z = (X - μ) / σ

Where:

Z is the Z-score

X is the individual data point

μ is the population mean

σ is the population standard deviation

x_1 = 83000
mu_1 = 77000
sigma_1 = 1100

z_1 = (x_1 - mu_1) / sigma_1
print("The Z-score is:", z_1)

x_2 = 92000
mu_2 = 59000
sigma_2 = 1300

z_2 = (x_2 - mu_2) / sigma_2
print("The Z-score is:", z_2)

Formula_A = stats.norm.cdf(z_1) - stats.norm.cdf(z_2)
print (Formula_A)

Formula_B = stats.norm.cdf(x_1,loc=mu_1,scale=sigma_1) - stats.norm.cdf(x_2,loc=mu_2,scale=sigma_2)
print (Formula_B)

`

The above is the detailed content of ZED-Score Calculator. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn