Lecture 2 Flashcards
Anytime you use the entire population to calculate for a particular parameter such as the mean what is that parameter called?
When you use the sample to calculate for a parameter such as the mean, what is that parameter called?
Population parameter
A statistic
a range of values in which there is a degree of certainty that it contains the population parameter is called?
What provides a range of values that is likely to contain the population parameter based on a sample statistic?
A value calculated from a sample that is used to estimate the population parameter (e.g., sample mean, sample proportion) is called what value?
the degree of variability around an estimate of a population parameter is termed as?
A. Accuracy
B. Precision
C.Bias
D. Standard error
What is the meaning of 95 percent confidence interval
Here’s a full MCQ with two additional options:
Question:
The degree of variability around an estimate of a population parameter is termed as:
A. Accuracy
B. Precision
C. Standard Error
D. Bias
Correct Answer:
B. Precision
Explanation:
- Accuracy refers to how close an estimate is to the true population parameter.
- Precision refers to the degree of variability around the estimate. Lower variability means higher precision.
- Standard Error quantifies the precision but is not the general term for the degree of variability.
- Bias refers to systematic error that skews results away from the true population parameter.
Confidence interval (CI) is a range of values in which there is a degree of certainty that it contains the population parameter
CI indicates the precision of an estimated statistic of a population parameter. (NB: Precision is the degree of variability around an estimate of a population parameter)
• Population Parameter: A value that describes a characteristic of the entire population (e.g., population mean, population proportion).
• Sample Statistic: A value calculated from a sample that is used to estimate the population parameter (e.g., sample mean, sample proportion).
Understanding the Confidence Interval
A confidence interval (CI) provides a range of values that is likely to contain the population parameter based on a sample statistic.
Explanation of the 95% Confidence Interval
When we say that we have a 95% confidence interval for a population parameter, it means:
1. Sampling and Intervals: If we were to take 100 different random samples from the same population and compute a confidence interval for each sample: • Each interval is based on a sample statistic (e.g., sample mean). • We use these sample statistics to estimate the population parameter. 2. Containment of the Population Parameter: • About 95 of these 100 confidence intervals will contain the true population parameter (e.g., population mean). • About 5 of these intervals will not contain the true population parameter.
Why Mention Population Parameter with Samples?
The purpose of calculating a confidence interval from a sample is to estimate the population parameter. While the interval is based on the sample, it is used to infer information about the population.
95% CI means that if we were to select 100 random samples from the population and use these samples to calculate 100 different confidence intervals for a given population parameter, approximately 95 of the intervals will contain the parameter
and 5 will not
Or that
Let’s use a very simple example with the concept of sample, population, and different samples to explain confidence intervals.
Population: Suppose we want to know the average height of all students in a school. The population is all the students in the school.
Sample: Since measuring every student’s height is impractical, we take a sample, which is a smaller group of students. Let’s say we randomly select 30 students and measure their heights.
- Sample 1: We measure the heights of our first sample of 30 students and find the average (sample mean) height is 150 cm.
To create a 95% confidence interval:
1. Calculate the sample mean (already given as 150 cm).
2. Calculate the margin of error (using statistical formulas, let’s say it’s 5 cm).
[
\text{Confidence Interval} = 150 \text{ cm} \pm 5 \text{ cm} = (145 \text{ cm}, 155 \text{ cm})
]
We are 95% confident that the true average height of all students in the school (the population) is between 145 cm and 155 cm based on this sample.
Now, let’s take another sample of 30 different students to see how the confidence interval might change:
- Sample 2: We measure the heights of another group of 30 students and find the average height is 148 cm.
- Calculate the margin of error (let’s assume it remains 5 cm).
[
\text{Confidence Interval} = 148 \text{ cm} \pm 5 \text{ cm} = (143 \text{ cm}, 153 \text{ cm})
]
We are 95% confident that the true average height of all students in the school is between 143 cm and 153 cm based on this second sample.
- Different Samples, Different Intervals: Each sample gives us a slightly different estimate and a slightly different confidence interval.
- Confidence Level: The 95% confidence level means that if we repeated this process many times (taking many samples and calculating confidence intervals), 95% of the intervals would contain the true population mean.
- True Population Mean: We never know the exact true population mean, but the confidence interval gives us a range where it is likely to be.
- Population: All students in the school.
- Sample: A group of 30 students selected randomly.
- Different Samples: Taking multiple samples can give slightly different results.
- Confidence Interval: Provides a range that likely contains the true population mean with a certain level of confidence.
Using different samples, we see that the confidence interval helps us understand the uncertainty and variability in our estimates of the population mean.
In hypotheses testing we have research hypothesis and statistical hypothesis
What is the difference ?
What are two types of statistical hypotheses and define them
What is hypothesis testing
Research hypothesis: It is the prediction or supposition that motivates the study
Once the research hypothesis is known, it has to be framed in such a way that statistical techniques can be used to evaluate it or you have to be able to use statistical techniques to evaluate the research hypothesis
This new statement of the hypothesis is called statistical hypothesis.
Statistical hypothesis is the statement you make from the research hypothesis that you can use statistical methods to evaluate the hypothesis.
So if you can’t use statistical methods to evaluate the hypothesis, it is not a statistical hypothesis. It is just a research hypothesis
The statistical hypothesis involves the null and alternative hypotheses
The null hypothesis is often stated that “any observed differences are entirely due to sampling errors (i.e chance)” because there’s no relationship between the variables but alternative hypothesis is a contradiction to this statement that says it’s not due to chance cuz there’s a relationship between the two variables.
Imagine a study aiming to test the effectiveness of a new medication compared to a placebo.
1. Null Hypothesis (H₀): • “The new medication has the same effect as the placebo.” • This means any observed difference in effects between the medication and the placebo is attributed to random sampling error or chance. 2. Alternative Hypothesis (H₁): • “The new medication has a different effect (better or worse) than the placebo.” • This implies that the observed difference in effects is real and not due to chance.
Hypothesis testing: This is a method used by statisticians to determine how likely it is that the observed differences in data are entirely due to sampling error (i.e chance) rather than to underlying population differences.
Hypothesis continued:
Example of research hypothesis and statistical hypothesis
Between alternate and null hypothesis, which states that the proportion of the outcome (e.g., success rate, incidence of an event) is the same in both the exclusive group and the non-exclusive group?
Examples
Research hypothesis: There is no statistical significant relationship between exclusive breastfeeding and infant mortality
Statistical Hypothesis
Hsubscript0: Pexclusive=Pnot-exclusive
Null Hypothesis (H₀)
H_0: P_{exclusive} = P_{not-exclusive}
• Meaning: The null hypothesis states that the proportion of the outcome (e.g., success rate, incidence of an event) is the same in both the exclusive group and the non-exclusive group. Any observed difference in proportions is due to random chance.
HsubscriptA: Pexclusive≠Pnot-exclusive
Alternative Hypothesis (H₁)
H_1: P_{exclusive} \neq P_{not-exclusive}
• Meaning: The alternative hypothesis states that the proportion of the outcome is different between the exclusive group and the non-exclusive group. The observed difference in proportions is not due to chance but reflects a real difference.
Pexclusive= Proportion of deaths among exclusively breastfed
infants
Pnot-exclusive= Proportion of deaths among infants not exclusively
breastfed
Given your definitions:
• P_{exclusive} : Proportion of deaths among exclusively breastfed infants. • P_{not-exclusive} : Proportion of deaths among infants not exclusively breastfed.
Research hypothesis: There is no statistical significant relationship between exclusive breastfeeding and infant mortality
Hypotheses
1. Null Hypothesis (H₀) • H_0: P_{exclusive} = P_{not-exclusive} • This means that the proportion of deaths is the same for both exclusively breastfed infants and non-exclusively breastfed infants. 2. Alternative Hypothesis (H₁) • H_1: P_{exclusive} \neq P_{not-exclusive} • This means that the proportion of deaths is different between exclusively breastfed infants and non-exclusively breastfed infants.
Hypotheses Recap:
1. Null Hypothesis (H₀) • H_0: P_{exclusive} = P_{not-exclusive} • This means that the proportion of deaths is the same for both exclusively breastfed infants and non-exclusively breastfed infants. 2. Alternative Hypothesis (H₁) • H_1: P_{exclusive} \neq P_{not-exclusive} • This means that the proportion of deaths is different between exclusively breastfed infants and non-exclusively breastfed infants.
Possible Outcomes and Inferences:
- Rejecting the Null Hypothesis (H₀):• Decision: If the p-value obtained from the statistical test (e.g., two-proportion z-test) is less than the significance level (commonly 0.05), we reject the null hypothesis.
• Inference: There is sufficient evidence to conclude that there is a statistically significant difference in the proportion of deaths between exclusively breastfed infants and non-exclusively breastfed infants.
• Implication: Exclusive breastfeeding is associated with a different mortality rate compared to non-exclusive breastfeeding. - Failing to Reject the Null Hypothesis (H₀):• Decision: If the p-value is greater than the significance level, we fail to reject the null hypothesis.
• Inference: There is insufficient evidence to conclude that there is a statistically significant difference in the proportion of deaths between exclusively breastfed infants and non-exclusively breastfed infants.
• Implication: The data do not provide enough evidence to suggest that exclusive breastfeeding impacts infant mortality differently compared to non-exclusive breastfeeding. However, this does not prove that there is no difference; it only indicates that any observed difference might be due to random chance based on the sample data
What is the p value
What is significance level?
Which p value is statistically significant and which isn’t?
Which p value is preferred?
P-value is the probability of obtaining a result as extreme as (or more extreme than) the observed if the null hypothesis were true.
P-values have cut-off called significance level and if it is less than the cut-off, the null hypothesis is rejected; otherwise it will not be rejected
Traditionally, p=0.05 is preferred. Therefore
p<0.05 is considered statistically significant
p≥0.05 is not considered statistically significant
For example p=0.008 is statistically significant
So if p value is more than 0.05 it means you have enough evidence to support the null hypothesis but not enough to accept the alternate one hence you fail to reject the null hypothesis so you fail to reject the null hypothesis at a significant level of 0.05 (or whatever p value you get)and you say there is no association between A and B.
If p value is less than 0.05, it means you don’t have enough evidence to support your hypothesis hence you reject the null hypothesis (so you reject the null hypothesis at a significant level of 0.05 (or whatever p value you get)and you say there is an association between A and B.
K In statistical hypothesis testing, if you fail to reject the null hypothesis, it means you do not have enough evidence to support the alternative hypothesis. However, this does not mean that you accept the null hypothesis as true. Instead, you conclude that there is insufficient evidence to make a definitive statement about the effect or difference you were testing for.
- Evidence Limitation: Failing to reject the null hypothesis simply indicates that the data did not provide strong enough evidence against it. It does not prove that the null hypothesis is true.
- Sample and Power: The result could be due to a small sample size or insufficient power in the study, meaning that even if there is an effect, your study might not be able to detect it.
- Scientific Skepticism: In science, we usually avoid claiming certainty. Just as rejecting the null hypothesis doesn’t prove the alternative hypothesis absolutely, failing to reject the null hypothesis doesn’t prove it is true.
Imagine you’re testing a new drug to see if it lowers blood pressure compared to a placebo.
- Null Hypothesis (H₀): The new drug has no effect on blood pressure.
- Alternative Hypothesis (H₁): The new drug lowers blood pressure.
After conducting the study, you calculate the p-value and find it to be 0.08 (greater than 0.05).
- Fail to Reject H₀: You conclude that there isn’t enough evidence to support that the new drug lowers blood pressure. However, this does not mean you accept that the drug has no effect. It means you don’t have enough evidence to show that it does.
- Further Research: More data or a more powerful study might be needed to detect an effect if it exists.
- Decision Making: Based on the current evidence, you might decide not to approve the drug, but you wouldn’t claim definitively that the drug doesn’t work. Further studies might be warranted.
- Failing to reject the null hypothesis: Indicates insufficient evidence against the null hypothesis.
- Not accepting the null hypothesis: You remain neutral regarding the null hypothesis; you neither confirm it as true nor prove it false.
- Future Research: Often, this result suggests the need for additional research, larger sample sizes, or different experimental designs to further investigate the question.
This cautious approach helps maintain scientific rigor and avoids drawing premature or incorrect conclusions from insufficient data.
The p value is like your evidence in the court that proves that the null hypothesis is true. So it could either be enough evidence to prove this or it may not be enough evidence
So hypothesis for the courtroom analogy :
Alternate hypothesis-He stole the boat
Null- he didn’t steal the boat
Exactly! Let’s build on that courtroom analogy with the hypotheses clearly defined:
-
Null Hypothesis (H₀): He didn’t steal the boat.
- This is the assumption of innocence. Just like in court, where we assume the defendant is innocent until proven guilty.
-
Alternative Hypothesis (H₁): He stole the boat.
- This is the claim we are trying to prove. We need enough evidence to reject the null hypothesis and conclude that he is guilty.
- Investigation/Trial: Think of this as conducting an experiment or study to gather data.
- Observed Results: These are the pieces of evidence we present in court. For example, witnesses, fingerprints on the boat, surveillance footage, etc.
- The p-value is like the strength of the evidence presented in court.
-
Small p-value (e.g., 0.01 or 1%):
- This means the evidence is very strong.
- It’s very unlikely that we would see this evidence if the defendant were actually innocent.
- In our analogy: There is strong evidence that he stole the boat, so we reject the null hypothesis (he didn’t steal the boat) and conclude that he is likely guilty.
-
Large p-value (e.g., 0.4 or 40%):
- This means the evidence is weak.
- It’s quite likely that we would see this evidence even if the defendant were innocent.
- In our analogy: There is not enough evidence to conclude he stole the boat, so we do not reject the null hypothesis (he didn’t steal the boat).
- Start with the Assumption: He didn’t steal the boat (null hypothesis).
- Collect Evidence: Gather testimonies, physical evidence, and other relevant information.
-
Evaluate Evidence (p-value):
- Small p-value: Strong evidence against the null hypothesis (evidence is unlikely to occur by chance if he didn’t steal the boat). We reject the null hypothesis and conclude he likely stole the boat.
- Large p-value: Weak evidence against the null hypothesis (evidence could easily occur by chance if he didn’t steal the boat). We do not reject the null hypothesis and conclude there isn’t enough proof that he stole the boat.
- Null Hypothesis (H₀): The new drug has no effect (like assuming he didn’t steal the boat).
- Alternative Hypothesis (H₁): The new drug lowers blood pressure (like claiming he stole the boat).
- Collect Data: Conduct a clinical trial and measure the blood pressure reduction.
-
Calculate the p-value: This tells us how likely it is to see the observed reduction (or more extreme) if the drug really has no effect.
- Small p-value: Strong evidence against the null hypothesis. We conclude the drug likely has an effect (like concluding he stole the boat).
- Large p-value: Weak evidence against the null hypothesis. We conclude there isn’t enough evidence to say the drug works (like concluding there isn’t enough proof he stole the boat).
- p-value: Measures the strength of the evidence against the null hypothesis.
- Small p-value: Strong evidence, likely to reject the null hypothesis (like finding the defendant guilty based on strong evidence).
- Large p-value: Weak evidence, unlikely to reject the null hypothesis (like finding the defendant not guilty due to insufficient evidence).
Using the court analogy, the p-value helps us determine whether the evidence (data) is strong enough to reject our initial assumption (null hypothesis) and accept an alternative conclusion.
What does a p value of more than 0.05 mean
What value less than or equal to 0.05
After performing a statistical test, the result will include a p-value. Here’s how you interpret it:
- p-value ≤ 0.05: This is typically considered statistically significant. It suggests that the observed data is unlikely under the null hypothesis, so you reject the null hypothesis.
- p-value > 0.05: This is typically considered not statistically significant. It suggests that the observed data is not unusual under the null hypothesis, so you do not reject the null hypothesis.
- p-value = 0.03: Since 0.03 is less than 0.05, it indicates strong evidence against the null hypothesis. You would reject the null hypothesis.
- p-value = 0.08: Since 0.08 is greater than 0.05, it indicates weak evidence against the null hypothesis. You would not reject the null hypothesis.
Yes, 0.008 is less than 0.05.
When comparing p-values to a significance level (commonly 0.05), a p-value of 0.008 indicates that the result is statistically significant. This means there is strong evidence against the null hypothesis, and you would reject the null hypothesis in favor of the alternative hypothesis.
- p-value = 0.008: Since 0.008 is less than 0.05, the evidence against the null hypothesis is strong enough to reject it. This suggests that the observed effect is unlikely to have occurred by chance, and there is likely a real effect.
The calculation of a p-value depends on the type of statistical test being performed. Here’s a simplified explanation using a common test:
A t-test is used to compare the means of two groups.
-
Formulate Hypotheses:
- Null Hypothesis (H₀): There is no difference in means between the two groups.
- Alternative Hypothesis (H₁): There is a difference in means between the two groups.
-
Collect Data:
- Assume you have two groups with sample sizes ( n_1 ) and ( n_2 ).
- Calculate the means (( \bar{X_1} ), ( \bar{X_2} )) and standard deviations (( s_1 ), ( s_2 )) of each group.
-
Calculate the Test Statistic:
- The t-statistic measures the difference between the two sample means relative to the variation in the sample data.
- Formula for the t-statistic for two independent samples:
[
t = \frac{\bar{X_1} - \bar{X_2}}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2
What is the chi square test
What is it used for
The chi-squared test is used to determine the association between two categorical variables
In effect, it determines the difference in proportions between two or more categories
Yes, that’s correct!
The Chi-Square Test is used to determine whether there is a significant difference in the proportions between two or more categories of a categorical variable. It checks if the observed distribution of categorical data differs from what we would expect by chance.
For example, if you’re analyzing whether there is an association between gender (male, female) and voting preference (party A, party B), the Chi-Square Test can help determine if the proportion of males and females voting for each party is significantly different from what we would expect if there were no association.
If you have multiple categories or levels within your variables, the Chi-Square Test can still be applied to determine whether there are differences in proportions across all categories.
In an MCQ setting that states “Chi-Square measures association between multiple categories,” you would typically choose True if the context is about comparing proportions across multiple categories within two categorical variables.
However, if the question implies that Chi-Square can measure associations among more than two categorical variables (i.e., three or more variables simultaneously), then the statement would be False because the standard Chi-Square Test of Independence is specifically for testing the association between two categorical variables.
So, to clarify:
- If “multiple categories” refers to different levels within two categorical variables (e.g., different age groups and different income brackets), then the answer is True.
- If the question suggests that Chi-Square tests association between more than two separate categorical variables (e.g., gender, education level, and voting preference), then the answer is False.
The key is in how “multiple categories” is being interpreted.
You have three categorical variables that you want to test the association between them
Can you use the chi squared test and why?
No you can’t use it cuz it checks for two CATEGORICAL variables
If you want to check association for more than two categorical variables, u use T Test
I’m not clear on this info
It seems there might be some confusion. Let me clarify:
- Chi-Square Test: This test is indeed used to check for an association between two categorical variables. It is one of the most common tests used in such scenarios.
- T-Test: This test is typically used to compare the means of two groups to see if they are statistically different from each other. The T-Test is generally used for continuous data, not categorical data.
If you want to check associations between more than two categorical variables, you would use methods like Logistic Regression (if the outcome is binary) or Multinomial Logistic Regression (if the outcome has more than two categories), or you might consider more advanced tests like Cochran’s Q Test or Fisher’s Exact Test for small sample sizes.
If you’re working with more than two groups and want to compare means, you’d use an ANOVA (Analysis of Variance) rather than a T-Test.
There’s a table on the chi square
What are the observed frequencies in this table?
How is degree of freedom for a chi square test in a contingency table calculated?
a,b,c,d are the observed frequencies
Degree of freedom(df)= (number of rows(r)-1) x (number of columns(c)-1)
How are expected frequencies in chi square calculated?
Check the slide in the biostat 2 slides
So for the value a, expected frequency is a+bxa+c divided by n
a+b is the total number of observed frequencies by row for value a and a+c is the total number of observed frequencies by column all divided by the total number of frequencies whether by row or column
Explain the difference between observed frequencies and expected frequencies in chi squared testing
Which is based on the assumption that there is no association between the two variables in the contingency table
In the context of the chi-square test of independence or goodness-of-fit, the terms “observed frequency” and “expected frequency” refer to different concepts:
-
Observed Frequency:
- This refers to the actual counts or frequencies observed in your data.
- It represents the number of times a particular outcome or category appears in your sample or dataset.
- For example, if you are conducting a survey and tallying responses, the observed frequency is the number of respondents who chose a specific option.
-
Expected Frequency:
- This refers to the frequencies that you would expect to observe under a null hypothesis of no association (in chi-square test of independence) or under a specified distribution (in chi-square test of goodness-of-fit).
- It is calculated based on the assumption that there is no relationship between the variables (in independence test) or that the data follow a specified distribution (in goodness-of-fit test).
- For example, in a chi-square test of independence, if there is no relationship between two categorical variables, the expected frequency for each cell (combination of categories) is calculated based on the marginal totals of the table and assuming no association between the variables.
Key Differences:
- Purpose: Observed frequencies are the actual data you have collected or observed, whereas expected frequencies are calculated based on a null hypothesis assumption or a specified distribution.
- Calculation: Observed frequencies are directly counted from your data, while expected frequencies are computed using mathematical formulas or assumptions (e.g., based on marginal totals, proportions, or theoretical distributions).
- Testing: In chi-square tests, the comparison between observed and expected frequencies helps determine whether the observed data significantly differ from what would be expected under the null hypothesis (independence or specified distribution).
In summary, observed frequencies are the actual counts observed in your data, while expected frequencies are the theoretical counts or frequencies you would expect under certain assumptions or hypotheses. The chi-square test assesses whether the observed frequencies significantly deviate from the expected frequencies, providing insights into the relationship between variables or the fit of data to a specified distribution.
Interpret this p value for this hypothesis:
There is an association between dogs and cats
P value is 0.001
Because the p value is 0.001, we reject the null hypothesis at significant level of 0.05 and we conclude that there is an association between A and B
(We reject the null hypothesis because we do not have enough evidence to support the null hypothesis which says there is no association since the p value is less)
. Since there’s no enough evidence to support the hypothesis that there’s no association, we reject this hypothesis that there is no association and we say that there is an association)
If it was more than the 0.05, we would have enough evidence to support the null hypothesis so we will say we fail to reject the null hypothesis because the evidence we have shows that there is no association (the null hypothesis )
Question: use the table in the slides to examine the association between wearing helmet and head injury
Second question: which category had higher proportion of head injury?
Answer to second question:
So you’re focusing on the numbers that have to do with the category of yes there was head injury. So between those who wore helmet and those who didn’t, which category has higher proportion of head injury?
It’s those who didn’t wear helmet cuz their proportion of those who don’t wear helmet but have head injury is 33.75 and those who wear helmet and have head injury is 11.56
State two other ways of comparing categorical variables
ANOVA test: analysis of variants
Stata app and T test
Use the second table in the slides and Check whether there is an association between the variables gender (gender) and hypertension status (hyp)
Find the percentage of males who are hypertensive
Is there any association between gender and hypertension status?
Interpret your results
Pearson chi2(1) = 22.2109
Pr = 0.000
The notation you’ve provided, “Pearson chi2(1) = 22.2109” and “Pr = 0.000,” typically refers to the result of a chi-squared test for independence or goodness of fit. Here’s what these results generally indicate:
- Pearson chi2(1) = 22.2109: This represents the value of the Pearson chi-squared statistic with 1 degree of freedom. It suggests that there is a significant difference or association between the observed and expected frequencies in the data.
- Pr = 0.000: This indicates the p-value associated with the chi-squared statistic. A p-value of 0.000 (or very close to it) means that the observed result is statistically significant at conventional levels (usually p < 0.05 or p < 0.01). In other words, there is strong evidence to reject the null hypothesis in favor of the alternative hypothesis, suggesting a relationship or difference exists.
In summary, based on these results, there is strong statistical evidence to conclude that there is a significant relationship or difference between the variables being tested, as indicated by the chi-squared test.