9 | Statistics for Numerical Data II Flashcards
(POLL)
If we compare the luckyness values of our biostudents with the average luckyness of the people in Germany we should use …
* an one sample t-test
* an one sample wilcox test
* a wilcox test
* a t-test
* an ANOVA
an one sample wilcox test - assuming that we know the average luckyness of Germans (assume the data more a rank than numerical value)
an one sample t-test (as we have enough data, more than several hundred measurements)
(POLL)
To compare the luckyness of male and female students we should use …
* an one sample t-test
* an one sample wilcox test
* a wilcox test
* a t-test
* an ANOVA
a wilcox test
as data are not normal, partially as well d - as we have many samples and can ignore non-normality, but we should not first try c and then d if c is not significant, we should decide at the beginning
a t-test
not this:
an one sample t-test (don’t have population value!)
(POLL)
To compare the blood pressure of 50-60 year old persons in the three classes smoker, recent smoker, non-smoker we use a
* an one sample t-test
* an one sample wilcox test
* a wilcox test
* a t-test
* an ANOVA
- an ANOVA
due to the three classes if we assume normality of the numerical variable blood pressure
(POLL)
If we compare two means we can use as effect size measure …
* Cohen’s d
* Cohen’s h
* Cohen’s w
* Odds ratio
* Pearson’s r
Usually Cohen’s d
but Pearson’s R can be as well used, usually you use the absolute r value as the order, for example male/female vs female/male is arbitary
measures for contingency tables
(POLL)
The post-hoc test for an ANOVA is a …
* a pairwise.cor.test
* a pairwise.prop.test
* a pairwise.t.test
* a pairwise.wilcox test
- a pairwise.t.test
as ANOVA and t.test are used for normal data
(POLL)
The post-hoc test for a Kruskal Test is a …
* a pairwise.cor.test
* a pairwise.prop.test
* a pairwise.t.test
* a pairwise.wilcox test
- a pairwise.wilcox test
as Kruskal and Wilcox tests are used for non-normal data
(POLL)
Our data, data range 0-2000 are not-normally distributed (right tail), to normalize the data we can use .the following transformation ..
* log(x)
* log(x+1)
* sqrt(x)
* sqrt(x+1)
* asinh(x)
- log(x+1) (the standard),
- sqrt(x) (weaker),
- sqrt(x+1) (usually only used for values ranging from positive to negative)
(POLL)
We compared gene expressions differences between wild-type and mutants and got 1000 p-values, what is an appropiate method to correct the p-values?
* Benjamini-Hochberg
* Bonferroni
* Fisher
* Holm
* T-Test
- Benjamini-Hochberg
- Holm
(Bonferromi is too string)
(Fisher and T-Test do not exist)
(POLL)
We have a p-value of 0.03 and reject H0. However in a reality H0 is true. So we do a …
a) Type I error
b) Type II error
c) Type III error
d) No error
e) Unsure
Type I error
memorize:
Type I errors can happen for low p-values, type II errors for p-values above 0.05
(QUIZ 3)
To make the data distributions more normal, data transformations can be performed. If the data have a positive skewness, we can usually apply ______transformation, if zero values are present in the data we usually add a ______to every value. For data ranging from positive to negative values we can apply ______transformation.
A transformation which subtracts for every value the mean of the variable and divides by the standard deviation is the ______. This results in all variables having the same ______.
To make the data distributions more normal, data transformations can be performed. If the data have a positive skewness, we can usually apply log transformation, if zero values are present in the data we usually add a value of 1 to every value. For data ranging from positive to negative values we can apply asinh transformation.
A transformation which subtracts for every value the mean of the variable and divides by the standard deviation is the z score. This results in all variables having the same scale.
…
(Please have a look at lecture 8. Chapter 2.3 There is as well this interesting read: https://medium.com/@TheDataGyan/day-8-data-transformation-skewness-normalization-and-much-more-4c144d370e55)
(QUIZ 3)
If I perform many tests within one statistical analysis I should perform ______. As a method I should prefer ______ more than the too strict ______. In either way I risk loosing many ______. Using a ______ I can get a general overview about my p-values. If I afraid of missing true positives I should use as well the ______.
If I perform many tests within one statistical analysis I should perform multiple testing correction. As a method I should prefer Benjamini Hochberg method more than the too strict Bonferroni method. In either way I risk loosing many true positive findings. Using a histogram I can get a general overview about my p-values. If I afraid of missing true positives I should use as well the raw uncorrected p values.
(QUIZ 3)
To test for differences between two groups regarding their means we use a ______. A low different p-value indicates that we must reject the ______, which assumes that the groups are not different to each other. A unitless measure to describe the ______ is cohen’s d, which indicates how large the difference between both ______ is with regards to the ______.
To test for differences between two groups regarding their means we use a t-test. A low different p-value indicates that we must reject the null hypothesis, which assumes that the groups are not different to each other. A unitless measure to describe the effect size is cohen’s d, which indicates how large the difference between both means is with regards to the standard deviation.
(QUIZ 3)
To compare more than two groups of normally distributed data we can use an ______. If we have a significant ______, we can perform a ______test to find which groups are significantly different from one another. A possible test for this is the ______.
If the numerical data are not normally distributed we should instead use a ______ and as post-hoc test a ______.
To compare more than two groups of normally distributed data we can use an ANOVA. If we have a significant F value, we can perform a post hoc test to find which groups are significantly different from one another. A possible test for this is the pairwise.t.test.
If the numerical data are not normally distributed we should instead use a kruskal.test and as post-hoc test a pairwise.wilcox.test.
…
(Please remember the rules for parametric and non-parametric tests:
* parametric: t.test / ANOVA / pairwise.t.test (normal data)
* non-paramatric: wilcox.test/ kruskal.test / pairwise.wilcox.test (non-normal data))
(QUIZ 4)
______is greatly depending on ______. Using ______ transformation I can ______ their effect. Values of ______ are not affected by outliers nor by log transformation of the data because that value is depending on ______. In case where I have ordinal variables with very few levels I should consider using ______. To get the effect size for Spearman and Pearson correlation we should ______the correlation coefficient, whereas for Kendall-Tau we should ______the correlation coefficient.
Pearson correlation is greatly depending on outliers. Using log transformation I can minimize their effect. Values of Spearman correlation are not affected by outliers nor by log transformation of the data because that value is depending on ranks. In case where I have ordinal variables with very few levels I should consider using Kendell Tau correlation. To get the effect size for Spearman and Pearson correlation we should square the correlation coefficient, whereas for Kendall-Tau we should take the absolute value of the correlation coefficient.
(QUIZ 4)
Pearson correlation is restricted to measure ______associations whereas Mutual information can measure as well ______associations. One limitation of ______ is that its values are dependent on the binning of the data, whereas the value range of ______is well defined. We ______distinguish between positive and negative associations in Mutual information. We ______distinguish between positive and negative associations in Pearson correlation.
Pearson correlation is restricted to measure linear associations whereas Mutual information can measure as well non linear associations. One limitation of ______ is that its values are dependent on the binning of the data, whereas the value range of Pearson correlation is well defined. We can’t distinguish between positive and negative associations in Mutual information. We can distinguish between positive and negative associations in Pearson correlation.
Which test for this data?
Numeric normal ~ NA
- mean
- Sd
- t.test
Which test?
Numeric normal ~ numeric
* pearson correlation
* regression
* lm
Which test?
Numeric normal ~ categoric
* t.test
* aov
Which test?
Numeric non-normal ~ NA
* median
* mad
Which test?
Numeric non-normal ~ numeric
* spearman correlation
Which test?
Numeric non-normal ~ categoric
- wilcox test
- kruskal test
Which test?
Categorical ordinal ~ NA
- wilcox.test
Inferential Outline n ~ c: Questions to consider to chose the test?
– N: normal or non-normal data
– C: number of groups in C
– paired or unpaired data (2 groups)
– matches or unmatched data (3 or more groups)
– one sided tests vs two sided test
Inferential Outline n ~ c: results of test?
– confidence interval
– p-value for significance
– effect size
One sample Tests
Compare a sample against a known population value (mean,
proportion): proportions?
→ prop.test
One Sample Proportion-test
One sample Tests
Compare a sample against a known population value (mean,
proportion): normal numeric data?
→ t.test
One Sample t-test
One sample Tests
Compare a sample against a known population value (mean,
proportion): non-normal numeric data?
→ wilcox.test
One SampleWilcoxon signed rank test
Calculation of CI with t*
CI depends on?
- sample mean (m)
- sample size (N)
- sample SD (s)
- variable t* depending again on sample size
- level of confidence 90, 95, 99%
numerical data, two groups: two sample tests
normal? R?
- normal data → t.test (with CI)
~~~
> t.test(survey$cm~survey$gender)
Welch Two Sample t‐test
data: survey$cm by survey$gender
t = ‐21, df = 438, p‐value <2e‐16
alternative hypothesis: true difference in means between group F and group M is not equal to 0
95 percent confidence interval:
‐14.29 ‐11.85
sample estimates:
mean in group F mean in group M
167.3 180.4
~~~
numerical data, two groups: two sample tests
Non normal? R?
non-normal data → wilcox.test (no CI)
~~~
> wilcox.test(survey$cm~survey$gender)
Wilcoxon rank sum test with continuity correction
data: survey$cm by survey$gender
W = 8686, p‐value <2e‐16
alternative hypothesis: true location shift is not equal to 0
~~~
R:
Two sample tests - 2 x numerical vectors.
Tilde or Comma?
→ comma
~~~
> t.test(survey$cm[survey$gender==’M’] ,
+ survey$cm[survey$gender==’F’])$conf.int
[1] 11.85 14.29
attr(,”conf.level”)
[1] 0.95
~~~
R:
Two sample tests - 1 x numerical, 1 x factor vector
Tilde or Comma?
→ tilde
~~~
> t.test(survey$cm ~ survey$gender)$conf.int
[1] ‐14.29 ‐11.85
attr(,”conf.level”)
[1] 0.95
~~~
Why are effect sizes important?
- Compare different experiments eg with different unit systems or unitless
- Statistics measure effect size of sample → used to estimate effect size of population (parameter)
Effect Sizes for comparison of two means?
r: Pearsons’s correlation coefficient r
d: standardized mean difference Cohen’s d
Cohen’s D: meaning of 0.5, 0.75?
- d = 0.5 → difference between the groups is half of a standard deviation
- d = 0.75 → difference between the groups is three quarter of a standard deviation
Write a report for the following analysis:
An ______-test indicated that ______ was significantly larger for ______ (______) than ______ (______).
______, ______, ______.
> source('~/R/source/sbi.R') > report.pval=sbi$report.pval > aggregate(survey$cm,by=list(survey$gender),mean, \+ na.rm=TRUE) Group.1 x 1 F 167.3 2 M 180.4 > aggregate(survey$cm,by=list(survey$gender),sd, \+ na.rm=TRUE) Group.1 x 1 F 6.705 2 M 7.868 > table(survey$gender) F M 375 235 > aggregate(survey$cm,by=list(survey$gender),mtest) Group.1 x 1 F 0.003898 2 M 0.364979 > t.test(survey$cm~survey$gender) Welch Two Sample t‐test data: survey$cm by survey$gender t = ‐21, df = 438, p‐value <2e‐16 alternative hypothesis: true difference in means between group F and group M is not equal to 0 95 percent confidence interval: ‐14.29 ‐11.85 sample estimates: mean in group F mean in group M 167.3 180.4 > sbi$cohensD(survey$cm,survey$gender) [1] 1.82 > plot(survey$cm~survey$gender,col=c('salmon', \+ 'light blue'))
Report:
An _independent-samples t-_test indicated that body height was significantly larger for _men _(M = 180.4, SD = 7.87) than women (M = 167.33, SD = 6.7).
t(600) = 21.77, p < 0.001, d = 1.82.