{"id":11697,"date":"2019-12-26T10:49:59","date_gmt":"2019-12-26T08:49:59","guid":{"rendered":"https:\/\/www.datanovia.com\/en\/?post_type=dt_lessons&#038;p=11697"},"modified":"2019-12-26T10:50:45","modified_gmt":"2019-12-26T08:50:45","slug":"how-to-do-paired-t-test-in-r","status":"publish","type":"dt_lessons","link":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/","title":{"rendered":"How to Do Paired T-test in R"},"content":{"rendered":"<div id=\"rdoc\">\n<p>This article describes how to do a <strong>paired t-test in R<\/strong> (or in <em>Rstudio<\/em>). Note that the paired t-test is also referred as <em>dependent t-test<\/em>, <em>related samples t-test<\/em>, <em>matched pairs t test<\/em> or <em>paired sample t test<\/em>.<\/p>\n<p>You will learn how to:<\/p>\n<ul>\n<li><em>Perform the paired t-test in R<\/em> using the following functions :\n<ul>\n<li><code>t_test()<\/code> [rstatix package]: the result is a data frame for easy plotting using the <code>ggpubr<\/code> package.<\/li>\n<li><code>t.test()<\/code> [stats package]: R base function.<\/li>\n<\/ul>\n<\/li>\n<li><em>Interpret and report the paired t-test<\/em><\/li>\n<li><em>Add p-values and significance levels to a plot<\/em><\/li>\n<li><em>Calculate and report the paired t-test effect size<\/em> using <em>Cohen\u2019s d<\/em>. The <code>d<\/code> statistic redefines the difference in means as the number of standard deviations that separates those means. T-test conventional effect sizes, proposed by Cohen, are: 0.2 (small effect), 0.5 (moderate effect) and 0.8 (large effect) <span class=\"citation\">(Cohen 1998)<\/span>.<\/li>\n<\/ul>\n<p>Contents:<\/p>\n<div id=\"TOC\">\n<ul>\n<li><a href=\"#prerequisites\">Prerequisites<\/a><\/li>\n<li><a href=\"#demo-data\">Demo data<\/a><\/li>\n<li><a href=\"#summary-statistics\">Summary statistics<\/a><\/li>\n<li><a href=\"#calculation\">Calculation<\/a>\n<ul>\n<li><a href=\"#using-the-r-base-function\">Using the R base function<\/a><\/li>\n<li><a href=\"#using-the-rstatix-package\">Using the rstatix package<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#interpretation\">Interpretation<\/a><\/li>\n<li><a href=\"#effect-size\">Effect size<\/a><\/li>\n<li><a href=\"#report\">Report<\/a><\/li>\n<li><a href=\"#summary\">Summary<\/a><\/li>\n<li><a href=\"#references\">References<\/a><\/li>\n<\/ul>\n<\/div>\n<div class='dt-sc-hr-invisible-medium  '><\/div>\n<div class='dt-sc-ico-content type1'><div class='custom-icon' ><a href='https:\/\/www.datanovia.com\/en\/product\/practical-statistics-in-r-for-comparing-groups-numerical-variables\/' target='_blank'><span class='fa fa-book'><\/span><\/a><\/div><h4><a href='https:\/\/www.datanovia.com\/en\/product\/practical-statistics-in-r-for-comparing-groups-numerical-variables\/' target='_blank'> Related Book <\/a><\/h4>Practical Statistics in R II - Comparing Groups: Numerical Variables<\/div>\n<div class='dt-sc-hr-invisible-medium  '><\/div>\n<div id=\"prerequisites\" class=\"section level2\">\n<h2>Prerequisites<\/h2>\n<p>Make sure you have installed the following R packages:<\/p>\n<ul>\n<li><code>tidyverse<\/code> for data manipulation and visualization<\/li>\n<li><code>ggpubr<\/code> for creating easily publication ready plots<\/li>\n<li><code>rstatix<\/code> provides pipe-friendly R functions for easy statistical analyses.<\/li>\n<li><code>datarium<\/code>: contains required data sets for this chapter.<\/li>\n<\/ul>\n<p>Start by loading the following required packages:<\/p>\n<pre class=\"r\"><code>library(tidyverse)\r\nlibrary(ggpubr)\r\nlibrary(rstatix)<\/code><\/pre>\n<\/div>\n<div id=\"demo-data\" class=\"section level2\">\n<h2>Demo data<\/h2>\n<p>Here, we\u2019ll use a demo dataset <code>mice2<\/code> [datarium package], which contains the weight of 10 mice before and after the treatment.<\/p>\n<pre class=\"r\"><code># Wide format\r\ndata(\"mice2\", package = \"datarium\")\r\nhead(mice2, 3)<\/code><\/pre>\n<pre><code>##   id before after\r\n## 1  1    187   430\r\n## 2  2    194   404\r\n## 3  3    232   406<\/code><\/pre>\n<pre class=\"r\"><code># Transform into long data: \r\n# gather the before and after values in the same column\r\nmice2.long &lt;- mice2 %&gt;%\r\n  gather(key = \"group\", value = \"weight\", before, after)\r\nhead(mice2.long, 3)<\/code><\/pre>\n<pre><code>##   id  group weight\r\n## 1  1 before    187\r\n## 2  2 before    194\r\n## 3  3 before    232<\/code><\/pre>\n<div class=\"block\">\n<p>We want to know, if there is any significant difference in the mean weights after treatment?<\/p>\n<\/div>\n<\/div>\n<div id=\"summary-statistics\" class=\"section level2\">\n<h2>Summary statistics<\/h2>\n<p>Compute some summary statistics (mean and sd) by groups:<\/p>\n<pre class=\"r\"><code>mice2.long %&gt;%\r\n  group_by(group) %&gt;%\r\n  get_summary_stats(weight, type = \"mean_sd\")<\/code><\/pre>\n<pre><code>## # A tibble: 2 x 5\r\n##   group  variable     n  mean    sd\r\n##   &lt;chr&gt;  &lt;chr&gt;    &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;\r\n## 1 after  weight      10  400.  30.1\r\n## 2 before weight      10  201.  20.0<\/code><\/pre>\n<\/div>\n<div id=\"calculation\" class=\"section level2\">\n<h2>Calculation<\/h2>\n<div id=\"using-the-r-base-function\" class=\"section level3\">\n<h3>Using the R base function<\/h3>\n<p>There are two options for computing the independent t-test depending whether the two groups data are saved either in two different vectors or in a data frame.<\/p>\n<p><strong>Option 1<\/strong>. The data are saved in two different numeric vectors:<\/p>\n<pre class=\"r\"><code># Save the data in two different vector\r\nbefore &lt;- mice2$before\r\nafter &lt;- mice2$after\r\n# Compute t-test\r\nres &lt;- t.test(before, after, paired = TRUE)\r\nres<\/code><\/pre>\n<pre><code>## \r\n##  Paired t-test\r\n## \r\n## data:  before and after\r\n## t = -30, df = 9, p-value = 1e-09\r\n## alternative hypothesis: true difference in means is not equal to 0\r\n## 95 percent confidence interval:\r\n##  -217 -182\r\n## sample estimates:\r\n## mean of the differences \r\n##                    -199<\/code><\/pre>\n<p><strong>Option 2<\/strong>. The data are saved in a data frame.<\/p>\n<pre class=\"r\"><code># Compute t-test\r\nres &lt;- t.test(weight ~ group, data = mice2.long, paired = TRUE)\r\nres<\/code><\/pre>\n<div class=\"success\">\n<p>As you can see, the two methods give the same results.<\/p>\n<\/div>\n<p>In the result above :<\/p>\n<ul>\n<li><code>t<\/code> is the t-test statistic value (t = -25.55),<\/li>\n<li><code>df<\/code> is the degrees of freedom (df= 9),<\/li>\n<li><code>p-value<\/code> is the significance level of the t-test (p-value = 1.03910^{-9}).<\/li>\n<li><code>conf.int<\/code> is the confidence interval of the mean of the differences at 95% (conf.int = [-217.1442, -181.8158]);<\/li>\n<li><code>sample estimates<\/code> is the mean of the differences (mean = -199.48).<\/li>\n<\/ul>\n<\/div>\n<div id=\"using-the-rstatix-package\" class=\"section level3\">\n<h3>Using the rstatix package<\/h3>\n<p>We\u2019ll use the pipe-friendly <code>t_test()<\/code> function [rstatix package], a wrapper around the R base function <code>t.test()<\/code>. The results can be easily added to a plot using the <code>ggpubr<\/code> R package.<\/p>\n<pre class=\"r\"><code>stat.test &lt;- mice2.long  %&gt;% \r\n  t_test(weight ~ group, paired = TRUE) %&gt;%\r\n  add_significance()\r\nstat.test<\/code><\/pre>\n<pre><code>## # A tibble: 1 x 9\r\n##   .y.    group1 group2    n1    n2 statistic    df             p p.signif\r\n##   &lt;chr&gt;  &lt;chr&gt;  &lt;chr&gt;  &lt;int&gt; &lt;int&gt;     &lt;dbl&gt; &lt;dbl&gt;         &lt;dbl&gt; &lt;chr&gt;   \r\n## 1 weight after  before    10    10      25.5     9 0.00000000104 ****<\/code><\/pre>\n<p>The results above show the following components:<\/p>\n<ul>\n<li><code>.y.<\/code>: the y variable used in the test.<\/li>\n<li><code>group1,group2<\/code>: the compared groups in the pairwise tests.<\/li>\n<li><code>statistic<\/code>: Test statistic used to compute the p-value.<\/li>\n<li><code>df<\/code>: degrees of freedom.<\/li>\n<li><code>p<\/code>: p-value.<\/li>\n<\/ul>\n<div class=\"warning\">\n<p>Note that, you can obtain a detailed result by specifying the option <code>detailed = TRUE<\/code>.<\/p>\n<\/div>\n<pre class=\"r\"><code>mice2.long %&gt;%\r\n  t_test(weight ~ group, paired = TRUE, detailed = TRUE) %&gt;%\r\n  add_significance()<\/code><\/pre>\n<pre><code>## # A tibble: 1 x 14\r\n##   estimate .y.    group1 group2    n1    n2 statistic             p    df conf.low conf.high method alternative p.signif\r\n##      &lt;dbl&gt; &lt;chr&gt;  &lt;chr&gt;  &lt;chr&gt;  &lt;int&gt; &lt;int&gt;     &lt;dbl&gt;         &lt;dbl&gt; &lt;dbl&gt;    &lt;dbl&gt;     &lt;dbl&gt; &lt;chr&gt;  &lt;chr&gt;       &lt;chr&gt;   \r\n## 1     199. weight after  before    10    10      25.5 0.00000000104     9     182.      217. T-test two.sided   ****<\/code><\/pre>\n<\/div>\n<\/div>\n<div id=\"interpretation\" class=\"section level2\">\n<h2>Interpretation<\/h2>\n<p>The p-value of the test is 1.0410^{-9}, which is less than the significance level alpha = 0.05. We can then reject null hypothesis and conclude that the average weight of the mice before treatment is significantly different from the average weight after treatment with a <strong>p-value<\/strong> = 1.0410^{-9}.<\/p>\n<\/div>\n<div id=\"effect-size\" class=\"section level2\">\n<h2>Effect size<\/h2>\n<p>The effect size for a paired-samples t-test can be calculated by dividing the mean difference by the standard deviation of the difference, as shown below.<\/p>\n<p><strong>Cohen\u2019s d formula<\/strong>:<\/p>\n<p><span class=\"math display\">\\[<br \/>\nd = \\frac{mean_D}{SD_D}<br \/>\n\\]<\/span><\/p>\n<p>Where <code>D<\/code> is the differences of the paired samples values.<\/p>\n<p><strong>Calculation<\/strong>:<\/p>\n<pre class=\"r\"><code>mice2.long  %&gt;% cohens_d(weight ~ group, paired = TRUE)<\/code><\/pre>\n<pre><code>## # A tibble: 1 x 7\r\n##   .y.    group1 group2 effsize    n1    n2 magnitude\r\n## * &lt;chr&gt;  &lt;chr&gt;  &lt;chr&gt;    &lt;dbl&gt; &lt;int&gt; &lt;int&gt; &lt;ord&gt;    \r\n## 1 weight after  before    8.08    10    10 large<\/code><\/pre>\n<div class=\"success\">\n<p>There is a large effect size, Cohen\u2019s d = 8.07.<\/p>\n<\/div>\n<\/div>\n<div id=\"report\" class=\"section level2\">\n<h2>Report<\/h2>\n<p>We could report the result as follow: The average weight of mice was significantly increased after treatment, t(9) = 25.5, p &lt; 0.0001, d = 8.07.<\/p>\n<p>Visualize the results:<\/p>\n<pre class=\"r\"><code># Create a box plot\r\nbxp &lt;- ggpaired(mice2.long, x = \"group\", y = \"weight\", \r\n         order = c(\"before\", \"after\"),\r\n         ylab = \"Weight\", xlab = \"Groups\")\r\n\r\n# Add p-value and significance levels\r\nstat.test &lt;- stat.test %&gt;% add_xy_position(x = \"group\")\r\nbxp + \r\n  stat_pvalue_manual(stat.test, tip.length = 0) +\r\n  labs(subtitle = get_test_label(stat.test, detailed= TRUE))<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/r-statistics-2-comparing-groups-means\/figures\/087-how-to-do-paired-t-test-in-r-paired-t-test-box-plot-with-p-values-1.png\" width=\"364.8\" \/><\/p>\n<\/div>\n<div id=\"summary\" class=\"section level2\">\n<h2>Summary<\/h2>\n<p>This article shows how to perform the paired t-test in R\/Rstudio using two different ways: the R base function <code>t.test()<\/code> and the <code>t_test()<\/code> function in the rstatix package. We also describe how to interpret and report the t-test results.<\/p>\n<\/div>\n<div id=\"references\" class=\"section level2 unnumbered\">\n<h2>References<\/h2>\n<div id=\"refs\" class=\"references\">\n<div id=\"ref-cohen1998\">\n<p>Cohen, J. 1998. <em>Statistical Power Analysis for the Behavioral Sciences<\/em>. 2nd ed. Hillsdale, NJ: Lawrence Erlbaum Associates.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><!--end rdoc--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Describes how to do a paired t-test in R\/Rstudio. You will learn the calculation, visualization, effect size measure using the Cohen&#8217;s d, interpretation and reporting.<\/p>\n","protected":false},"author":1,"featured_media":8986,"parent":11693,"menu_order":87,"comment_status":"open","ping_status":"closed","template":"","class_list":["post-11697","dt_lessons","type-dt_lessons","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Do Paired T-test in R : The Best Tutorial You Will Love - Datanovia<\/title>\n<meta name=\"description\" content=\"Describes how to do a paired t-test in R\/Rstudio. You will learn the calculation, visualization, effect size measure using the Cohen&#039;s d, interpretation and reporting.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Do Paired T-test in R : The Best Tutorial You Will Love - Datanovia\" \/>\n<meta property=\"og:description\" content=\"Describes how to do a paired t-test in R\/Rstudio. You will learn the calculation, visualization, effect size measure using the Cohen&#039;s d, interpretation and reporting.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Datanovia\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-26T08:50:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/X43080728_731669230506357_2893894886111576064_n.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/\",\"name\":\"How to Do Paired T-test in R : The Best Tutorial You Will Love - Datanovia\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/X43080728_731669230506357_2893894886111576064_n.jpg\",\"datePublished\":\"2019-12-26T08:49:59+00:00\",\"dateModified\":\"2019-12-26T08:50:45+00:00\",\"description\":\"Describes how to do a paired t-test in R\/Rstudio. You will learn the calculation, visualization, effect size measure using the Cohen's d, interpretation and reporting.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/#primaryimage\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/X43080728_731669230506357_2893894886111576064_n.jpg\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/X43080728_731669230506357_2893894886111576064_n.jpg\",\"width\":1024,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.datanovia.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lessons\",\"item\":\"https:\/\/www.datanovia.com\/en\/lessons\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Do a T-test in R: Calculation and Reporting\",\"item\":\"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to Do Paired T-test in R\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\",\"url\":\"https:\/\/www.datanovia.com\/en\/\",\"name\":\"Datanovia\",\"description\":\"Data Mining and Statistics for Decision Support\",\"publisher\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.datanovia.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\",\"name\":\"Datanovia\",\"url\":\"https:\/\/www.datanovia.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png\",\"width\":98,\"height\":99,\"caption\":\"Datanovia\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Do Paired T-test in R : The Best Tutorial You Will Love - Datanovia","description":"Describes how to do a paired t-test in R\/Rstudio. You will learn the calculation, visualization, effect size measure using the Cohen's d, interpretation and reporting.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/","og_locale":"en_US","og_type":"article","og_title":"How to Do Paired T-test in R : The Best Tutorial You Will Love - Datanovia","og_description":"Describes how to do a paired t-test in R\/Rstudio. You will learn the calculation, visualization, effect size measure using the Cohen's d, interpretation and reporting.","og_url":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/","og_site_name":"Datanovia","article_modified_time":"2019-12-26T08:50:45+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/X43080728_731669230506357_2893894886111576064_n.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/","url":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/","name":"How to Do Paired T-test in R : The Best Tutorial You Will Love - Datanovia","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/#primaryimage"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/X43080728_731669230506357_2893894886111576064_n.jpg","datePublished":"2019-12-26T08:49:59+00:00","dateModified":"2019-12-26T08:50:45+00:00","description":"Describes how to do a paired t-test in R\/Rstudio. You will learn the calculation, visualization, effect size measure using the Cohen's d, interpretation and reporting.","breadcrumb":{"@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/#primaryimage","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/X43080728_731669230506357_2893894886111576064_n.jpg","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2019\/05\/X43080728_731669230506357_2893894886111576064_n.jpg","width":1024,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/how-to-do-paired-t-test-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.datanovia.com\/en\/"},{"@type":"ListItem","position":2,"name":"Lessons","item":"https:\/\/www.datanovia.com\/en\/lessons\/"},{"@type":"ListItem","position":3,"name":"How to Do a T-test in R: Calculation and Reporting","item":"https:\/\/www.datanovia.com\/en\/lessons\/how-to-do-a-t-test-in-r-calculation-and-reporting\/"},{"@type":"ListItem","position":4,"name":"How to Do Paired T-test in R"}]},{"@type":"WebSite","@id":"https:\/\/www.datanovia.com\/en\/#website","url":"https:\/\/www.datanovia.com\/en\/","name":"Datanovia","description":"Data Mining and Statistics for Decision Support","publisher":{"@id":"https:\/\/www.datanovia.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.datanovia.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.datanovia.com\/en\/#organization","name":"Datanovia","url":"https:\/\/www.datanovia.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png","width":98,"height":99,"caption":"Datanovia"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/"}}]}},"multi-rating":{"mr_rating_results":[]},"_links":{"self":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons\/11697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons"}],"about":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/types\/dt_lessons"}],"author":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/comments?post=11697"}],"version-history":[{"count":0,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons\/11697\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons\/11693"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media\/8986"}],"wp:attachment":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media?parent=11697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}