Pharmacy Statistics Midterms - Hypothesis Testing
Pharmacy Statistics Midterms - Hypothesis Testing
Pharmacy Statistics Midterms - Hypothesis Testing
I. HYPOTHESIS TESTING
Hypothesis
- In statistics, a hypothesis is a claim or statement about a property of a
population.
- Researchers should be contented with studying random sample from a
population
- Should be a representative of a sample to ensure validity of conclusion
- Inferential statistics: process of drawing or generalizing conclusion
from a target population on the basis of the results obtained from a
sample
- How do we draw conclusion based on the sample population? Through
hypothesis testing
- Called “test of significance”- standard procedure/testing for
claims
- Testing of claims
- We test our hypothesis to tell whether our data supports or rejects our
idea
- Hypothesis testing keeps scientists honest
- Hypothesis testing procedure relies on using the information in a
random sample from a population of interest. If the information is
consistent with the hypothesis, then the hypothesis is true. If not, the
hypothesis is not true.
- In hypothesis testing, we have to know the distribution if normally or
skewed to know the formula for testing the hypothesis.
- Central limit theorem: when there is a large enough number of
sample that is drawn randomly in a population, it will follow a
normal distribution
3. Median
2. Level of Significance
→ Avoiding decision errors
DO NOT REJECT
REJECT
H0= false (TYPE √
2 ERROR or
BETA ERROR)
H0= true (TYPE 1 √
ERROR or
ALPHA ERROR)
→ Type 1 error or alpha error: we reject the null hypothesis
even if it is true
→ Type 2 error or beta error: we do not reject the null
hypothesis even if it is false
→ At what point do we reject the null and accept the alternative
→ Before carrying out any test, determine the level of significance
→ Level of significance should already be set to prevent bias
→ Denoted as alpha
→ Alpha level of significance
→ Alpha level is the probability that the test statistics will fall
in the critical region when the null hypothesis is true
jem summer
REJECT DO NOT
REJECT
If the computed value √
is greater than the
positive critical
region
If the computed value √
is less than the
positive CR
If the computed value √
is less than the
negative C.R
jem summer
2. Level of Significance:
→ α =0.05
→ Co
mputed value: 7.22
jem summer
→ P-value: 0.0022
6. Statistical Decision
→ Since the P-value = 0.0022 is less than α – 0.05, reject H 0
SUMMARY
1. State the null and alternative hypothesis
2. Determine the level of significance
3. Identify the test statistics depending on the objectives
4. Determine the critical region
5. Compute for the test statistics or analyze data using statistical software
6. State your statistical decision
7. State your conclusion
jem summer
SAMPLE PROBLEM
1. If the cure rate for a new drug is 80%, what is the. Probability that at
most, 70% of 50 patients administered with the drug will be cured?
since it met the standard, the sample size is large enough and the
properties of the sampling distribution of the proportions that were
enumerated may be used
next step is transforming
use formula: z= p-P / square root of P(1-P) / n
input: 0.7-0.8 / square root (0.8) (0.2) / 50
-1.77
Check the value in the z-table
Plot in the graph
Where:
P1: Proportion of Magallanes
P2: Proportion of Alfonso
N1: sample size of Magallanes
N2: sample size of Alfonso
How do we get the pooled proportion: we will get the
overall total which is 414 and 410 equals to 824.
+2.83
Step 6: Statistical decision
Since the computed value is greater than 1.96, reject the
null
Step 7: Conclusion
The proportion of the children that was immunized is not
equal to 80%; it is significantly higher
Where:
P1 = proportion of the 1st sample
P2 = proportion of the 2nd sample
Q1 = 1 – P1
Q2 = 1 – P2
n1, n2 = samples in the 1st and 2nd group
Where:
z = z-test
x = sample mean
µ = population mean
n = samples
δ = population standard deviation
Where:
z = z-test
x1 = mean of the 1st sample group
x2 = mean of the 2nd sample group
n1 , n2 = samples in the 1st and 2nd group
δ = population standard deviation
The difference here is that we use the value in sample population rather
than in target population.
SAMPLE PROBLEM
1. A sports biologist claimed that female distance runners tend to be
taller on the average than women in general, who have an average
height of 64 inches. To test this claim, a random sample of 40 female
jem summer
(65.6−64)√ 64
z=
3.3
+3.07
Step 6: Statistical decision
Since the computed value = +3.07 is greater than +1.64,
reject null
Step 7: Conclusion
The mean height of female distance runners is greater than
64 inches.
2. Suppose that a journal article reports that the mean age at marriage of
Filipino women is 22.6 years in urban and 18.4 years in rural areas.
These findings are based on a sample survey of 150 urban and 180
rural women. The report did not indicate the corresponding variances
of the estimates. However, a review of past data shows that the
variances for the age at marriage of Filipino women are 7.2 and 5.8 for
urban and rural areas, respectively. Is there a significant difference
between the age at marriage of women in urban and rural areas? Use
alpha=0.01.
x 1−x 2
z=
σ 21 σ 22
√ +
n1 n 2
Where:
X1= urban
X2= rural
Input value:
22.6−18.4
¿
7.2 5.8
√ +
150 180
+14.83
jem summer
High Salt diet mean SBP = 138 mmHg s.d. = 11.9 mmHg
Low Salt diet mean SBP = 120 mmHg s.d. = 12.2 mmHg
We want to compare two groups with high salt diet and low salt
diet
Step 1: make a null and alternative hypothesis. Alternative
hypothesis is the claim.
H0: Mlow= Mhigh; The mean SBP of persons aged 15
years and over with low salt diet is equal to that with high
salt diet.
Ha: Mlow ≠ Mhigh: The mean SBP of persons aged 15
years and over with low salt diet is not equal to that with
high salt diet.
Step 2: Level of Significance
Alpha level: 0.05 or 5%
Step 3: Test Statistics
T-statistics because population variance is UNKNOWN.
And the given standard deviation is for the 20 subjects. It is
not indicated if it is from past studies
Step 4: Critical region
Based not only on the alpha level of significance (0.05), but
also on the degrees of freedom
https://www.studocu.com/en-au/document/australian-
national-university/quantitative-research-methods/lecture-
notes/t-table-quantitative-research-methods/1062146/view?
fbclid=IwAR3LPH0eFFVc6IGSNG-
66wWgsU8N3kAmFtNPtQxX9u4AvtpATT2dyK4vakU
jem summer
Where:
X1= high salt diet
X2= low salt diet
Since the values are in standard deviation and we want
variance, we will square it.
jem summer
Input value:
138−120
¿ z=
11.9❑2 12.22❑
+4.72
√ 20
+
20
4. The average number of persons per household for the whole country
based on the 1980 census results is 5.6. If a random sample of 25
households in a survey done lately showed a mean household size of
5.2 persons with a standard deviation of 1.56, does the result indicate
that there has been a change in the mean household size in the
Philippines since the last census? (Use alpha = 0.10)
Step 1: make a null and alternative hypothesis. Alternative
hypothesis is the claim.
H0: M = 5.6; The mean household size is equal to 5.6.
Ha: M ≠ 5.6: The mean household size is not equal to 5.6.
Step 2: Level of Significance
Alpha level: 0.10 or 10%
Step 3: Test Statistics
T-statistics because population variance is UNKNOWN.
And the given standard deviation is for those who were
surveyed. The population variance and population standard
deviation is not known.
Step 4: Critical region
Based not only on the alpha level of significance (0.05), but
also on the degrees of freedom
https://www.studocu.com/en-au/document/australian-
national-university/quantitative-research-methods/lecture-
notes/t-table-quantitative-research-methods/1062146/view?
fbclid=IwAR3LPH0eFFVc6IGSNG-
66wWgsU8N3kAmFtNPtQxX9u4AvtpATT2dyK4vakU
Df: n-1 for one sample
Df: n1 + n2 – 2 for two samples
Since we only have one sample, use n-1
jem summer
N= 25
25-1 = 24
Df: 24
two-tailed; divide 0.10 into 2 which is each side will be
0.05
Look for the closest value of 24 in the T-table, which gives
1.711
CR= +/- 1.71
If the computed value is greater than + 1.71, reject the null
If the computed value is less than -1.71, reject the null
If the computed value is less than +1.71, do not reject the
null
If the computed value is greater than -1.71, do not reject the
null
Input value:
( 5.2−5.6 ) √ 25−1
¿ z=
1.56
-1.26
Step 6: Statistical decision
Since the computed value = -1.26 is greater than -1.711, do
not reject null
Step 7: Conclusion
jem summer
Types of ANOVA
1. One-Way ANOVA
Example 1: A researcher wants to test a new anti-anxiety
medication. They split participants into three conditions (0 mg,
50 mg, and 100 mg), then ask them to rate their anxiety level
on a scale of 1-10, with 10 being “high anxiety” and 1 being
“low anxiety”. Are there any differences between the three
conditions?
2. Two-Way ANOVA
Example 2: A physical therapist wished to compare three
methods for teaching patients to use a certain prosthetic device.
He felt that the rate of learning would be different for patients
of different ages and wished to design an experiment in which
the influence of age could be taken into account.
jem summer
3. Repeated-Measures ANOVA
Example 4: A researcher wants to test a new anti-anxiety
medication. They measure the anxiety of 7 participants three
times: before taking the medication, one week after taking the
medication, and two weeks after taking the medication. Are
there any differences between the three time periods?
jem summer
STATISTICAL HYPOTHESES
1. H0: The t treatments have equal effects.
2. Ha: At least one of the t treatments is different.
Decision Rule
In general, the decision rule is: reject the null hypothesis if the
computed value of V.R. is equal to or greater than the critical
value of F for the chosen α level.
Conclusion
If H0 is not rejected → there is no sufficient evidence
from the data to indicate that, not all population means
are equal.
jem summer
Software Output
jem summer
Introduction
1. Several factors with different levels and the respondents are randomly
assigned to each level or each group.
2. However, there are cases wherein you just randomly assign
respondents to each groups or levels, there’s a possibility of bias due
to confounding variables.
3. In RCBD, you identify your confounding variable and you group them
to a particular confounding variable.
4. To compare different levels of the certain factor, if there is a
significant difference between two or more groups.
5. The technique for analyzing the data from RCBD is two-way ANOVA
since the observation is characterized on the basis of two criteria
which is the block and the treatment group to which the respond
6. Randomized complete block design (RCBD) is a design in which the
units (called experimental units) to which the treatments are applied
jem summer
Decision Rule
In general, the decision rule is: reject the null hypothesis if the
computed value of V.R. is equal to or greater than the critical value
of F for the chosen α level.
Conclusion
If H0 is not rejected → there is no sufficient evidence from the
data to indicate that, not all population means are equal.
If H0 is rejected → not all population means are equal (i.e., at least
one population mean difference is not equal to the others.
Since the p-value 0.00147 is less than the alpha, do not reject.
The data is normally distributed/normal
jem summer
FACTORIAL EXPERIMENTS
Introduction
1. Study of two or more factors then we compare those factors
2. CRD – one set of treatments (a factor) is applied to homogenous
experimental units.
jem summer
5. Interaction
Presence of interaction between two factors can affect the
characteristics of the data in a variety of ways.
To illustrate the effects of interaction, consider the data shown
below.
STATISTICAL HYPOTHESES
1. For Factors A and B, we will make null and alternative hypotheses
for each factors; same goes for the interaction. The hypothesis for
Factors A and B is just the same as before.
2. For Factor A:
H0: α1 = α2=…=αa=0
Ha: At least one of the α’ s≠0
3. For Factor B
H0: β1 = β2=…= βb=0
Ha: At least one of the β’ s≠0
4. For the interaction:
jem summer
For the data (0.33816), since it is higher than the alpha, we do not
reject the null. Therefore, data is normal.
For the variance (0.6503), do not reject the null. The population
variances are all equal.
If ever there is no interaction between the center and the doses and
you found out that there is a difference between the different doses,
you are going to conduct multiple pairwise comparison. Interpret
all the p-values. Since there is interaction, this is no longer
applicable. Just write N/A.
REPEATED-MEASURES DESIGN
Introduction
1. One of the most frequently used experimental designs in the health
sciences field is the repeated measures design.
2. One factor with at least two levels, levels that are dependent are called
repeated-measures one-way ANOVA.
Simple Repeated-Measures Design
1. Simple repeated-measures design (SRMD) is an experimental design
in which the measurements of the same variable are made on each
subject on two or more different occasions.
2. Common for anti-inflammatory drugs, topical preparations
Repeated-Measures ANOVA
Example 3.3: A researcher wants to test a new antianxiety
medication. They measure the anxiety of 7 participants three times:
before taking the medication, one week after taking the
medication, and two weeks after taking the medication. Are there
any differences between the three time periods?
jem summer
Get the average of H-F and G-G which is around 0.63 Since it is
0.63, based on our adjustment, the p-value that we are going to use
is the G-G epsilon because it is less than 0.75.
The p-values are below and we are going to use the G-G adjust p-
value and we are going to base our alternative hypothesis for that.
Since it is less than the alpha, at least one of the three time period
has a significantly different anxiety level.
And then determine which time period that is.