Comparing data Flashcards
Parametric test for comparing paired, continuous data?
Paired t-test
What are the assumptions for the paired t-test
Differences are plausibly normally distributed
Differences are independent of each other
Steps to calculate a p-value from a paired t-test
- Calculate the differences between the values in each group (d)
- Calculate the mean + standard deviation of the means
- Calculate the standard error of the mean difference
- Calculate the test statistic (t)
- Under the null hypothesis, t is distributed as Student’s t, with n-1 degrees of freedom
- Look up this value in tables to find p-value (gives two-tailed p value)
How is the test statistic (t) calculated for paired t-test?
dbar(-0)/SE(dbar)
dbar = mean of the differences
How is the 100% (1-α)% confidence interval for the mean difference in the population calculated?
d(bar)-[txSE(dbar)] to dbar+[txSE(dbar)]
dbar = mean difference
t taken from t distribution table with n-1 degrees of freedom
What is the non-parametric equivalent of the paired t-test? (for assessing paired data)
Wilcoxon (matched pairs) signed rank test
What does the Wilcoxon signed rank test test?
Test of null hypothesis that there is no tendency for the outcome under one set of conditions to be higher or lower than under the comparison set of outcomes
What is the parametric test for independent, continuous data?
Independent samples t-test
What are the assumptions for the independent two sample t-test
Two independent groups
Continuous outcome
Outcome data in both groups is normally distributed
Outcome data in both groups have similar standard deviations
Steps to calculate a p value from the independent two sample t-test
- Calculate the difference between means of groups
- Calculate the pooled standard deviation of the means
- Calculate the standard error of the difference between two means
- Calculate the test statistic (t)
- Compare the test statistic with the t distribution with n1+n2-2 degrees of freedom
- Look up this value in tables to find p-value (gives two-tailed p value)
How is pooled SD for two independent groups calculated?
√[(n1-1)SD1^2+(n2-1)SD2^2]/n1+n2-2
How is standard error of difference between two means calculated for two independent groups?
pooled SDx√(1/n1)+(1/n2)
How is the test statistic (t) calculated for independent samples t test?
d/SE
d = observed difference in means
SE = standard error of difference in means
How is the 100% (1-α)% confidence interval for the difference between means in the population calculated?
(xbar1-xbar2) +/- [txSE(difference)]
What is the non-parametric equivalent of the independent samples t-test?
Mann-Whitney U test
What does the Mann-Whitney U test show?
Test of the null hypothesis that the distribution of the outcome variable in the two groups is the same
Steps for Mann-Whitney U test
- Arrange all data in increasing order
- Choose one group: for each observation in that group, count how many observations in the other group lie below it
- All numbers added up = U-statistic
- Compare U test statistic with theoretical distribution under null hypothesis (that samples come from the same population)
What two tests can be used when assessing more than two independent groups?
Analysis of variance technique (ANOVA) = parametric
Kruskal-Wallis test = non-parametric
How can we compare binary outcome data?
Comparison of two proportions
What are the requirements for a comparison of two proportions?
Only makes sense in 2x2 tables e.g. yes or no outcome
Two independent samples or groups
Large sample with all expected frequences >5
- np and n(1-p) should both exceed 5
- n = total number of individuals in both samples
- p = proportion of individuals with condition
Assumes a common proportion
How is the common proportion calculated in a comparison of two proportions?
p=(n1p1 + n2p2)/(n1+n2)
n = sample size
p = proportion with condition
How is the standard error for the difference in proportions calculated, where a common proportion is assumed?
SE(p1-p2) = √p(1-p)(1/n1+1/n2)
Where p is the common proportion calculated
How is the test statistic (z) calculated in the comparison of two proportions
z=(p1-p2)(-0)/SE(p1-p2)
How is the 95% confidence interval for the difference in proportions calculated?
(p1-p2)+/- [1.96xSE(p1-p2)]
How is standard error of the difference in proportions calculated if no common proportion is assumed?
SE(p1-p2) = √(p1(1-p1))/n1 + (p2(1-p2))/n2
What test is used when comparing unordered, categorical data?
Chi-squared test (χ^2)
What are the requirements for chi-squared test?
Two independent groups Unordered, categorical variables At least 80% expected cell counts ≥5 All expected cell counts ≥1 Expected values calculated by total proportion healed used to predict proportion healed for each variable
Steps for chi-squared test
- Expected frequency = row totalxcolumn total/N where N is total sample size
- Calculate difference between observed and expected value for each cell
- Square each difference
- Divide resultant quantity by expected value
- Sum all of these to get a single number test statistic
- Compare with table of chi-squared distribution
How is the degrees of freedom calculated in the chi-squared test?
(no. rows -1)x(no. columns -1)
What correction can be used on 2x2 tables to allow chi-squared calculations
Yates correction
Chi-squared = SUM ((|O-E|-0.5)^2)/E
What test is done on 2x2 table when expected cell counts <5, or any cell count <1
Fisher’s exact test
Estimates probability of falsely rejecting the null hypothesis exactly
When is the chi-squared test for trend used?
In a 2x3+ table
When the variable with 3+ categories is ordered
How can risk be compared in a 2x2 table?
Relative risk
(a/a+c)/(b/b+d)
Under the null hypothesis, the expected value is 1
Odds ratio
ad/bc
Expected value is 1 under null hypothesis
How is the standard error of the natural logarithm of RR calculated?
SE(logeRR) = √(1/a)-(1/a+c)+(1/b)-(1/b+d)
How is the 95% CI for logeRR calculated?
logeRR +/- 1.96xSE(logeRR)
This can then be converted using the function of e
How is the standard error of the natural logarithm of OR calculated?
√(1/a)+(1/b)+(1/c)+(1/d)
How is the 95% CI for logeOR calculated?
logeOR +/- 1.96xSE(logeOR)
Converted using e function
How is categorial data with paired outcomes compared?
McNemar’s test
e.g. patients treated with two different treatments + outcomes compared
How is McNemar’s test calculated?
(|b-c|-1)^2/b+c