Hypothesis Testing Example
what is hypotheses and hypotheses testing. give practical examples in numerical form
What is a Hypothesis?
A hypothesis is a statement or assumption about a population parameter that we want to test using
sample data. It is usually formulated as a null hypothesis (denoted as H0 ) and an alternative
hypothesis (denoted as H1 or Ha ).
What is Hypothesis Testing?
Hypothesis Testing is a statistical method to decide whether to accept or reject a hypothesis based on
sample data. It involves:
1. Formulating H0 and H1
2. Choosing a significance level (α, e.g., 0.05)
3. Selecting a test statistic (e.g., z-test, t-test)
4. Making a decision based on the p-value or critical value.
Practical Example (Numerical)
Scenario:
A factory claims that the average weight of a sugar packet is 1 kg. You suspect it's less. So you collect a
sample of 10 packets and measure the weight.
Step 1: Define Hypotheses
H0 : μ = 1 kg (The average weight is 1 kg)
H1 : μ < 1 kg (The average weight is less than 1 kg)
Step 2: Collect Data
Sample weights (kg):
0.98, 0.99, 0.97, 0.96, 1.00, 0.95, 0.98, 0.97, 0.96, 0.94
= 10
Sample size n
ˉ = ∑nxi =
Sample mean x
= 0.97
9.7
10
Sample standard deviation s ≈ 0.019
Step 3: Choose Significance Level
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 1/12
Let α = 0.05
Step 4: Test Statistic (One-sample t-test)
ˉ − μ0
x 0.97 − 1.0 −0.03
t= = ≈ ≈ −5
0.019/ 10 0.006
s/ n
Step 5: Compare with t-critical value
Degrees of freedom = n − 1 =9
For α = 0.05, one-tailed t-critical ≈ -1.833
Since t = −5 < −1.833, we reject H0 .
Conclusion:
There is sufficient evidence to suggest that the average weight of the sugar packets is less than 1 kg.
Would you like a Python implementation of this test as well?
whats the value of 'n' what it is ?
Great question!
What is 'n' in Hypothesis Testing?
In statistics, n refers to the sample size, i.e., the number of observations or data points in your
sample.
Why is n Important?
1. It affects the precision of the test.
Larger n → more accurate estimates of population parameters.
2. It influences the standard error, which is used in test statistics like t-tests:
s
Standard Error (SE) =
n
3. It determines the degrees of freedom for many statistical tests, such as:
Degrees of Freedom (df) = n − 1
In Our Example:
We took the weights of 10 sugar packets:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 2/12
0.98, 0.99, 0.97, 0.96, 1.00, 0.95, 0.98, 0.97, 0.96, 0.94
So:
n = 10
This means we are using 10 observations to test the claim.
Would you like to explore how changing n affects the outcome of the hypothesis test?
formula for standard deviation
Absolutely! Here’s the formula for standard deviation, both for a population and a sample — they are
slightly different.
🔹 Sample Standard Deviation (most commonly used):
n
1
s= ∑(xi − x
ˉ )2
n − 1 i=1
Where:
s = sample standard deviation
n = sample size
xi = each data point
ˉ = sample mean
x
🔹 Population Standard Deviation:
N
1
σ= ∑(xi − μ)2
N
i=1
Where:
σ = population standard deviation
N = size of the population
μ = population mean
Quick Example:
Suppose your sample data is:
x = [2, 4, 4, 4, 5, 5, 7, 9]
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 3/12
2+4+4+4+5+5+7+9
ˉ
1. x = 8
=5
2. Squared differences:
(2 − 5)2 , (4 − 5)2 , ⋯ = [9, 1, 1, 1, 0, 0, 4, 16]
3. Sum = 32
32
4. Divide by n − 1 = 7: 7
≈ 4.57
5. Take square root:
s≈ 4.57 ≈ 2.14
Let me know if you want this as a Python function or visual!
how did we get: −1.833 ?
Great follow-up!
The value −1.833 is the critical value from the t-distribution table, and here's how we got it:
🎯 What It Represents:
It’s the t-critical value for:
A one-tailed t-test
A significance level α = 0.05
Degrees of freedom df = n − 1 = 10 − 1 = 9
🔍 How to Find It:
You can look it up in a t-distribution table, or use a calculator like `[Link]` in Python.
For:
df = 9
One-tailed α = 0.05
The critical t-value is:
tcritical = −1.833
(This is the value below which only 5% of the t-distribution lies on the left tail for 9 degrees of freedom.)
✅ Interpretation:
If your calculated t-statistic is less than -1.833, it falls in the rejection region, and you reject H0 .
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 4/12
🧪 Python Code (Optional):
python
from [Link] import t
# Degrees of freedom
df = 9
alpha = 0.05
# One-tailed test (left)
t_critical = [Link](alpha, df)
print(t_critical) # Output: -1.833
Let me know if you’d like the full test coded in Python as well!
some more examples
Absolutely! Let's go through three more numerical examples of hypothesis testing, each using a
different scenario and test type.
🔹 Example 1: Two-tailed t-test (One Sample)
Scenario:
A company claims the average battery life of their phones is 10 hours. A tester believes it's different. A
sample of 8 phones gives:
[9.8, 10.2, 10.5, 9.6, 10.1, 9.7, 10.3, 9.9]
Step-by-Step:
H0 : μ = 10
H1 : μ ≠ 10 (two-tailed)
α = 0.05, n = 8, df = 7
ˉ = 10.0125,
x s ≈ 0.3
10.0125 − 10 0.0125
t= = ≈ 0.118
0.3/ 8 0.106
Critical t-value (two-tailed, df=7, α=0.05):
±2.365
✅ Conclusion:
Since t = 0.118 is between −2.365 and 2.365, do not reject H0 . No significant difference.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 5/12
🔹 Example 2: Left-tailed z-test (Known σ)
Scenario:
A school claims the average math score is 70. You suspect it's lower. Population standard deviation σ =
10, sample of 36 students:
ˉ = 67
x
Step-by-Step:
H0 : μ = 70
H1 : μ < 70
α = 0.05, use z-test since σ is known
67 − 70 −3
z= = = −1.8
10/ 36 1.667
Critical z-value for α = 0.05:
zcritical = −1.645
✅ Conclusion:
Since z = −1.8 < −1.645, reject H0 → average score is significantly lower.
🔹 Example 3: Right-tailed t-test
Scenario:
A nutritionist claims people consume at least 2500 calories/day. A sample of 12 people gives:
[2600, 2550, 2480, 2500, 2490, 2520, 2510, 2485, 2470, 2515, 2530, 2495]
Step-by-Step:
H0 : μ ≥ 2500
H1 : μ < 2500 (left-tailed)
n = 12, df = 11, α = 0.05
ˉ ≈ 2503,
x s ≈ 21.6
2503 − 2500 3
t= ≈ = 0.48
21.6/ 12 6.2
Critical t-value (right-tailed, df=11):
tcritical = 1.796
✅ Conclusion:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 6/12
Since t = 0.48 < 1.796, do not reject H0 . No evidence consumption is lower.
Want me to generate randomized examples for practice or Python scripts for these?
how did you decide alpha value ?
Great question! 🔍
The alpha value (α) — also known as the significance level — is not something we calculate from the
data; it’s something we decide before performing a hypothesis test.
🎯 What is Alpha (α)?
Alpha is the probability of rejecting the null hypothesis when it is actually true.
This is called a Type I error.
🔢 Common Choices for α
Alpha (α) Confidence Level Used When…
0.05 95% Most common in science and social studies
0.01 99% High confidence needed (e.g., medicine)
0.10 90% More tolerant of error (e.g., exploratory studies)
✅ How to Choose?
You pick α based on:
How strict you want to be about avoiding false positives.
The context or field — medicine requires more strictness (smaller α), while early-stage research
may tolerate more error (larger α).
🧠 In Our Examples:
I used:
α = 0.05 as it’s the most commonly accepted standard.
This means: “I am okay with a 5% chance of making a Type I error.”
If you want, I can walk you through how changing α affects the outcome of the test too. Want to see
that?
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 7/12
how did we get: ±2.365
Awesome follow-up again!
The value ±2.365 is the critical t-value for a two-tailed t-test with:
Degrees of freedom df =n−1=8−1=7
Significance level α = 0.05
Two-tailed test, so each tail has α/2 = 0.025
🎯 What does ±2.365 mean?
It tells you the cutoff points for rejecting the null hypothesis in a two-tailed t-test.
If your calculated t-statistic is:
Less than −2.365, or
Greater than +2.365,
then the result is statistically significant, and you reject H0 .
🔍 How We Found It:
We use the t-distribution table or Python to look up the t-critical value for:
df = 7
α/2 = 0.025 (since it's two-tailed)
From the t-table:
t0.025, 7 = 2.365
So, for a two-tailed test, the critical region is:
t < −2.365 or t > +2.365
🧪 Python Code (Optional):
python
from [Link] import t
df = 7
alpha = 0.05
t_critical = [Link](1 - alpha/2, df)
print(f"±{t_critical:.3f}") # Output: ±2.365
Would you like to explore how the t-critical value changes with different sample sizes or significance
levels?
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 8/12
h-index, i10 index, impact factor, cite score, citations,
quartiles (Q1, Q2, Q3, Q4)
Great set of terms! These are all research metrics used to evaluate academic impact—of papers,
journals, and authors. Let’s break them down clearly and concisely:
📊 AUTHOR-LEVEL METRICS
1. h-index (Hirsch Index)
Definition: An author has an h-index of h if they have h papers each cited at least h times.
Example: If you have published 10 papers, and 5 of them have at least 5 citations, your h-index is
5.
➡️ Measures both productivity and impact.
2. i10-index (Google Scholar only)
Definition: The number of publications with at least 10 citations.
Example: If 7 of your papers have 10+ citations, your i10-index = 7.
➡️ Simple metric for citation impact.
📚 JOURNAL-LEVEL METRICS
3. Impact Factor (IF) – Clarivate (Web of Science)
Definition: The average number of citations received in a particular year by papers published in
the last 2 years.
Formula:
Citations in Year X to articles published in Year X-1 and X-2
IF =
Number of citable articles in those two years
Example: If in 2024, articles from 2022–2023 were cited 1000 times and 200 articles were
published →
IF = 1000/200 = 5
4. CiteScore – Scopus (Elsevier)
Definition: Similar to Impact Factor but looks at citations over 4 years.
Formula:
C Y X d
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API.
bl h d X X4 9/12
Citations in Year X to documents published in X-1 to X-4
CiteScore =
Total documents published in those years
Includes more document types than IF (like conference papers, reviews, etc.).
🧾 CITATION COUNT
5. Citations
Definition: Total number of times your work has been cited by others.
Found via: Google Scholar, Scopus, Web of Science, etc.
🏅 JOURNAL RANKING METRICS
6. Quartiles (Q1–Q4)
Used to rank journals within their subject category based on metrics like Impact Factor or
CiteScore.
Quartile Meaning
Q1 Top 25% of journals (highest)
Q2 25%–50%
Q3 50%–75%
Q4 Bottom 25% (lowest)
➡️ Appearing in a Q1 journal is considered very prestigious.
🔁 Summary Table
Metric Applies To Meaning
h-index Author h papers cited ≥ h times
i10-index Author Papers cited ≥ 10 times
Citations Both Total times cited
Impact Factor Journal Avg. citations in 2 years
CiteScore Journal Avg. citations in 4 years
Quartiles Journal Q1 = top 25%, Q4 = bottom 25%
Want help checking the h-index or journal quartile of a specific author/journal?
explain:
IPR- Copyrights, Trademark, Patent- Design and Utility Patent, Procedure
till patent gets granted, Patent Licencing and commercialization
Startup- product registration, Angel investors, Venture Capital
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 10/12
Absolutely! Here's a complete and easy-to-understand explanation of all those concepts. We'll break it
down into two parts:
🔐 Intellectual Property Rights (IPR)
IPR protects creations of the mind — inventions, designs, brand names, etc.
1. Copyright
What it protects: Original works of authorship like books, music, films, software, artwork.
Duration: Typically author’s lifetime + 60 years (varies by country).
You get it automatically when you create the work. No need to register, but registration helps in
legal enforcement.
2. Trademark (™ / ®)
What it protects: Brand identifiers — names, logos, slogans, colors, sounds.
Example: Apple logo, Nike's "Just Do It".
Registered Trademark (®) gives stronger legal rights than the unregistered (™).
3. Patent
What it protects: Inventions — new and useful processes, machines, products, etc.
Types:
Type Description
Utility Patent Protects how an invention works (e.g., engine mechanism, software, new drug).
Design Patent Protects how it looks (e.g., shape of a bottle, smartphone design).
🧾 Patent Procedure (India/General International Process)
1. Idea Validation – Make sure it's novel and useful.
2. Prior Art Search – Check for existing similar patents.
3. Drafting – Write patent claims (technical + legal doc).
4. Filing – Submit application (provisional or complete).
5. Publication – Patent is published after ~18 months.
6. Examination – Request exam; patent office reviews it.
7. Objections – Respond to any rejections/queries.
8. Grant – If all conditions are met, patent is granted.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 11/12
🕒 Time: Usually 2–5 years depending on jurisdiction.
🔑 Patent Licensing & Commercialization
Licensing: You allow someone to use your patent in return for royalty or lump-sum fees.
Exclusive or non-exclusive.
Commercialization: Turning your patent into a product/service and bringing it to market.
You can license it to others or launch your own startup.
🚀 Startup Basics
1. Product Registration
You register your product (if physical) with relevant standards (e.g., ISO, FSSAI, BIS in India).
Protect IP (patents, trademarks).
Sometimes software needs code copyright.
2. Angel Investors
High-net-worth individuals who invest early-stage capital in startups.
Usually in exchange for equity (shares).
Invest in “idea stage” or early MVP (Minimum Viable Product).
3. Venture Capital (VC)
Investment firms that provide large funding to scalable startups with growth potential.
Stages: Seed → Series A → B → C → Exit (IPO/acquisition).
VCs also provide mentorship, networking, and business expertise.
💡 Summary Flow (Startup with Innovation):
Invent something → Apply for a patent → Get granted → Protect brand with trademark → Build
prototype/product → Get product approvals → Seek angel/VC funding → Start commercialization →
Scale → Exit
Let me know if you want visual diagrams, real-world Indian examples, or templates for patent filing or
startup pitch decks!
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 12/12