Data Distributions and Introduction to Inferential Statistics Flashcards
What is a frequency distribution?
A theoretical continuous curve that best fits a data histogram
- numerical discrete variables have frequency histograms, while numerical continuous variables have density curves
Why are frequency distributions important?
- help us model our data & determine which descriptive statistics would be most useful
- parametric tests
What is a parametric test?
A statistical method that assumes that the data come from a specific theoretical distribution (e.g. a normal distribution) and makes inferences based on that assumption.
- parametric tests examples include t-tests and ANOVA
When should parametric tests be used?
If the dependent variable has a normal frequency distribution
What is the difference between a frequency histogram and a density curve?
Frequency histogram:
- used for numerical discrete variables
- displays frequency or count of observations for each discrete value or range of values
Density curve:
- used for numerical continuous variables
- displays the probability density function, which represents the probability of observing a value within a range of values
What are some common frequency distributions?
- Binomial distribution
- Poisson distribution
- Normal distribution
What is a binomial distribution?
Describes the number of successes in a fixed number of independent trials, where each trial has only two possible outcomes (e.g., success or failure, heads or tails, yes or no)
What are the characteristics of a binomial distribution?
- a fixed number of trials
- only two possible outcomes per trial
- independence of the trials
- a constant probability of success on each trial
- a discrete number of successes
What is a Poisson distribution?
It gives the probability of an event happening a certain number of times (k) within a given interval of time or space.
What are the characteristics of a Poisson distribution?
- a fixed interval of time or space
- rare events occurring with a constant average rate
- independence of the events
- a discrete number of occurrences
What is a normal distribution?
A symmetrical probability distribution that is characterised by its mean and standard deviation
- often referred to as a bell curve because of its shape
What are the properties of a normal distribution?
- symmetrical
- mean, median and mode are equal
- it is described by its mean & standard deviation
- majority of data falls within 1 standard deviation of the mean
- almost all the data falls within 3 standard deviations of the mean
What is the standard deviation?
A measure of how dispersed the data is in relation to the mean
What is the null hypothesis (H0) in statistical hypothesis testing?
The null hypothesis (H0) is the hypothesis that there is no difference or no association between our variables.
What is the alternative hypothesis (H1) in statistical hypothesis testing?
The alternative hypothesis (H1) is the hypothesis that there is a statistical significant difference or association between our variables.
What is the goal of statistical hypothesis testing?
To determine if we can reject the null hypothesis and accept the alternative hypothesis
What is the significance level in statistical hypothesis testing?
The threshold for rejecting the null hypothesis.
- represents the probability of making a type I error (rejecting the null hypothesis when it is actually true)
- commonly used significance level is 0.05
What level of confidence do we like to have before rejecting the null hypothesis?
By convention, we like to be at least 95% confident that the null hypothesis is wrong before we reject it
What do most hypotheses that we test use?
Use data that is characterised by variation and uncertainty
What are the two types of errors we risk when evaluating whether we can reject the null hypothesis or not?
Type I and Type II errors
What is a Type I Error?
A Type I Error is when we reject a null hypothesis even though it is actually true.
What is a Type II Error?
A Type II Error is when we accept a null hypothesis even though it is actually false.
Why do we set very stringent confidence levels in rejecting the null hypothesis?
Because a Type I Error is more serious than a Type II Error
Summarise the table of errors
(slide 13)
H0 True H0 False
Reject H0 Type I Error Correct Rejection
Fail to reject H0 Correct Decision Type II Error
Why is the significance level in hypothesis testing important?
It is important because it helps us control the probability of making a Type I error, which is rejecting the null hypothesis when it is actually true.
What happens if the p-value is greater than 0.05 in a hypothesis test?
p > 0.05, the test is considered non-significant and we cannot reject the null hypothesis
What happens if the p-value is less than 0.05 in a hypothesis test?
p < 0.05, the test is considered significant, and we can reject the null hypothesis and report the trends in the data
What is α in hypothesis testing, and what is its significance level?
α is the chosen type 1 error rate or significance level
What is the critical value in hypothesis testing, and how does it relate to the p-value?
For a test to be significant, the calculated test statistic must be higher than the critical value. However, in practice, we use the p-values that tests output to determine significance.
How can we test for normality?
- graphically using histograms and QQ plots
- statistically using tests such as Shapiro-Wilks
What are some ways to check for normality in data?
- checking the histogram to see if it looks normal (bell-shaped)
- checking descriptive statistics (mean, median & mode)
- checking if approximately 70% of data falls within +/- one standard deviation of the mean
- conducting a QQ plot or Shapiro-Wilk test for normality if the sample size is greater than 30
How can we describe deviations from normality?
Using two measures
- kurtosis
- skewness
What is kurtosis?
Peakedness or flatness
- positive kurtosis = a more peaked distribution
- negative kurtosis = a flatter distribution
What is skewness?
Measure of asymmetry of a probability distribution.
- positive skewness = a distribution with a longer tail on the right side
- negative skewness = a distribution with a longer tail on the left side
What is a QQ (quantile-quantile) plot?
A QQ plot is a graphical tool used to display the pattern of dispersion of the dataset against the theoretical distribution, typically normal distribution.
What is the Shapiro-Wilks test?
Used to determine whether a set of data comes from a normal distribution or not
What is the null hypothesis and alternative hypothesis in the Shapiro-Wilks test?
- null hypothesis = observed data comes from a normal distribution
- alternative hypothesis = observed data does not come from a normal distribution
Can the Shapiro-Wilks test be performed on multiple dependent variables at once?
No, the Shapiro-Wilks test needs to be performed on one numeric dependent variable at a time
- if there are different levels of a categorical variable, then the test needs to be performed for each level of the categorical variable separately
What is the output of the Shapiro-Wilk test in R?
Includes the
- test statistic (W)
- p-value
- a statement indicating whether the data is normally distributed: p-value > 0.05 (accept null hypothesis), p-value < 0.05 (reject null hypothesis).
Example:
Shapiro-Wilk normality test data:
mydata
W = 0.935, p-value = 0.002345
What should be done if the Shapiro-Wilk test indicates that the data is not normally distributed?
Try transforming the data to achieve normality. If this is not possible, non-parametric tests can be used instead of parametric tests that require normality.
What is the purpose of t-tests?
T-tests are used when the data is normally distributed and we want to test whether two means are significantly different
- e.g. control vs treatment
What is the null hypothesis in t-tests?
The two samples are drawn from the same statistical population and will have the same mean.
- no significant difference between means
What is the alternative hypothesis in t-tests?
The two samples are drawn from different statistical populations and have different means.
In excel, which t-Test should be used?
T-test: Paired Two Sample for Means
T-test: Unpaired Two Sample for Means
What is the T-test: Paired Two Sample for Means used for?
Used for repeat measures on the same individuals
- e.g. before and after a treatment
What is the T-test: Unpaired Two Sample for Means used for?
Comparing the means of two independent groups.
- e.g. before and after a treatment
What values are important from the output table in excel of a T-test: Paired Two Sample for Means?
- mean
- df
- t stat
- P(T<=t) two-tail
How is the result of a ‘T-test: Paired Two Sample for Means’ stated in a report?
“There was a significant difference (t = __, df = __, p = __); … ”
What test is performed before the t-tests?
An F-Test to test for equality of variances
What values are important in the output table of the F-test result?
- df
- F
- P(F<=f) one-tail
When are the variances significantly different in an F-test?
calculated F-value > the critical F-value (for p=0.05), then the variances are significantly different.
null = variances of two populations are equal
alternative = variances of two populations are not equal
What is stated in regards to the F-test result?
“There was no significant difference between variances (F = __, p=___), therefore a t-test with equal variances was performed.”
What is the Mann-Whitney U test?
The Mann-Whitney U test is a non-parametric statistical test that is equivalent to a t-test.
How is the Mann-Whitney U test calculated?
Raw data is first converted to ranks before calculating the test statistic.
What is the Wilcox.test in R?
The Wilcox.test (also known as Mann-Whitney U test)
How is the Wilcox.test function used in R?
- takes two sample vectors as input
- returns the test statistic, p-value, and alternative hypothesis
What is the process for choosing a test to determine if the means for two groups are different?
1: Identify whether you want to check if the means for a numerical variable are different between two groups of a categorical variable.
2: If the categorical variable is paired, proceed to Step 3a. Otherwise, proceed to Step 3b.
3a: Check if the numerical variable is normally distributed within both groups of the categorical variable. If it is, perform a paired t-test. Otherwise, perform a Wilcoxon Signed-rank test.
3b: Check if the numerical variable is normally distributed within both groups of the categorical variable. If it is, proceed to Step 4. Otherwise, perform a Mann-Whitney U test.
4: Do an F-test. If variances are equal, perform an unpaired t-test assuming equal variances. Otherwise, perform an unpaired t-test assuming unequal variances. Finally, make conclusions and STOP.
What should be included in the “Methods” section in a scientific report?
- the tests used for what purposes
- the software used to implement those tests
- any citation required for the software used (e.g., R and RStudio, not excel)
What should be included in the “Results” section in a scientific report?
- describe the outcome of each test result
- report test-statistics (e.g. t or F or Wilk’s lambda, a measure of effect size)
- df (an indicator of sample size)
- p-value and your decision (can you reject the null hypothesis or not)
- a statement of the biological meaning of your result