{"id":3339,"date":"2024-01-31T06:47:47","date_gmt":"2024-01-31T06:47:47","guid":{"rendered":"http:\/\/optimumsportsperformance.com\/blog\/?p=3339"},"modified":"2024-02-03T16:07:49","modified_gmt":"2024-02-03T16:07:49","slug":"calculating-confidence-intervals-in-r","status":"publish","type":"post","link":"https:\/\/optimumsportsperformance.com\/blog\/calculating-confidence-intervals-in-r\/","title":{"rendered":"Calculating Confidence Intervals in R"},"content":{"rendered":"<p>A favorite paper of mine is the 1986 paper by Gardner and Altman regarding confidence intervals and estimation as a more useful way of reporting data than a dichotomous p-value:<\/p>\n<p><strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/PMC1339793\/\">Gardner, MJ. Altman, DG. (1986). Confidence intervals rather than P values: Estimation rather than hypothesis testing. Brit Med J; 292:746-750.<\/a><\/span><\/strong><\/p>\n<p>In this paper, Gardner and Altman discuss three main points for either moving away from or supplementing statistical reporting with p-values:<\/p>\n<ol>\n<li>Research often focuses on null hypothesis significance testing with the goal being to identify statistically significant results.<\/li>\n<li>However, we are often interested in the magnitude of the factor of interest.<\/li>\n<li>Given that research deals with samples of a broader population, the readers are not only interested in the observed magnitude of the estimand but also the degree of variability and plausible range of values for the population. This variability can be quantified using confidence intervals.<\/li>\n<\/ol>\n<p>Aside from the paper providing a clear explanation of the issue at hand, their appendix offers the equations to calculate confidence intervals for means, differences in means, proportions, and differences in proportions. Thus, I decided to compile the appendix in an R script for those looking to code confidence intervals (and not have to rely on pre-built functions).<\/p>\n<p>All of this code is available on my <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/pw2\/R-Tips-Tricks\/blob\/master\/Gardner%20%26%20Altman%20(1986)%20-%20Confidence%20intervals%20rather%20than%20P%20values%20-%20Estimation%20rather%20than%20hypothesis%20testing%20-%20BMJ.Rmd\">GITHUB page<\/a><\/span><\/strong>.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Confidence Intervals for Means and Differences<\/strong><\/span><\/p>\n<p><strong><em>Single Sample<\/em><\/strong><\/p>\n<ol>\n<li>Obtain the mean<\/li>\n<li>Calculate the standard error (SE) of the mean as <em><strong>SE = SD\/sqrt(N)<\/strong><\/em><\/li>\n<li>Multiply by a t-critical value specific to the level of confidence of interest and the degrees of freedom (DF) for the single sample, <em><strong>DF = N &#8211; 1<\/strong><\/em><\/li>\n<\/ol>\n<p>The confidence intervals are calculated as:<\/p>\n<p><em><strong>Low = mean &#8211; t_{crit} * SE<\/strong><\/em><br \/>\n<em><strong>High = mean + t_{crit} * SE<\/strong><\/em><\/p>\n<p><em>Example<\/em><\/p>\n<p>We collect data on 30 participants on a special test of strength and observe a mean of 40 and standard deviation of 10. We want to calculate the 90% confidence interval.<\/p>\n<p>The steps above can easily be computed in R. First, we write down the known info (the data that is provided to us). We then calculate the standard error and degrees of freedom (N &#8211; 1). To obtain the critical value for our desired level of interest, we use the t-distribution is specific to the degrees of freedom of our data.<\/p>\n<pre class=\"brush: r; title: ; notranslate\" title=\"\">\r\n## Known info\r\nN &lt;- 30\r\navg &lt;- 40\r\nSD &lt;- 10\r\n\r\n## Calculate DF and SE\r\nSE &lt;- SD \/ sqrt(N)\r\nDF &lt;- N - 1\r\n\r\n## Calculate the confidence level of interest (90%), the amount of data in each of the the two tails ((1 - level of interest) \/ 2) and the t-critical value\r\nlevel_of_interest &lt;- 0.90\r\ntail_value &lt;- (1 - level_of_interest)\/2\r\n\r\nt_crit &lt;- abs(qt(tail_value, df = DF))\r\nt_crit\r\n\r\n## Calculate the 90% CI\r\nlow90 &lt;- round(avg - t_crit * SE, 1)\r\nhigh90 &lt;- round(avg + t_crit * SE, 1)\r\n\r\ncat(&quot;The 90% Confidence Interval is:&quot;, low90, &quot; to &quot;, high90)\r\n<\/pre>\n<p><a href=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.46.25\u202fPM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-3346\" src=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.46.25\u202fPM-1024x92.png\" alt=\"\" width=\"625\" height=\"56\" srcset=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.46.25\u202fPM-1024x92.png 1024w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.46.25\u202fPM-300x27.png 300w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.46.25\u202fPM-768x69.png 768w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.46.25\u202fPM-624x56.png 624w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.46.25\u202fPM.png 1048w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p><strong><em>Two Samples<\/em><\/strong><\/p>\n<ol>\n<li>Obtain the sample mean and standard deviations for the two samples<\/li>\n<li>Pool the estimate of the standard deviation:<em><strong>s = sqrt(((n_1 &#8211; 1)*s^2_1 + n_2 &#8211; 1)*s^2_2) \/ (n_1 + n_2 &#8211; 2))<\/strong><\/em><\/li>\n<li>Calculate the SE for the difference:<em><strong>SE_{diff} = s * sqrt(1\/n_1 + 1\/n_2)<\/strong><\/em><\/li>\n<li>Calculate the confidence interval as:<\/li>\n<\/ol>\n<p><em><strong>Low = (x_1 &#8211; x_2) &#8211; t_{crit} * SE_{diff}<\/strong><\/em><br \/>\n<em><strong>High = (x_1 &#8211; x_2) + t_{crit} * SE_{diff}<\/strong><\/em><\/p>\n<p><em>Example<\/em><\/p>\n<p>The example in the paper provides the following info:<\/p>\n<ul>\n<li>Blood pressure levels were measured in 100 diabetic and 100 non-diabetic men aged 40-49 years old.<\/li>\n<li>Mean systolic blood pressure was 146.4 mmHg (SD = 18.5) in diabetics and 140.4 mmHg (SD = 16.8) in non-diabetics.<\/li>\n<\/ul>\n<p>Calculate the 95% CI.<\/p>\n<pre class=\"brush: r; title: ; notranslate\" title=\"\">\r\n## store the known data\r\nN_diabetic &lt;- 100\r\nN_non_diabetic &lt;- 100\r\ndiabetic_avg &lt;- 146.4\r\ndiabetic_sd &lt;-18.5\r\nnon_diabetic_avg &lt;- 140.4\r\nnon_diabetic_sd &lt;- 16.8\r\n\r\n## calculate the difference in means, the pooled SD, and the SE of diff\r\ngroup_diff &lt;- diabetic_avg - non_diabetic_avg\r\n\r\npooled_sd &lt;- sqrt(((N_diabetic - 1)*diabetic_sd^2 + (N_non_diabetic - 1)*non_diabetic_sd^2) \/ (N_diabetic + N_non_diabetic - 2))\r\n\r\nse_diff &lt;- pooled_sd * sqrt(1\/N_diabetic + 1\/N_non_diabetic)\r\n\r\n## Calculate the confidence level of interest (95%), the amount of data in each of the the two tails ((1 - level of interest) \/ 2) and the t-critical value\r\nlevel_of_interest &lt;- 0.95\r\ntail_value &lt;- (1 - level_of_interest)\/2\r\n\r\nt_crit &lt;- abs(qt(tail_value, df = N_diabetic + N_non_diabetic - 2))\r\nt_crit\r\n\r\n## Calculate the 95% CI\r\nlow95 &lt;- round(group_diff - t_crit * se_diff, 1)\r\nhigh95 &lt;- round(group_diff + t_crit * se_diff, 1)\r\n\r\ncat(&quot;The 95% Confidence Interval is:&quot;, low95, &quot; to &quot;, high95)\r\n<\/pre>\n<p><a href=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.53.48\u202fPM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-3347\" src=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.53.48\u202fPM-1024x85.png\" alt=\"\" width=\"625\" height=\"52\" srcset=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.53.48\u202fPM-1024x85.png 1024w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.53.48\u202fPM-300x25.png 300w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.53.48\u202fPM-768x64.png 768w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.53.48\u202fPM-624x52.png 624w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.53.48\u202fPM.png 1032w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Confidence Intervals for Proportions<\/strong><\/span><\/p>\n<p><em>Single Sample<\/em><\/p>\n<ol>\n<li>Obtain the proportion for the population<\/li>\n<li>Calculate the SE of the proportion, <em><strong>SE = sqrt((p * (1-p)) \/ N)<\/strong><\/em><\/li>\n<li>Obtain the z-critical value from a standard normal distribution for the level of confidence of interest (since the value for a proportion does not depend on sample size as it does for means).<\/li>\n<li>Calculate the confidence interval:<\/li>\n<\/ol>\n<p><strong>low = p &#8211; z_{crit} * SE<\/strong><br \/>\n<strong>high = p + z_{crit} * SE<\/strong><\/p>\n<p><em>Example<\/em><\/p>\n<p>We observe a basketball player with 80 field goal attempts and a FG% of 39%. Calculate the 90% CI.<\/p>\n<pre class=\"brush: r; title: ; notranslate\" title=\"\">\r\n## Store the known info\r\nN &lt;- 80\r\nfg_pct &lt;- 0.39\r\n\r\n## Calculate SE\r\nse &lt;- sqrt((fg_pct * (1 - fg_pct)) \/ N)\r\n\r\n## Calculate z-critical value for 50% confidence\r\nlevel_of_interest &lt;- 0.95\r\ntail_value &lt;- (1 - level_of_interest) \/ 2\r\nz_crit &lt;- qnorm(p = tail_value, lower.tail = FALSE)\r\n\r\n## Calculate the 95% CI\r\nlow95 &lt;- round(fg_pct - z_crit * se, 3)\r\nhigh95 &lt;- round(fg_pct + z_crit * se, 3)\r\n\r\ncat(&quot;The 95% Confidence Interval is:&quot;, low95, &quot; to &quot;, high95)\r\n<\/pre>\n<p><a href=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.56.01\u202fPM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-3348\" src=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.56.01\u202fPM-1024x95.png\" alt=\"\" width=\"625\" height=\"58\" srcset=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.56.01\u202fPM-1024x95.png 1024w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.56.01\u202fPM-300x28.png 300w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.56.01\u202fPM-768x71.png 768w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.56.01\u202fPM-624x58.png 624w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.56.01\u202fPM.png 1040w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p><em>Two Samples<\/em><\/p>\n<ol>\n<li>Calculate the difference in proportions between the two groups<\/li>\n<li>Calculate the SE of the difference in proportions:<em><strong>SE_{diff} = sqrt(((p_1 * (1-p_1)) \/ n_1) + ((p_2 * (1 &#8211; p_2)) \/ n_2))<\/strong><\/em><\/li>\n<li>Calculate the z-critical value for the level of interest<\/li>\n<li>Calculate the confidence interval as:<\/li>\n<\/ol>\n<p><em><strong>low = (p_1 &#8211; p_2) &#8211; (z_{crit} * se_{diff})<\/strong><\/em><br \/>\n<em><strong>high = (p_1 &#8211; p_2) + (z_{crit} * se_{diff})<\/strong><\/em><\/p>\n<p><em>Example of two unpaired samples<br \/>\n<\/em><\/p>\n<p>The study provides the following table of example data:<\/p>\n<pre class=\"brush: r; title: ; notranslate\" title=\"\">\r\ndata.frame(\r\n  response = c(&quot;improvement&quot;, &quot;no improvement&quot;, &quot;total&quot;),\r\n  treatment_A = c(61, 19, 80),\r\n  treatment_B = c(45, 35, 80)\r\n)\r\n<\/pre>\n<p><a href=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.58.32\u202fPM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3349\" src=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.58.32\u202fPM.png\" alt=\"\" width=\"499\" height=\"191\" srcset=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.58.32\u202fPM.png 950w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.58.32\u202fPM-300x115.png 300w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.58.32\u202fPM-768x294.png 768w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.58.32\u202fPM-624x239.png 624w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/a><\/p>\n<p>The difference we are interested in is between the proportion who improved in treatment A and the proportion of those who improved in treatment B.<\/p>\n<pre class=\"brush: r; title: ; notranslate\" title=\"\">\r\n## Obtain the two proportions from the table and total sample sizes\r\npr_A &lt;- 61\/80\r\nn_A &lt;- 80\r\npr_B &lt;- 45\/80\r\nn_B &lt;- 80\r\n\r\n## calculate the difference in proportions\r\ndiff_pr &lt;- pr_A - pr_B\r\n\r\n## Calculate the SE\r\nse_diff &lt;- sqrt((pr_A * (1 - pr_A))\/n_A + (pr_B * (1 - pr_B))\/n_B)\r\n\r\n## Get z-critical value for 95% confidence\r\nlevel_of_interest &lt;- 0.95\r\ntail_value &lt;- (1 - level_of_interest) \/ 2\r\nz_crit &lt;- qnorm(p = tail_value, lower.tail = FALSE)\r\n\r\n## Calculate the 95% CI\r\nlow95 &lt;- round(diff_pr - z_crit * se_diff, 3)\r\nhigh95 &lt;- round(diff_pr + z_crit * se_diff, 3)\r\n\r\ncat(&quot;The 95% Confidence Interval is:&quot;, low95, &quot; to &quot;, high95)\r\n<\/pre>\n<p><a href=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.59.44\u202fPM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-3350\" src=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.59.44\u202fPM-1024x80.png\" alt=\"\" width=\"625\" height=\"49\" srcset=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.59.44\u202fPM-1024x80.png 1024w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.59.44\u202fPM-300x23.png 300w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.59.44\u202fPM-768x60.png 768w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.59.44\u202fPM-624x49.png 624w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-8.59.44\u202fPM.png 1076w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><em>Example for two paired samples<\/em><\/p>\n<p>We can organize the data in a table like this:<\/p>\n<pre class=\"brush: r; title: ; notranslate\" title=\"\">\r\ndata.frame(\r\n  test_1 = c(&quot;Present&quot;, &quot;Present&quot;, &quot;Absent&quot;, &quot;Absent&quot;),\r\n  test_2 = c(&quot;Present&quot;, &quot;Absent&quot;, &quot;Present&quot;, &quot;Absent&quot;),\r\n  number_of_subjects = c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;)\r\n)\r\n<\/pre>\n<p><a href=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.01.18\u202fPM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3351\" src=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.01.18\u202fPM.png\" alt=\"\" width=\"429\" height=\"180\" srcset=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.01.18\u202fPM.png 916w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.01.18\u202fPM-300x126.png 300w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.01.18\u202fPM-768x322.png 768w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.01.18\u202fPM-624x262.png 624w\" sizes=\"auto, (max-width: 429px) 100vw, 429px\" \/><\/a><\/p>\n<p>Let&#8217;s say we measured a group of subjects for a specific disease twice in a study. A subject either has the disease (present) or does not (absent) in the two time points. We observe the following data:<\/p>\n<pre class=\"brush: r; title: ; notranslate\" title=\"\">\r\ndat &lt;- data.frame(\r\n  test_1 = c(&quot;Present&quot;, &quot;Present&quot;, &quot;Absent&quot;, &quot;Absent&quot;),\r\n  test_2 = c(&quot;Present&quot;, &quot;Absent&quot;, &quot;Present&quot;, &quot;Absent&quot;),\r\n  number_of_subjects = c(10, 25, 45, 5)\r\n)\r\n\r\ndat\r\n\r\n## total sample size\r\nN &lt;- sum(dat$number_of_subjects)\r\n<\/pre>\n<p>If we care about comparing those that had the disease (Present) on both occasions (both Test1 and Test2) we calculate them as:<\/p>\n<p><em><strong>p_1 = (a + b) \/ N<\/strong><\/em><br \/>\n<em><strong>p_2 = (a + c) \/ N<\/strong><\/em><br \/>\n<em><strong>Diff = p_1 &#8211; p_2<\/strong><\/em><\/p>\n<p>The SE of the difference is:<\/p>\n<p><em><strong>SE_{diff} = 1\/N * sqrt(b + c &#8211; (b-c)^2\/N)<\/strong><\/em><\/p>\n<pre class=\"brush: r; title: ; notranslate\" title=\"\">\r\n## Obtain the info we need from the table\r\np1 &lt;- (10 + 25) \/ N\r\np2 &lt;- (10 + 45) \/ N\r\ndiff_prop &lt;- p1 - p2\r\ndiff_prop\r\n\r\n## Calculate the SE of the difference\r\nse_diff &lt;- 1 \/ N * sqrt(25 + 45 - (25+45)^2\/N)\r\n\r\n## Get z-critical value for 95% confidence\r\nlevel_of_interest &lt;- 0.95\r\ntail_value &lt;- (1 - level_of_interest) \/ 2\r\nz_crit &lt;- qnorm(p = tail_value, lower.tail = FALSE)\r\n\r\n## Calculate the 95% CI\r\nlow95 &lt;- round(diff_prop - z_crit * se_diff, 3)\r\nhigh95 &lt;- round(diff_prop + z_crit * se_diff, 3)\r\n\r\ncat(&quot;The 95% Confidence Interval is:&quot;, low95, &quot; to &quot;, high95)\r\n<\/pre>\n<p><a href=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.03.32\u202fPM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-3352\" src=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.03.32\u202fPM-1024x88.png\" alt=\"\" width=\"625\" height=\"54\" srcset=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.03.32\u202fPM-1024x88.png 1024w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.03.32\u202fPM-300x26.png 300w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.03.32\u202fPM-768x66.png 768w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.03.32\u202fPM-624x53.png 624w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2024\/01\/Screenshot-2024-01-31-at-9.03.32\u202fPM.png 1074w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>As always, all of this code is available on my <strong><a href=\"https:\/\/github.com\/pw2\/R-Tips-Tricks\/blob\/master\/Gardner%20%26%20Altman%20(1986)%20-%20Confidence%20intervals%20rather%20than%20P%20values%20-%20Estimation%20rather%20than%20hypothesis%20testing%20-%20BMJ.Rmd\"><span style=\"color: #0000ff;\">GITHUB page<\/span><\/a><\/strong>.<\/p>\n<p>And, if you&#8217;d like to read the full paper, you can find it here:<\/p>\n<p><strong><a href=\"https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/PMC1339793\/\"><span style=\"color: #0000ff;\">Gardner, MJ. Altman, DG. (1986). Confidence intervals rather than P values: Estimation rather than hypothesis testing. Brit Med J; 292:746-750.<\/span><\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A favorite paper of mine is the 1986 paper by Gardner and Altman regarding confidence intervals and estimation as a more useful way of reporting data than a dichotomous p-value: Gardner, MJ. Altman, DG. (1986). Confidence intervals rather than P values: Estimation rather than hypothesis testing. Brit Med J; 292:746-750. In this paper, Gardner and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47,43,42],"tags":[],"class_list":["post-3339","post","type-post","status-publish","format-standard","hentry","category-model-building-in-r","category-sports-analytics","category-sports-science"],"_links":{"self":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/3339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/comments?post=3339"}],"version-history":[{"count":5,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/3339\/revisions"}],"predecessor-version":[{"id":3354,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/3339\/revisions\/3354"}],"wp:attachment":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/media?parent=3339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/categories?post=3339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/tags?post=3339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}