# Inferential statistics is the practice of using sampled data to draw conclusions or make predictions about a larger sample data sample or population.

**# INFERENTIAL STATISTICS:

# P-Value :** 
# in between 0 - 1

**# Hypothesis Testing:**
# NuLL hypothesis
# Alternative hypothesis

**# Descriptive Statistics:**
# Mean
# Median
# Mode
# Standard Deviation

**# Probability Distribution:**
# Discrete
# Continuous

**# Key Terms:**
# Significance Level / Alpha Value Standarize as '0.05' as a 95% Confidence Level
# Critical Value
# T-Test
# One-Tail Test
# Two-Tail Test
# P-Value

**# T-Distribution table link:**
# <https://www.sjsu.edu/faculty/gerstman/StatPrimer/t-table.pdf>

**# --------------------------------------------------------------

# Significance Level / Alpha Value:** 
# Standarized as '0.05' with 95% Confidence Level on the T-Distribution
****
**# --------------------------------------------------------------

# Critical Value:**
# This is the value that you check on your T-Distribution Table based on Alpha Value and the T-Test 

**# --------------------------------------------------------------**

**# T-Test:**

from statistics import math

sample_mean = 4.79
pop_mean = 4.5
sample_std = 0.8
n = 14

statistic = (sample_mean - pop_mean) / (sample_std / math.sqrt(n))
print(statistic)

1.356350802705554 <- # this value is checked on the T-Distribution Table based on our 'N' which is 14 and. with the alpha value '0.05'

**# --------------------------------------------------------------**

**# One-Tail Test:**
# One-Tail Test only testing one tail = One critical region
****
**# --------------------------------------------------------------**

**# Two-Tail Test:**
# Two-Tail Test only testing Two tails = Two critical region
****
**# --------------------------------------------------------------

# Pooled T-Test / Two Sample indepedent T-Test:

EXAMPLE:**

# males
sample_mean1 = 105.5
sample_std1 = 20.1
n1 = 34

# females
sample_mean2 = 90.9
sample_std2 = 12.2
n2 = 29

pooled_sample_std = math.sqrt(
      ((n1-1) * sample_std1 ** 2 + (n2-1) * sample_std2 **2) / (n1 + n2 - 2))

statistic = (sample_mean1-sample_mean2)/(pooled_sample_std*math.sqrt((1/n1)+(1/n2)))

statistic
3.4101131776909535

from scipy.stats import t

print("P value is: ", 1- t.cdf(statistic,n1+n2-2))
P value is:  0.0005783712704484634

print("Critical Value of z is: ", t.ppf(0.025, n1+n2-2))
Critical Value of z is:  -1.9996235841149783

print("We reject the NuLL Hypothesis")
We reject the NuLL Hypothesis