{"id":1039,"date":"2015-08-17T10:54:54","date_gmt":"2015-08-17T09:54:54","guid":{"rendered":"http:\/\/pcool.dyndns.org:8080\/statsbook\/?page_id=1039"},"modified":"2025-06-24T22:15:59","modified_gmt":"2025-06-24T21:15:59","slug":"answers-statistical-tests","status":"publish","type":"page","link":"https:\/\/pcool.dyndns.org\/index.php\/answers-statistical-tests\/","title":{"rendered":"Answers Statistical Tests"},"content":{"rendered":"\n<p>1. Using &lt;= 16 weeks as \u2018cut off\u2019 point, indicate patients were fracture healing had occurred within 16 weeks by \u2018-\u2018 and patients who took longer than 16 weeks to unite by \u2018+\u2019. In the smoking group, there were 7 out of 12 patients were fracture union was in excess of 16 weeks. Whilst In the non smokers, there was only 1 out of 8 patients were the fracture took longer than 16 weeks to unite. Is this due to chance?We formulate a null hypothesis; <em>there is no difference in fracture healing time between smokers and non smokers<\/em> and test this hypothesis. Using a <strong><em>two sided<\/em><\/strong> sign test the probability is:<\/p>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\(Probability = {8 \\choose 1}\\cdot{\\frac{1}{2}}^1\\cdot{\\frac{1}{2}}^7   + {8 \\choose 0}\\cdot{\\frac{1}{2}}^0\\cdot{\\frac{1}{2}}^8  + {8\\choose7}\\cdot{\\frac{1}{2}}^7\\cdot{\\frac{1}{2}}^1 +{8\\choose8}\\cdot{\\frac{1}{2}}^8\\cdot{\\frac{1}{2}}^0 \\)\n<script src=\"https:\/\/pcool.dyndns.org\/wp-includes\/js\/dist\/hooks.min.js?ver=dd5603f07f9220ed27f1\" id=\"wp-hooks-js\"><\/script>\n<script src=\"https:\/\/pcool.dyndns.org\/wp-includes\/js\/dist\/i18n.min.js?ver=c26c3dc7bed366793375\" id=\"wp-i18n-js\"><\/script>\n<script id=\"wp-i18n-js-after\">\nwp.i18n.setLocaleData( { 'text direction\\u0004ltr': [ 'ltr' ] } );\n\/\/# sourceURL=wp-i18n-js-after\n<\/script>\n<script  async src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/mathjax\/2.7.7\/MathJax.js?config=TeX-MML-AM_CHTML\" id=\"mathjax-js\"><\/script>\n<\/div>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\(Probability = \\frac{8!}{7!\\cdot1!}\\cdot{\\frac{1}{2}}\\cdot{\\frac{1}{2}}^7 + \\frac{8!}{8!\\cdot0!}\\cdot{\\frac{1}{2}}^8  + \\frac{8!}{1!\\cdot7!}\\cdot{\\frac{1}{2}}^7\\cdot{\\frac{1}{2}}+ \\frac{8!}{0!\\cdot8!}\\cdot{\\frac{1}{2}}^8 \\)\n<\/div>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\(Probability = 8\\cdot0.00390625 + 1\\cdot0.00390625 + 8\\cdot0.00390625 +1\\cdot0.00390625=0.0703125 \\)<\/div>\n\n\n\n<p>P &gt; 5%, therefore NOT statistically significant. The null hypothesis can therefore NOT be rejected. We conclude that we were unable to demonstrate a difference in fracture healing time between smokers and non smokers.<\/p>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\"><\/div>\n\n\n\n<p>The same result is obtained if the calculation is performed in R:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#f60707\" class=\"has-inline-color\">binom.test(1,8)<\/mark>\n\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#3210e9\" class=\"has-inline-color\">\tExact binomial test\n\ndata:  1 and 8\nnumber of successes = 1, number of trials = 8, p-value = 0.07031\nalternative hypothesis: true probability of success is not equal to 0.5\n95 percent confidence interval:\n 0.003159724 0.526509671\nsample estimates:\nprobability of success \n                 0.125 <\/mark><\/em><\/code><\/pre>\n\n\n\n<p>2. Using the Chi Square test, we need to first construct a table with the observed frequencies and the expected frequencies:<\/p>\n\n\n\n<table id=\"tablepress-14\" class=\"tablepress tablepress-id-14\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Smoker<br \/>\nObserved<\/th><th class=\"column-3\">Smoker<br \/>\nExpected<\/th><th class=\"column-4\">Non Smoker<br \/>\nObserved<\/th><th class=\"column-5\">Non Smoker<br \/>\nExpected<\/th><th class=\"column-6\">Total<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\"><= 16 weeks<\/td><td class=\"column-2\">5<\/td><td class=\"column-3\">12&#215;12\/20 = 7.2<\/td><td class=\"column-4\">7<\/td><td class=\"column-5\">8&#215;12\/20 = 4.8<\/td><td class=\"column-6\">12<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">> 16 weeks<\/td><td class=\"column-2\">7<\/td><td class=\"column-3\">12&#215;8\/20 = 4.8<\/td><td class=\"column-4\">1<\/td><td class=\"column-5\">8&#215;8\/20 = 3.2<\/td><td class=\"column-6\">8<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\"><\/td><td class=\"column-2\">12<\/td><td class=\"column-3\">12<\/td><td class=\"column-4\">8<\/td><td class=\"column-5\">8<\/td><td class=\"column-6\">20<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-14 from cache -->\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\(X^2 = \\frac{(Observed &#8211; Expected)^2}{Expected} \\) <\/div>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\(X^2 = \\frac{(5-7.2)^2}{7.2} + \\frac{(7-4.8)^2}{4.8} + \\frac{(7-4.8)^2}{4.8} +\\frac{(1-3.2)^2}{3.2} \\)<\/div>\n\n\n\n<div class=\"wp-block-mathml-mathmlblock\">\\(X^2 \\approx 0.6722 + 1.00833 + 1.00833 + 1.5125 \\approx 4.2014\\)<\/div>\n\n\n\n<p>The observed frequency table has two rows and two columns. Therefore, there is 1 degree of freedom (r-1)\u00d7(c-1). Using the Chi Square distribution table we can see that there is statistical significance (p &lt; 5%). <strong>However, not all prerequisites of the Chi Square test have been met as the expected frequencies are not above 5<\/strong>. It would therefore be more appropriate to use the Yates continuity correction (should be used if the expected frequencies are below 10) or the Fisher Exact test (if expected frequencies are below 5). These tests are performed below in R.<\/p>\n\n\n\n<p>First without continuity correction:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#fa0505\" class=\"has-inline-color\">data&lt;-matrix(c(5,7,7,1),nrow=2)\nchisq.test(data,correct=FALSE)<\/mark>\n\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#0c17ec\" class=\"has-inline-color\">\u00a0\u00a0 \u00a0Pearson's Chi-squared test\n\ndata:\u00a0 data\nX-squared = 4.2014, df = 1, p-value = 0.04039\n\nWarning message:\nIn chisq.test(data, correct = FALSE) :\n\u00a0 Chi-squared approximation may be incorrect<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>Obviously, R calculates the same result. The computer calculates an exact p-value, suggesting significance. <strong>However, the expected frequencies are below 5 and it is inappropriate to use the Chi Square test<\/strong>. To show the expected frequencies:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><span style=\"color: #ff0000;\"><em>chisq.test(data,correct=FALSE)$expected<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0 &#091;,1] &#091;,2]<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>&#091;1,]\u00a0 7.2\u00a0 4.8<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>&#091;2,]\u00a0 4.8\u00a0 3.2<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>Warning message:<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>In chisq.test(data, correct = FALSE) :<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0 Chi-squared approximation may be incorrect<\/em><\/span><\/code><\/pre>\n\n\n\n<p>If the expected frequencies are below 10, Yates continuity correction should be used:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#f50909\" class=\"has-inline-color\">chisq.test(data,correct=TRUE)<\/mark>\n\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#200bf6\" class=\"has-inline-color\">\u00a0\u00a0 \u00a0Pearson's Chi-squared test with Yates' continuity correction\n\ndata:\u00a0 data\nX-squared = 2.5087, df = 1, p-value = 0.1132\n\nWarning message:\nIn chisq.test(data, correct = TRUE) :\n\u00a0 Chi-squared approximation may be incorrect<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>So, the Chi Square test with Yates continuity correction is insignificant! If the expected frequencies are below 5 however, a Fisher Exact test would be more appropriate:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><span style=\"color: #ff0000;\"><em>fisher.test(data)<\/em><\/span>\n     <span style=\"color: #0000ff;\"><em>Fisher's Exact Test for Count Data<\/em><\/span>\n\n<span style=\"color: #0000ff;\"><em>data:\u00a0 data<\/em><\/span>\n<strong><span style=\"color: #0000ff;\"><em>p-value = 0.06967<\/em><\/span><\/strong>\n<span style=\"color: #0000ff;\"><em>alternative hypothesis: true odds ratio is not equal to 1<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>95 percent confidence interval:<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a00.001993953 1.370866340<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>sample estimates:<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>odds ratio <\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a00.1148794<\/em> <\/span><\/code><\/pre>\n\n\n\n<p>Again, the result is insignificant.<\/p>\n\n\n\n<p>3. To perform a Wilcoxon test in R:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#f00707\" class=\"has-inline-color\">wilcox.test(smokers$Time~smokers$Group,correct=FALSE)<\/mark>\n\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#1a0eee\" class=\"has-inline-color\">\u00a0\u00a0 \u00a0Wilcoxon rank sum test\n\ndata:\u00a0 smokers$Time by smokers$Group\nW = 26.5, p-value = 0.0949\nalternative hypothesis: true location shift is not equal to 0\n\nWarning message:\nIn wilcox.test.default(x = c(10L, 10L, 11L, 12L, 15L, 15L, 16L,\u00a0 :\n\u00a0 cannot compute exact p-value with ties<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>The Wilcoxon test is insignificant, again failing to demonstrate a difference.<\/p>\n\n\n\n<p>4. Normality will be tested using three methods; a quantile quantile plot, a Shapiro-Wilk test and a Kolmogorov-Smirnov test.<\/p>\n\n\n\n<p>To create a quantile quantile plot for both groups:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">qqnorm(smokers$Time)<\/span><\/em>\n<em><span style=\"color: #ff0000;\">qqline(smokers$Time)<\/span><\/em><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers1-1024x768.png\" alt=\"\" class=\"wp-image-3633\" srcset=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers1-1024x768.png 1024w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers1-300x225.png 300w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers1-768x576.png 768w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers1.png 1355w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>For only the smokers:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><span style=\"color: #ff0000;\">qqnorm(smokers$Time&#091;which(smokers$Group=='Smoker')])<\/span><\/em>\n<em><span style=\"color: #ff0000;\">qqline(smokers$Time&#091;which(smokers$Group=='Smoker')])<\/span><\/em><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers2-1024x768.png\" alt=\"\" class=\"wp-image-3638\" srcset=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers2-1024x768.png 1024w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers2-300x225.png 300w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers2-768x576.png 768w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers2.png 1355w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><a href=\"http:\/\/pcool.dyndns.org:8080\/statsbook\/wp-content\/uploads\/smokers2.png\"><\/a>And for only the non smokers:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><span style=\"color: #ff0000;\"><em>qqnorm(smokers$Time&#091;which(smokers$Group=='Non Smoker')])<\/em><\/span>\n<span style=\"color: #ff0000;\"><em>qqline(smokers$Time&#091;which(smokers$Group=='Non Smoker')])<\/em><\/span><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers3-1024x768.png\" alt=\"\" class=\"wp-image-3643\" srcset=\"https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers3-1024x768.png 1024w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers3-300x225.png 300w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers3-768x576.png 768w, https:\/\/pcool.dyndns.org\/wp-content\/uploads\/2025\/06\/smokers3.png 1355w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><a href=\"http:\/\/pcool.dyndns.org:8080\/statsbook\/wp-content\/uploads\/smokers3.png\"><\/a>Although the numbers are small, the quantile quantile plots deviate from a straight line at the lower quantiles. Therefore, it may not be appropriate to assume the data can be modelled with a Normal distribution.<\/p>\n\n\n\n<p>The Shapiro-Wilk test can be performed on both groups together, or separately:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><span style=\"color: #ff0000;\"><em>shapiro.test(smokers$Time)<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0Shapiro-Wilk normality test<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>data:\u00a0 smokers$Time<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>W = 0.9233,<strong> p-value = 0.1148<\/strong><\/em><\/span>\n<span style=\"color: #ff0000;\"><em>shapiro.test(smokers$Time&#091;which(smokers$Group=='Smoker')])<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0Shapiro-Wilk normality test<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>data:\u00a0 smokers$Time&#091;which(smokers$Group == \"Smoker\")]<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>W = 0.9393, <strong>p-value = 0.4884<\/strong><\/em><\/span>\n<span style=\"color: #ff0000;\"><em>shapiro.test(smokers$Time&#091;which(smokers$Group=='Non Smoker')])<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0Shapiro-Wilk normality test<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>data:\u00a0 smokers$Time&#091;which(smokers$Group == \"Non Smoker\")]<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>W = 0.8837,<strong> p-value = 0.2041<\/strong><\/em><\/span><\/code><\/pre>\n\n\n\n<p>The p-value is insignificant and there is no reason to reject the null hypothesis that the data is Normally distributed. It is concluded it would be reasonable to model the data with a Normal distribution.<\/p>\n\n\n\n<p>The Kolomogorov-Smirnov test can be used to compare the variable time to a Normal distribution with the same mean and standard deviation:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><span style=\"color: #ff0000;\"><em>ks.test(smokers$Time,\"pnorm\",mean=mean(smokers$Time),<\/em><\/span>\n   <span style=\"color: #ff0000;\"><em>sd=sd(smokers$Time))<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0One-sample Kolmogorov-Smirnov test<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>data:\u00a0 smokers$Time<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>D = 0.1683,<strong> p-value = 0.6226<\/strong><\/em><\/span>\n<span style=\"color: #0000ff;\"><em>alternative hypothesis: two-sided<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>Warning message:<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>In ks.test(smokers$Time, \"pnorm\", mean = mean(smokers$Time), sd = sd(smokers$Time)) :<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0 ties should not be present for the Kolmogorov-Smirnov test<\/em><\/span><\/code><\/pre>\n\n\n\n<p>Or, comparing both groups:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><span style=\"color: #ff0000;\"><em>ks.test(smokers$Time&#091;which(smokers$Group=='Smoker')],<\/em><\/span>\n   <span style=\"color: #ff0000;\"><em>smokers$Time&#091;which(smokers$Group=='Non Smoker')])<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0 \u00a0Two-sample Kolmogorov-Smirnov test<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>data:\u00a0 smokers$Time&#091;which(smokers$Group == \"Smoker\")] and smokers$Time&#091;which(smokers$Group == \"Non Smoker\")]<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>D = 0.4583, <strong>p-value = 0.2656<\/strong><\/em><\/span>\n<span style=\"color: #0000ff;\"><em>alternative hypothesis: two-sided<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>Warning message:<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>In ks.test(smokers$Time&#091;which(smokers$Group == \"Smoker\")], smokers$Time&#091;which(smokers$Group ==\u00a0 :<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0 cannot compute exact p-value with ties<\/em><\/span><\/code><\/pre>\n\n\n\n<p>Again, there is no reason to reject the null hypothesis and Normality is assumed on the basis of the Shapiro-Wilk and Kolmogorov-Smirnov tests.<\/p>\n\n\n\n<p>5. The answer to question 4 suggests it is reasonable to assume Normality and therefore to use a t-test. To perform a power analsysis in R :<\/p>\n\n\n\n<p>The mean of the Time variable is:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><span style=\"color: #ff0000;\"><em>mean(smokers$Time)<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>&#091;1] 15<\/em><\/span><\/code><\/pre>\n\n\n\n<p>The standard deviation of the Time variable is:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><span style=\"color: #ff0000;\"><em>sd(smokers$Time)<\/em><\/span>\n<em><span style=\"color: #0000ff;\">&#091;1] 4.091069<\/span><\/em><\/code><\/pre>\n\n\n\n<p>Delta is 10% of the mean, so delta is 1.5. The significance level is 0.05 and the power 80% (0.08):<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><span style=\"color: #ff0000;\"><em>power.t.test(sd=4.09,delta=1.5,sig.level=0.05,power=0.8)<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0 Two-sample t test power calculation <\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 n = 117.6764<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delta = 1.5<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sd = 4.09<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0 sig.level = 0.05<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 power = 0.8<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>\u00a0\u00a0\u00a0 alternative = two.sided<\/em><\/span>\n<span style=\"color: #0000ff;\"><em>NOTE: n is number in *each* group<\/em><\/span><\/code><\/pre>\n\n\n\n<p>Therefore, 118 patients are required in each group (study size 236).<\/p>\n\n\n\n<p>6. First a 2 \u00d7 2 table is constructed: <\/p>\n\n\n\n\n<table id=\"tablepress-25\" class=\"tablepress tablepress-id-25\">\n<thead>\n<tr class=\"row-1\">\n\t<td class=\"column-1\"><\/td><th class=\"column-2\">Truth<br \/>\nPositive<\/th><th class=\"column-3\">Truth<br \/>\nNegative<\/th><td class=\"column-4\"><\/td>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">Test<br \/>\nPositive<\/td><td class=\"column-2\">6<\/td><td class=\"column-3\">4<\/td><td class=\"column-4\">10<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">Test<br \/>\nNegative<\/td><td class=\"column-2\">30<\/td><td class=\"column-3\">10<\/td><td class=\"column-4\">40<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\"><\/td><td class=\"column-2\">36<\/td><td class=\"column-3\">14<\/td><td class=\"column-4\">50<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-25 from cache -->\n\n\n\n<ul class=\"wp-block-list\">\n<li>True Positive: 6<\/li>\n\n\n\n<li>False Positive: 4<\/li>\n\n\n\n<li>False Negative: 30<\/li>\n\n\n\n<li>True Negative: 10<\/li>\n\n\n\n<li>ppv = 60%<\/li>\n\n\n\n<li>npv = 25%<\/li>\n\n\n\n<li>Sensitivity \u2248 17%<\/li>\n\n\n\n<li>Specificity \u2248 71%<\/li>\n\n\n\n<li>Accuracy = 32%<\/li>\n<\/ul>\n\n\n\n<p>Or in R :<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#f60c0c\" class=\"has-inline-color\">library(epiR)<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#1611e7\" class=\"has-inline-color\">Package epiR 0.9-62 is loaded\nType help(epi.about) for summary information<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#f60707\" class=\"has-inline-color\">mat&lt;-matrix(c(6,30,4,10),ncol=2)\nmat<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#0f0aea\" class=\"has-inline-color\">\u00a0\u00a0\u00a0\u00a0 &#091;,1] &#091;,2]\n&#091;1,]\u00a0\u00a0\u00a0 6\u00a0\u00a0\u00a0 4\n&#091;2,]\u00a0\u00a0 30\u00a0\u00a0 10<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#f00606\" class=\"has-inline-color\">epi.tests(mat)<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0);color:#0c0fea\" class=\"has-inline-color\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Disease +\u00a0\u00a0\u00a0 Disease -\u00a0\u00a0\u00a0\u00a0\u00a0 Total\nTest +\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10\nTest -\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 30\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 40\nTotal\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 36\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 14\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 50\n\nPoint estimates and 95 % CIs:\n---------------------------------------------------------\nApparent prevalence\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.20 (0.10, 0.34)\nTrue prevalence\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.72 (0.58, 0.84)\nSensitivity\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.17 (0.06, 0.33)\nSpecificity\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.71 (0.42, 0.92)\nPositive predictive value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.60 (0.26, 0.88)\nNegative predictive value\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.25 (0.13, 0.41)\nPositive likelihood ratio\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.58 (0.19, 1.76)\nNegative likelihood ratio\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1.17 (0.81, 1.68)\n---------------------------------------------------------<\/mark><\/em><\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Using &lt;= 16 weeks as \u2018cut off\u2019 point, indicate patients were fracture healing had occurred within 16 weeks by \u2018-\u2018 and patients who took longer than 16 weeks to unite by \u2018+\u2019. In the smoking group, there were 7 out of 12 patients were fracture union was in excess of 16 weeks. Whilst In [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-1039","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/1039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/comments?post=1039"}],"version-history":[{"count":5,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/1039\/revisions"}],"predecessor-version":[{"id":4378,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/1039\/revisions\/4378"}],"wp:attachment":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/media?parent=1039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}