From 4c21a90a6192c78dcd6d99dab15365f288a97de1 Mon Sep 17 00:00:00 2001 From: philmcaleer Date: Mon, 24 Jan 2022 22:39:47 +0000 Subject: [PATCH] welch basis added --- book/03-ttest-c2.Rmd | 55 +++ book/template.rds | Bin 624 -> 643 bytes docs/03-ttest-c2.md | 43 +++ docs/05-regression-b.md | 8 +- docs/404.html | 15 +- docs/a-full-descriptive.html | 15 +- docs/anova.html | 49 +-- docs/appendix-c-conventions.md | 2 +- docs/between-subjects-students-t-test.html | 17 +- docs/between-subjects-welchs-t-test.html | 415 +++++++++++++++++++++ docs/chi-square-cross-tabulation.html | 15 +- docs/conventions.html | 29 +- docs/foreword.html | 15 +- docs/index.html | 15 +- docs/installing-r.html | 27 +- docs/interval-estimates.html | 15 +- docs/license.html | 15 +- docs/one-sample-chi-square.html | 15 +- docs/one-sample-t-test.html | 15 +- docs/pearson-correlation.html | 43 +-- docs/point-estimates.html | 15 +- docs/random-formulas.html | 43 +-- docs/reference-keys.txt | 6 +- docs/references.html | 15 +- docs/search.json | 2 +- docs/simple-linear-regression.html | 83 +++-- docs/spearman-correlation.html | 37 +- docs/symbols.html | 17 +- docs/the-rounding-chapter.html | 41 +- docs/within-subjects-t-test.html | 67 ++-- 30 files changed, 843 insertions(+), 306 deletions(-) create mode 100644 book/03-ttest-c2.Rmd create mode 100644 docs/03-ttest-c2.md create mode 100644 docs/between-subjects-welchs-t-test.html diff --git a/book/03-ttest-c2.Rmd b/book/03-ttest-c2.Rmd new file mode 100644 index 0000000..c727c08 --- /dev/null +++ b/book/03-ttest-c2.Rmd @@ -0,0 +1,55 @@ +# Between-Subjects Welch's t-test + +**between-subjects Welch's t-test:** Compare two groups or conditions where the participants are different in each group and have not been matched or are only matched on broad demographics, e.g. only age. + +## The Worked Example + +```{r we, echo = FALSE} +set.seed(1410) + +mx <- runif(1, 0, 100) %>% round2(2) +sdx <- runif(1, 0, 5) %>% round2(2) +N <- seq(10, 100, 2) %>% sample(1) + +dat <- tibble(Group = rep(c("A","B"), each = N/2), + scores = rnorm(N, mx, sdx)) %>% + mutate(scores = scores + rep(c(0,2), each = N/2)) + +desc <- dat %>% + group_by(Group) %>% + summarise(Npg = n(), + Means = mean(scores) %>% round2(2), + SDs = sd(scores) %>% round2(2), + Variance = var(scores) %>% round2(2), + `Standard Err.` = (SDs/sqrt(Npg)) %>% round2(2)) + +sdp <- sqrt((((N/2 - 1) * desc$SDs[1]^2) + ((N/2 - 1) * desc$SDs[2]^2))/(N/2 + N/2 - 2)) + +t.value <- ((desc$Means[1] - desc$Means[2])/(sdp * sqrt(((1/(N/2)) + (1/(N/2)))))) %>% round2(2) + +cohensd <- ((2* t.value)/sqrt(N-2)) %>% round2(2) + +results <- t.test(dat %>% filter(Group == "A") %>% pull(scores), + dat %>% filter(Group == "B") %>% pull(scores), + var.equal = TRUE) %>% + tidy() %>% + mutate(cohensd_t = (2*statistic)/sqrt(parameter)) +``` + +Here is your data: + +```{r, echo = FALSE} +desc %>% + select(-Variance, -`Standard Err.`) %>% + rename(N = Npg, Mean = Means, SD = SDs) %>% + knitr::kable(align = "c") +``` + +Let's look at the main t-test formula for Welch's t-test: + +$$t = \frac{\bar{X}_1 - \bar{X}_2}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}$$ + +**Degrees of Freedom** + +$$df = \frac{\left(\frac{s^2_{x_1}}{n_1}+\frac{s^2_{x_2}}{n_2}\right)^2}{\frac{\left(\frac{s^2_{x_1}}{n_1}\right)^2}{n_1 - 1}+\frac{\left(\frac{s^2_{x_2}}{n_2}\right)^2}{n_2 - 1}}$$ + diff --git a/book/template.rds b/book/template.rds index a246d1ed355a79330ab33995d91df6a1b8043ff8..e993747af9beb1250e9c262d54ea0ae76227a9ef 100644 GIT binary patch delta 632 zcmV-;0*C$Z1cL>T7JuzRy9^kheFCGbu<<^K+s zxP3|ElfQpH=h(;g&ld=x5gHE$XtbmMqGw;foz2c?2o0zD?NmPx^>cv6XjeaR%_*1q#qROtrpNil?0;zXxG0#+8ReuXjT>G0 z`{#`6Adc~Z2_{K~Nj12^x;~cS+CfijnLUEh+7p(9!4hxSQGA9eQ>o;ug5NO(aqo3Q z8;%7y+Q4q%ZMp?E4ad?gu+$qniDx+d#j(2mLnMP_Hgc4qNI+H{q<>BwBp{;>(m$Vj z@h4p9icvsfdVgp{0U$sm4ah%;1_X$o0r`h+-)Lt3q*sHIIhJf8nNq;$MvgKR2`XcCC1AE*;LEG) zAD6J2Qi%dUpqf&N073kM38lPDH|*RLIm%EZC~tLTD1Q>P{nVBI86>L}6O`ZM7?43D z@&=t$8iKh{1<5il7FhaIKXmlqJ%p(0Ai?S(PnMbTr@v{6y}@rQZK~^*xMQNs69E3c zy@LSHA8^J~CKL0JA&lZ1?=?cM)!CX{I2m&MaaH| zwYMi$dvVmf+w>TFm1&=mTE?k+=I%5l-6os1Z=E&UT9ejRyN3h&$kq0-J^rJ{S*F{T z^w`pxcg_ahX{tM8HpI5pdia7vG SOS3fT<@6sxi|)l`5dZ)~-aRt_ delta 613 zcmV-r0-F7U1@Hur7Jm(!BZSZdO-Ca%InaO6gO6V>7MBZz#&g{|*Uw}99HA*X)X#@pP;5cw}$^Ma`*x!P6t9?Ik`$OU&W*ONFXOF;p4l?ngUL1!mc_xcVAx4|fhkkD9m0z}e)!h>i)fcP0uOy~e>z<|O({(1Ti=W8ihK`Oo$kW8KW(r73k zYd$nQcRm!5K_42P$60!bC0j|R6fnApr;J5{YKyA`e68>C)u+$ju3!tj5k-JN3%wBm zg7^UwN_m}b*kLB|l(9%q-dtrY60|3{%J2-5&4vleZ+~$L$e$)Xwn5gpvfWPVD-PE1Sy+a(fR!~>;L`itH$3KA^U37-JesED zLq=*D=U)CnxYv~Rn{3(>>j2o*n|1bfk6=4`(mJ&C+p+;$?o7kmse4VX*JkJI>U9I< z?J2#c0hJRRtCpJHmwkoLymH!6n2hzTr+Reh&GNQ9_Sax-((C3Q&UiJA;}8G<&!#%) diff --git a/docs/03-ttest-c2.md b/docs/03-ttest-c2.md new file mode 100644 index 0000000..8808879 --- /dev/null +++ b/docs/03-ttest-c2.md @@ -0,0 +1,43 @@ +# Between-Subjects Welch's t-test + +**between-subjects Welch's t-test:** Compare two groups or conditions where the participants are different in each group and have not been matched or are only matched on broad demographics, e.g. only age. + +## The Worked Example + + + +Here is your data: + + + + + + + + + + + + + + + + + + + + + + + + +
Group N Mean SD
A 18 25.58 2.25
B 18 29.07 2.53
+ +Let's look at the main t-test formula for Welch's t-test: + +$$t = \frac{\bar{X}_1 - \bar{X}_2}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}$$ + +**Degrees of Freedom** + +$$df = \frac{\left(\frac{s^2_{x_1}}{n_1}+\frac{s^2_{x_2}}{n_2}\right)^2}{\frac{\left(\frac{s^2_{x_1}}{n_1}\right)^2}{n_1 - 1}+\frac{\left(\frac{s^2_{x_2}}{n_2}\right)^2}{n_2 - 1}}$$ + diff --git a/docs/05-regression-b.md b/docs/05-regression-b.md index 9aeaa18..9fb2003 100644 --- a/docs/05-regression-b.md +++ b/docs/05-regression-b.md @@ -252,7 +252,7 @@ Here we are going to try out a few examples based on the above. First we will us -* To two decimal places, what would be the predicted value of IQ if the HeadSize was 37.8?
+* To two decimal places, what would be the predicted value of IQ if the HeadSize was 37.8?
@@ -282,7 +282,7 @@ Giving a predicted value of $\hat{Y}$ = 93.88, to two decimal places. -* To two decimal places, what would be the predicted value of IQ if the HeadSize was 24.2?
+* To two decimal places, what would be the predicted value of IQ if the HeadSize was 24.2?
@@ -311,7 +311,7 @@ Giving a predicted value of $\hat{Y}$ = 77.64, to two decimal places. -* To two decimal places, what would be the predicted value of IQ if the HeadSize was 52.9?
+* To two decimal places, what would be the predicted value of IQ if the HeadSize was 52.9?
@@ -339,7 +339,7 @@ Giving a predicted value of $\hat{Y}$ = 111.91, to two decimal places. -* To two decimal places, what would be the predicted value of IQ if the HeadSize was 48.4?
+* To two decimal places, what would be the predicted value of IQ if the HeadSize was 48.4?
diff --git a/docs/404.html b/docs/404.html index f73f18a..809c100 100644 --- a/docs/404.html +++ b/docs/404.html @@ -63,17 +63,18 @@

  • t-tests
  • 6 One-Sample t-test
  • 7 Between-Subjects Student's t-test
  • -
  • 8 Within-Subjects t-test
  • +
  • 8 Between-Subjects Welch's t-test
  • +
  • 9 Within-Subjects t-test
  • Correlations
  • -
  • 9 Pearson Correlation
  • -
  • 10 Spearman Correlation
  • +
  • 10 Pearson Correlation
  • +
  • 11 Spearman Correlation
  • Linear Regression
  • -
  • 11 Simple Linear Regression
  • +
  • 12 Simple Linear Regression
  • ANOVAs
  • -
  • 12 ANOVA
  • +
  • 13 ANOVA
  • Additional
  • -
  • 13 Random formulas
  • -
  • 14 The Rounding Chapter
  • +
  • 14 Random formulas
  • +
  • 15 The Rounding Chapter
  • Appendices
  • A Installing R
  • B Symbols
  • diff --git a/docs/a-full-descriptive.html b/docs/a-full-descriptive.html index eb760d5..84ea664 100644 --- a/docs/a-full-descriptive.html +++ b/docs/a-full-descriptive.html @@ -63,17 +63,18 @@

  • t-tests
  • 6 One-Sample t-test
  • 7 Between-Subjects Student's t-test
  • -
  • 8 Within-Subjects t-test
  • +
  • 8 Between-Subjects Welch's t-test
  • +
  • 9 Within-Subjects t-test
  • Correlations
  • -
  • 9 Pearson Correlation
  • -
  • 10 Spearman Correlation
  • +
  • 10 Pearson Correlation
  • +
  • 11 Spearman Correlation
  • Linear Regression
  • -
  • 11 Simple Linear Regression
  • +
  • 12 Simple Linear Regression
  • ANOVAs
  • -
  • 12 ANOVA
  • +
  • 13 ANOVA
  • Additional
  • -
  • 13 Random formulas
  • -
  • 14 The Rounding Chapter
  • +
  • 14 Random formulas
  • +
  • 15 The Rounding Chapter
  • Appendices
  • A Installing R
  • B Symbols
  • diff --git a/docs/anova.html b/docs/anova.html index 5f061ed..16f2b01 100644 --- a/docs/anova.html +++ b/docs/anova.html @@ -4,18 +4,18 @@ -Chapter 12 ANOVA | A Handy Workbook for Research Methods & Statistics +Chapter 13 ANOVA | A Handy Workbook for Research Methods & Statistics - + - + - + - - + + @@ -63,17 +63,18 @@

  • t-tests
  • 6 One-Sample t-test
  • 7 Between-Subjects Student's t-test
  • -
  • 8 Within-Subjects t-test
  • +
  • 8 Between-Subjects Welch's t-test
  • +
  • 9 Within-Subjects t-test
  • Correlations
  • -
  • 9 Pearson Correlation
  • -
  • 10 Spearman Correlation
  • +
  • 10 Pearson Correlation
  • +
  • 11 Spearman Correlation
  • Linear Regression
  • -
  • 11 Simple Linear Regression
  • +
  • 12 Simple Linear Regression
  • ANOVAs
  • -
  • 12 ANOVA
  • +
  • 13 ANOVA
  • Additional
  • -
  • 13 Random formulas
  • -
  • 14 The Rounding Chapter
  • +
  • 14 Random formulas
  • +
  • 15 The Rounding Chapter
  • Appendices
  • A Installing R
  • B Symbols
  • @@ -87,14 +88,14 @@

    -
    +

    -12 ANOVA +13 ANOVA

    This chapter is currently under development but will eventually show how to complete ANOVAs and ANOVA tables by hand.

    -
    +

    -12.1 The ANOVA table +13.1 The ANOVA table

    One-Way Between-Subjects Scenario: A research team are investigating the influence of mainstream media on life happiness. They record Life Happiness scores from 0 to 100 with higher scores meaning more happy with life from a large cohort of participants and split the participants into two groups; Group 1 (n = 72) and Group 2 (n = 81). The researchers want to check whether there is a difference between the two groups of participants in terms of Life Happiness. Calculate F from the below one-way ANOVA output table comparing mean Life Happiness scores across the two groups of participants and state whether there is a significant difference between the groups or not. The Sums of Squares (\(SS\)) have been given to you.

    @@ -284,9 +285,9 @@

    If we were to look at a critical values look-up table for \(df_{Between}\) = 1, \(df_{Within}\) = 151, and \(\alpha = .05\), we would see that the closest we have is for \(df_{Between}\) = 1, \(df_{Within}\) = 100, which has a critical value of \(F_{crit}\) = 3.94. Given that our F-value is smaller than our \(F_{crit}\) then we can say our result is not significant, and as such would be written up as F(1, 151) = 3.16, p > .05, \(\eta_p^2\) = 0.02.

    Remember: If you were writing this up as a report, and analysed the data in R, then you would see the p-value was actually p = 0.07747604, and would be written up as p = 0.077

    -
    +

    -12.2 Look-Up table +13.2 Look-Up table

    Remembering that the \(F_{crit}\) value is the smallest F-value you need to find a significant effect, find the \(F_{crit}\) for your dfs, assuming \(\alpha = .05\). If the \(F\)-value you calculated is equal to or larger than \(F_{crit}\) then your test is significant. In this table, to fit it on to the page, \(df_{Between}\) is written as df1, and \(df_{Within}\) is written as df2.

    @@ -443,14 +444,14 @@

    + + + + + + + + + + + + + + + + + + + + +
    +Group + +N + +Mean + +SD +
    +A + +18 + +25.58 + +2.25 +
    +B + +18 + +29.07 + +2.53 +
    +

    Let's look at the main t-test formula for Welch's t-test:

    +

    \[t = \frac{\bar{X}_1 - \bar{X}_2}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}\]

    +

    Degrees of Freedom

    +

    \[df = \frac{\left(\frac{s^2_{x_1}}{n_1}+\frac{s^2_{x_2}}{n_2}\right)^2}{\frac{\left(\frac{s^2_{x_1}}{n_1}\right)^2}{n_1 - 1}+\frac{\left(\frac{s^2_{x_2}}{n_2}\right)^2}{n_2 - 1}}\]

    + +
    +
    +
    + +
    + + +
    + +
    +

    "A Handy Workbook for Research Methods & Statistics" was written by Phil McAleer. It was last built on Last Update: 2022-01-24.

    +
    + +
    +

    This book was built by the bookdown R package.

    +
    + +
    +
    + + diff --git a/docs/chi-square-cross-tabulation.html b/docs/chi-square-cross-tabulation.html index 5002fe5..7d06f02 100644 --- a/docs/chi-square-cross-tabulation.html +++ b/docs/chi-square-cross-tabulation.html @@ -63,17 +63,18 @@

  • t-tests
  • 6 One-Sample t-test
  • 7 Between-Subjects Student's t-test
  • -
  • 8 Within-Subjects t-test
  • +
  • 8 Between-Subjects Welch's t-test
  • +
  • 9 Within-Subjects t-test
  • Correlations
  • -
  • 9 Pearson Correlation
  • -
  • 10 Spearman Correlation
  • +
  • 10 Pearson Correlation
  • +
  • 11 Spearman Correlation
  • Linear Regression
  • -
  • 11 Simple Linear Regression
  • +
  • 12 Simple Linear Regression
  • ANOVAs
  • -
  • 12 ANOVA
  • +
  • 13 ANOVA
  • Additional
  • -
  • 13 Random formulas
  • -
  • 14 The Rounding Chapter
  • +
  • 14 Random formulas
  • +
  • 15 The Rounding Chapter
  • Appendices
  • A Installing R
  • B Symbols
  • diff --git a/docs/conventions.html b/docs/conventions.html index 7d8d024..d9c22e4 100644 --- a/docs/conventions.html +++ b/docs/conventions.html @@ -63,17 +63,18 @@

  • t-tests
  • 6 One-Sample t-test
  • 7 Between-Subjects Student's t-test
  • -
  • 8 Within-Subjects t-test
  • +
  • 8 Between-Subjects Welch's t-test
  • +
  • 9 Within-Subjects t-test
  • Correlations
  • -
  • 9 Pearson Correlation
  • -
  • 10 Spearman Correlation
  • +
  • 10 Pearson Correlation
  • +
  • 11 Spearman Correlation
  • Linear Regression
  • -
  • 11 Simple Linear Regression
  • +
  • 12 Simple Linear Regression
  • ANOVAs
  • -
  • 12 ANOVA
  • +
  • 13 ANOVA
  • Additional
  • -
  • 13 Random formulas
  • -
  • 14 The Rounding Chapter
  • +
  • 14 Random formulas
  • +
  • 15 The Rounding Chapter
  • Appendices
  • A Installing R
  • B Symbols
  • @@ -87,7 +88,7 @@

    -
    +

    C Conventions

    @@ -120,7 +121,7 @@

  • Menu/interface options: New File...
  • -
    +

    C.1 Webexercises

    @@ -132,8 +133,8 @@

  • What is a p-value? -
    - +
    +
  • @@ -152,7 +153,7 @@

    ## [1] "You found some hidden code!"

    -
    +

    C.2 Alert boxes

    @@ -169,7 +170,7 @@

    Try it yourself.

    -
    +

    C.3 Code Chunks

    @@ -185,7 +186,7 @@

    ```

    -
    +

    C.4 Glossary

    diff --git a/docs/foreword.html b/docs/foreword.html index 394d41e..7097a40 100644 --- a/docs/foreword.html +++ b/docs/foreword.html @@ -63,17 +63,18 @@

  • t-tests
  • 6 One-Sample t-test
  • 7 Between-Subjects Student's t-test
  • -
  • 8 Within-Subjects t-test
  • +
  • 8 Between-Subjects Welch's t-test
  • +
  • 9 Within-Subjects t-test
  • Correlations
  • -
  • 9 Pearson Correlation
  • -
  • 10 Spearman Correlation
  • +
  • 10 Pearson Correlation
  • +
  • 11 Spearman Correlation
  • Linear Regression
  • -
  • 11 Simple Linear Regression
  • +
  • 12 Simple Linear Regression
  • ANOVAs
  • -
  • 12 ANOVA
  • +
  • 13 ANOVA
  • Additional
  • -
  • 13 Random formulas
  • -
  • 14 The Rounding Chapter
  • +
  • 14 Random formulas
  • +
  • 15 The Rounding Chapter
  • Appendices
  • A Installing R
  • B Symbols
  • diff --git a/docs/index.html b/docs/index.html index 5fcb7ac..1101234 100644 --- a/docs/index.html +++ b/docs/index.html @@ -63,17 +63,18 @@

  • t-tests
  • 6 One-Sample t-test
  • 7 Between-Subjects Student's t-test
  • -
  • 8 Within-Subjects t-test
  • +
  • 8 Between-Subjects Welch's t-test
  • +
  • 9 Within-Subjects t-test
  • Correlations
  • -
  • 9 Pearson Correlation
  • -
  • 10 Spearman Correlation
  • +
  • 10 Pearson Correlation
  • +
  • 11 Spearman Correlation
  • Linear Regression
  • -
  • 11 Simple Linear Regression
  • +
  • 12 Simple Linear Regression
  • ANOVAs
  • -
  • 12 ANOVA
  • +
  • 13 ANOVA
  • Additional
  • -
  • 13 Random formulas
  • -
  • 14 The Rounding Chapter
  • +
  • 14 Random formulas
  • +
  • 15 The Rounding Chapter
  • Appendices
  • A Installing R
  • B Symbols
  • diff --git a/docs/installing-r.html b/docs/installing-r.html index b4766a6..9f8e503 100644 --- a/docs/installing-r.html +++ b/docs/installing-r.html @@ -63,17 +63,18 @@

  • t-tests
  • 6 One-Sample t-test
  • 7 Between-Subjects Student's t-test
  • -
  • 8 Within-Subjects t-test
  • +
  • 8 Between-Subjects Welch's t-test
  • +
  • 9 Within-Subjects t-test
  • Correlations
  • -
  • 9 Pearson Correlation
  • -
  • 10 Spearman Correlation
  • +
  • 10 Pearson Correlation
  • +
  • 11 Spearman Correlation
  • Linear Regression
  • -
  • 11 Simple Linear Regression
  • +
  • 12 Simple Linear Regression
  • ANOVAs
  • -
  • 12 ANOVA
  • +
  • 13 ANOVA
  • Additional
  • -
  • 13 Random formulas
  • -
  • 14 The Rounding Chapter
  • +
  • 14 Random formulas
  • +
  • 15 The Rounding Chapter
  • Appendices
  • A Installing R
  • B Symbols
  • @@ -87,12 +88,12 @@

    -
    +

    A Installing R

    Installing R and RStudio is usually straightforward. The sections below explain how and there is a helpful YouTube video here.

    -
    +

    A.1 Installing Base R

    @@ -101,13 +102,13 @@

    If you are installing the Windows version, choose the "base" subdirectory and click on the download link at the top of the page. After you install R, you should also install RTools; use the "recommended" version highlighted near the top of the list.

    If you are using Linux, choose your specific operating system and follow the installation instructions.

    -
    +

    A.2 Installing RStudio

    Go to rstudio.com and download the RStudio Desktop (Open Source License) version for your operating system under the list titled Installers for Supported Platforms.

    -
    +

    A.3 RStudio Settings

    @@ -127,7 +128,7 @@

    -
    +

    A.4 Installing LaTeX

    @@ -336,7 +337,7 @@

    window.onresize = move_sidebar; });

    -
    +

    -9 Pearson Correlation +10 Pearson Correlation

    The Pearson correlation otherwise known as the Pearson Product-Moment correlation measures the relationship between two variables when that relationship is monotonic and linear. To go a step further, in relating it measures the covariance between two variables, or the shared variance, and then standardises that measure between the values of -1 and 1 with -1 being the perfect negative relationship and 1 being the perfect positive relationship.

    -
    +

    -9.1 The Worked Example +10.1 The Worked Example

    Let's say that this is our starting data:

    @@ -368,9 +369,9 @@

    If we were to look at a critical values look-up table for \(df = 8\) and \(\alpha = .05\), we would see that the critical value is \(r_{crit} = 0.632\). Given that our r-value, ignoring polarity and just looking at the absolute value, so \(r = 0.967\), is equal to or larger than our \(r_{crit}\) then we can say our result is significant, and as such would be written up as r(8) = 0.967, p < .05.

    Remember: If you were writing this up as a report, and analysed the data in R, then you would see the p-value was actually p = 0.000005014954, and would be written up as p < .001

    -
    +

    -9.2 Look-Up table +10.2 Look-Up table

    Remembering that the \(r_{crit}\) value is the smallest r-value you need to find a significant effect, find the \(r_{crit}\) value for your df, assuming \(\alpha = .05\). If the \(r\)-value you calculated is equal to or larger than \(r_{crit}\) value then your test is significant.

    @@ -662,14 +663,14 @@

    window.onresize = move_sidebar; }); -
    +

    -13 Random formulas +14 Random formulas

    These formulas will eventually move somewhere that makes sense but for now they need a home and this is it:

    -
    +

    -13.1 t-value to r-value +14.1 t-value to r-value

    Did you know that the conversion of a t-value to an r-value is:

    \[r = \sqrt\frac{t^2}{t^2 + df}\]

    @@ -303,13 +304,13 @@

    window.onresize = move_sidebar; });

    -
    +

    -11 Simple Linear Regression +12 Simple Linear Regression

    Simple Linear Regression is analytical method that looks to model the relationship between an outcome variable and one explanatory predictor variables. For example, thinking about the data that we used for the Pearson Correlation analysis in this book, say instead of asking is HeadSize and IQ related, we could ask can you reliably predict IQ scores (our outcome or dependent variable) from HeadSize measurements (our predictor or independent variable), with the hypothesis of, "We predict that a linear model based on head size, as measured in cms, will significantly predict IQ scores as measured on a standard IQ test". We are going to look at this example to walk through some of the analysis but lets first remind ourselves of the data.

    @@ -241,9 +242,9 @@

    the intercept

    \[b_{0} = \overline{y} - b_{1} \times \overline{x}\]

    So lets spend some time looking at those two equations in turn.

    -
    +

    -11.1 The slope: +12.1 The slope:

    As above, the formula for the slope is:

    \[b_{1} = \frac{cov_{(x, y)}}{s^2_{x}}\]

    @@ -282,9 +283,9 @@

    \[b_{1} = 1.193781\]

    Giving a slope of \(b_{1}\) = 1.194, to three decimal places, meaning that for a 1 unit change in \(x\) we get a 1.194 unit change in \(y\). Or in other words, for a 1 unit change in HeadSize we get a 1.194 unit change in IQ.

    -
    +

    -11.2 The intercept +12.2 The intercept

    Great. So now we know the slope of the regression line between HeadSize and IQ, what we need next is the intercept. The formula for the intercept, as above, is:

    \[b_{0} = \overline{y} - b_{1} \times \overline{x}\]

    @@ -306,9 +307,9 @@

    \[b_{0} = 48.75202\]

    Meaning that we have an intercept of \(b_{0}\) = 48.75, to two decimal places. And if we remember that the intercept is the value of \(y\) when \(x\) is zero, then this tells us that when \(x\) = 0, the value of \(y\) is \(y\) = 48.75. Or stated in terms of HeadSize and IQ, when Headsize is 0, then IQ is 48.75.

    -
    +

    -11.3 Making a Prediction +12.3 Making a Prediction

    Now based on the information we have gained above we can actually use that to make predictions about a person we have not measured based on the formula:

    \[\hat{Y} = b_{0} + b_{1}X\]

    @@ -331,9 +332,9 @@

    \[\hat{Y} = 48.75 + 1.194 \times 59.4 = 119.6736\]

    Meaning that for a participant with a HeadSize of 59.4 we would predict an IQ of 119.67.

    -
    +

    -11.4 The R-squared +12.4 The R-squared

    Obviously the question now is how good is our model at making these predictions, and one measure of that is \(R^2\) (pronounced R-squared). This relates to the \(error\) term that we saw in the original formula, i.e. \(\hat{Y} = b_{0} + b_{1}X + error\), and as we said at the start it relates to the residuals. The residuals you might know are the difference between predicted values and observed values. For example, if we look at Participant 1 in our data we see they had a HeadSize of 50.8 and an IQ of 107. Those are our observed values of \(X\) and \(Y\) for that participant, but what if we predicted a value for that participant instead (\(\hat{Y}\)). Using the above formula we would see:

    \[\hat{Y} = 48.75 + 1.194 \times 50.8 = 109.4052\]

    @@ -344,9 +345,9 @@

    \[R^2 = 0.967 \times 0.967 = 0.935089\]

    Meaning that we have an \(R^2\) of \(R^2 = 0.935\), to three decimal places. And given that that is quite close to an \(R^2\) of 1, it would suggest that our model is very good at predicting IQ from HeadSize (Y from X), that our residuals are small, and that there is a strong positive relationship between the two variables.

    -
    +

    -11.5 The Write-up +12.5 The Write-up

    Ok great, so we have now got a lot of information on our model including the slope, the intercept, and the \(R^2\). The one thing we don't actually know is where our model is significant. We will go into what that means and how to determine that in a later part, but in the meantime we will just tell you that the model is significant, (F(1, 8) = 115.07, p < .001). So now we have everything we need for the write up:

      @@ -364,15 +365,15 @@

      But I guess it might look a bit odd as we give the standardised coeffiencient twice, just in different ways, so we could write it with the unstandardised coefficient as:

      A team of researchers were interested in the relationship between Head Size and IQ, and specifically whether they could predict IQ from Head Size. The researchers set out the hypothesis that a linear model based on head size, as measured in cms, will significantly predict IQ scores as measured on a standard IQ test. Descriptive analysis suggested a strong positive relationship between Head Size (M = 42.67, SD = 12.92) and IQ (M = 99.7, SD = 15.95), (r(8) = 0.967), with head size explaining 93.5% of the variance in IQ scores. On analysis, a linear regression model revealed that head size (measured in cm) significantly predicted participant scores on an IQ test (\(b\) = 1.194, F(1, 8) = 115.07, p < .001, \(R^2\) = 0.935). As such the alternative hypothesis was accepted suggesting that...

    -
    +

    -11.6 Test Yourself +12.6 Test Yourself

    Here we are going to try out a few examples based on the above. First we will use the above numbers we have calculated to make some predictions to check our understanding. So, assuming the values of 1.194 for the slope, and 48.75 for the intercept, try to answer the following questions:

    • To two decimal places, what would be the predicted value of IQ if the HeadSize was 37.8? -
      - +
      +
    @@ -392,8 +393,8 @@

    • To two decimal places, what would be the predicted value of IQ if the HeadSize was 24.2? -
      - +
      +
    @@ -413,8 +414,8 @@

    • To two decimal places, what would be the predicted value of IQ if the HeadSize was 52.9? -
      - +
      +
    @@ -434,8 +435,8 @@

    • To two decimal places, what would be the predicted value of IQ if the HeadSize was 48.4? -
      - +
      +
    @@ -460,18 +461,18 @@

    -
    +

    -10 Spearman Correlation +11 Spearman Correlation

    The Spearman correlation otherwise known as the Spearman rank correlation coefficient measures the relationship between two variables when that relationship is monotonic. It can be used for relationships that are linear or non-linear.

    As in the Pearson Correlation, the Spearman correlation measures the covariance between two variables, or the shared variance, and then standardises that measure between the values of -1 and 1 with -1 being the perfect negative relationship and 1 being the perfect positive relationship.

    The key difference between the Spearman Correlation and the Pearson Correlation is that the Spearman Correlation is based on the rank order of data - i.e. the raw data is converted to ordinal ranks.

    If all of the ranks within each variable are unique - i.e. there are no tied ranks - then the formula for the Spearman Correlation is as follows:

    \[\rho = 1 - \frac{6 \times \sum{d_i^2}}{n(n^2-1)}\]

    -
    +

    -10.1 Section glossary +11.1 Section glossary

    @@ -124,13 +125,13 @@

    -
    +

    B Symbols

    diff --git a/docs/the-rounding-chapter.html b/docs/the-rounding-chapter.html index 4701657..0629172 100644 --- a/docs/the-rounding-chapter.html +++ b/docs/the-rounding-chapter.html @@ -4,17 +4,17 @@ -Chapter 14 The Rounding Chapter | A Handy Workbook for Research Methods & Statistics +Chapter 15 The Rounding Chapter | A Handy Workbook for Research Methods & Statistics - + - + @@ -63,17 +63,18 @@

  • t-tests
  • 6 One-Sample t-test
  • 7 Between-Subjects Student's t-test
  • -
  • 8 Within-Subjects t-test
  • +
  • 8 Between-Subjects Welch's t-test
  • +
  • 9 Within-Subjects t-test
  • Correlations
  • -
  • 9 Pearson Correlation
  • -
  • 10 Spearman Correlation
  • +
  • 10 Pearson Correlation
  • +
  • 11 Spearman Correlation
  • Linear Regression
  • -
  • 11 Simple Linear Regression
  • +
  • 12 Simple Linear Regression
  • ANOVAs
  • -
  • 12 ANOVA
  • +
  • 13 ANOVA
  • Additional
  • -
  • 13 Random formulas
  • -
  • 14 The Rounding Chapter
  • +
  • 14 Random formulas
  • +
  • 15 The Rounding Chapter
  • Appendices
  • A Installing R
  • B Symbols
  • @@ -87,9 +88,9 @@

    -
    +

    -14 The Rounding Chapter +15 The Rounding Chapter

    One stumbling block that people face when first working with statistics is rounding values appropriately. This chapter contains a few examples for you to try out to help you check that you are rounding correctly.

    Rounding in Psychology

    @@ -128,9 +129,9 @@

    The principle behind rounding is that you look to the value in the position after the level you want to round to and see if it is "less than 5" or "equal to or greater than 5". If that value is "less than 5" then you round down - meaning that the value stays as it is. If that value is "equal to or greater than 5" you round up - meaning that the value goes up to the next value. An example will be easier to look at.

    -
    +

    -14.1 Worked Example +15.1 Worked Example

    Let's say we want to round M = 12.4251126 to different levels.

    Rounding to three decimal places

    @@ -138,9 +139,9 @@

    Rounding to two decimal places

    Lets now round M = 12.4251126 to two decimal places - so two values after the decimal point. To do that we need to look at the value in the third decimal place. The value in the third decimal place is 5. As that value is equal to or greater than 5, we round up and so 12.4251126 becomes 12.43

    -
    +

    -14.2 Test Yourself +15.2 Test Yourself

    Example 1

    Now here are a few examples just to see if you can follow the above.

    @@ -205,14 +206,14 @@

    -
    +

    -8 Within-Subjects t-test +9 Within-Subjects t-test

    within-subjects t-test: Compare two conditions where the participants are the same in both conditions (or more rarely are different participants that have been highly matched on a number of demographics such as IQ, reading ability, etc - must be matched on a number of demographics).

    -
    +

    -8.1 The Worked Example +9.1 The Worked Example

    Let's say that this is our starting data:

    @@ -462,13 +463,13 @@

    If we were to look at a critical values look-up table for \(df = 9\) and \(\alpha = .05\) (two-tailed), we would see that the critical value is \(t_{crit} = 2.262\). Given that our t-value, ignoring polarity and just looking at the absolute value, so \(t = 3.21\), is equal to or larger than our \(t_{crit}\) then we can say our result is significant, and as such would be written up as t(9) = 3.21, p < .05, d = 1.01.

    Remember: If you were writing this up as a report, and analysis the data in R, then you would see the p-value was actually p = 0.011, and would be written up as p = 0.011

    -
    +

    -8.2 Test Yourself +9.2 Test Yourself

    -
    +

    -8.2.1 DataSet 1 +9.2.1 DataSet 1

    Let's say that this is our starting data:

    @@ -841,9 +842,9 @@

    Remember: If you were writing this up as a report, and analysis the data in R, then you would see the p-value was actually p = 0.028, and would be written up as p = 0.028

    -
    +

    -8.2.2 DataSet 2 +9.2.2 DataSet 2

    Let's say that this is our starting data:

    @@ -1216,9 +1217,9 @@

    Remember: If you were writing this up as a report, and analysis the data in R, then you would see the p-value was actually p = 0.051, and would be written up as p = 0.051

    -
    +

    -8.2.3 DataSet 3 +9.2.3 DataSet 3

    Let's say that this is our starting data:

    @@ -1592,9 +1593,9 @@

    -
    +

    -8.3 Look-Up table +9.3 Look-Up table

    Remembering that the \(t_{crit}\) value is the smallest t-value you need to find a significant effect, find the \(t_{crit}\) for your df, assuming \(\alpha = .05\). If the \(t\) value you calculated is equal to or larger than \(t_{crit}\) then your test is significant.

    @@ -1691,21 +1692,21 @@