Skip to content

Commit e881ccb

Browse files
committed
resolve conflicts in manual
1 parent 9394eef commit e881ccb

File tree

3 files changed

+5
-81
lines changed

3 files changed

+5
-81
lines changed

data/Paired two-sample t-test.csv

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
<<<<<<< HEAD
2-
Ovarian,Peritoneal
3-
1201.33,1155.98
4-
1029.64,1020.82
5-
895.57,881.21
6-
842.14,830.78
7-
903.07,897.06
8-
1311.57,1262.73
9-
833.52,823.06
10-
1007.66,951.01
11-
1465.51,1450.98
12-
967.82,978.15
13-
812.72,778.26
14-
884.08,823.57
15-
1358.56,1335.78
16-
1280.1,1293.91
17-
942.38,925.75
18-
884.33,891.34
19-
930.09,892.02
20-
1146.75,1132.8
21-
881.5,847.78
22-
1315.22,1337.8
23-
=======
241
A,B
252
1201.33,1155.98
263
1029.64,1020.82
@@ -42,4 +19,3 @@ A,B
4219
1146.75,1132.8
4320
881.5,847.78
4421
1315.22,1337.8
45-
>>>>>>> gh-pages

manual.Rnw

Lines changed: 5 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -805,44 +805,9 @@ This is not a significant result (p$>0.05$), so there is \textbf{no evidence of
805805

806806
\subsubsection{Paired two-sample t-test}
807807

808-
<<<<<<< HEAD
809-
\begin{table}[h]
810-
\centering
811-
\begin{tabular}{| l | l || l |l |}
812-
\hline
813-
\multicolumn{4}{|c|}{Cellularity}\\
814-
\hline
815-
Subject & Site A & Site B & Difference \\
816-
\hline
817-
1 & 1201.33 & 1155.98 & -45.35 \\
818-
2 & 1029.64 & 1020.82 & -8.82 \\
819-
3 & 895.57 & 881.21 & -14.37 \\
820-
4 & 842.14 & 830.78 & -11.36 \\
821-
5 & 903.07 & 897.06 & -6.01 \\
822-
6 & 1311.57 & 1262.73 & -48.84 \\
823-
7 & 833.52 & 823.06 & -10.46 \\
824-
8 & 1007.66 & 951.01 & -56.65 \\
825-
9 & 1465.51 & 1450.98 & -14.53 \\
826-
10 & 967.82 & 978.15 & 10.33 \\
827-
11 & 812.72 & 778.26 & -34.46 \\
828-
12 & 884.08 & 823.57 & -60.51 \\
829-
13 & 1358.56 & 1335.78 & -22.78 \\
830-
14 & 1280.10 & 1293.91 & 13.80 \\
831-
15 & 942.38 & 925.75 & -16.63 \\
832-
16 & 884.33 & 891.34 & 7.01 \\
833-
17 & 930.09 & 892.02 & -38.07 \\
834-
18 & 1146.75 & 1132.80 & -13.95 \\
835-
19 & 881.50 & 847.78 & -33.72 \\
836-
20 & 1315.22 & 1337.80 & 22.58 \\
837808

838-
\hline
839-
\end{tabular}
840-
\caption{Cellularity at two sites of disesase}
841-
\label{cellularity}
842-
\end{table}
843809

844-
\textbf{Example}: 20 patients with advanced ovarian cancer were studied using MRI imaging. Cellularity was measured for each individual patient by estimating water movement. We want to know whether there is a significant difference in the cellularity between the primary site of disease and a site of metastatic disease within the same patient. The data are shown in Table \ref{cellularity}. We want to test the \textbf{null hypothesis} that the mean cellularity at site A is equal to the mean cellularity at site B. This is like saying:\\
845-
=======
810+
846811

847812
<<echo=FALSE,results='asis'>>=
848813
library(xtable)
@@ -852,7 +817,7 @@ xtable(cell,caption="Cellularity at two sites of disesase",label="cellularity")
852817
@
853818

854819
\textbf{Example}: 20 patients with advanced cancer were studied using MRI imaging. Cellularity was measured for each individual patient by estimating water movement. We want to know whether there is a significant difference in the cellularity between two sites in the body; A and B. The data are shown in Table \ref{cellularity}. We want to test the \textbf{null hypothesis} that the mean cellularity at site A is equal to the mean cellularity at site B. This is like saying:\\
855-
>>>>>>> gh-pages
820+
856821

857822
Mean cellularity at site A = mean cellularity at site B\\
858823

@@ -897,22 +862,15 @@ Click on the View data set button to check if the Difference column has been add
897862
\label{datasetWithDifferences}
898863
\end{figure}
899864

900-
<<<<<<< HEAD
901-
In the calculation of the difference between Ovarian column and Peritoneal column, we need to choose either one as our baseline; this will simply determine whether we calculate Peritnoeal-Ovarian or Ovarian-Peritoneal. The results of the paired t-test will be the same either way, but summary statistics such as the mean and confidence intervals will be either positive or negative depending on which column you choose as your baseline, and similarly the histogram with be either on the positive or negative scale (the overall shape will be identical but will be flipped on the vertical axis). In this example, the Ovarian column was used as the baseline, so the difference column calculated represents the calculation Peritoneal-Ovarian. \newpage
902-
=======
865+
903866
In the calculation of the difference between Site A and Site B column, we need to choose either one as our baseline; this will simply determine whether we calculate A-B or B-A. The results of the paired t-test will be the same either way, but summary statistics such as the mean and confidence intervals will be either positive or negative depending on which column you choose as your baseline, and similarly the histogram with be either on the positive or negative scale (the overall shape will be identical but will be flipped on the vertical axis). In this example, the A column was used as the baseline, so the difference column calculated represents the calculation B-A. \newpage
904-
>>>>>>> gh-pages
905867

906868

907869
One can then draw a histogram of the paired differences (see Figure \ref{histOfDifferences}):\\
908870
\begin{figure}
909871
<<echo=FALSE,fig.show='asis',fig.height=5,fig.width=10,warning=FALSE,message=FALSE>>=
910872
cell <- read.csv("data//Paired two-sample t-test.csv")
911-
<<<<<<< HEAD
912-
cell$Difference <- cell$Peritoneal - cell$Ovarian
913-
=======
914873
cell$Difference <- cell$B - cell$A
915-
>>>>>>> gh-pages
916874
hist(cell$Difference,col="grey",main="",xlab="Difference",ylab="frequency")
917875
@
918876
\caption{Histogram of cellularity data with default settings}
@@ -934,11 +892,8 @@ hist(cell$Difference,col="grey",breaks=5,main="",xlab="Difference",ylab="frequen
934892
\caption{Histogram with user-defined bins}
935893
\label{histWithMoreBins}
936894
\end{figure}
937-
<<<<<<< HEAD
938-
\textit{Note that the histogram will be flipped on the vertical axis if the difference is calculated as Ovarian - Peritoneal rather than Peritoneal - Ovarian, but this won't impact the end result of the test.}\newpage
939-
=======
895+
940896
\textit{Note that the histogram will be flipped on the vertical axis if the difference is calculated as B - A rather than A - B, but this won't impact the end result of the test.}\newpage
941-
>>>>>>> gh-pages
942897

943898

944899
If satisfied with the normality assumption, we can go ahead with the paired two-sample t-test (Figure \ref{doPairedTTest}).
@@ -950,11 +905,7 @@ If satisfied with the normality assumption, we can go ahead with the paired two-
950905
\end{figure}
951906

952907
<<>>=
953-
<<<<<<< HEAD
954-
t.test(cell$Peritoneal,cell$Ovarian,paired=TRUE)
955-
=======
956908
t.test(cell$B,cell$A,paired=TRUE)
957-
>>>>>>> gh-pages
958909
@
959910
The mean difference in cellularity between the two sites of disease was 19.14 units. The corresponding t-statistic is:
960911

@@ -963,11 +914,8 @@ t_{n-1} = t_{19} = \frac{\bar{X}_{A-B}}{s.e(\bar{X}_{A-B})}
963914
\end{equation}
964915

965916
Under the null hypothesis that there is no difference in the cellularities between the two sites of disease, we can see that the probability of observing such a large t-statistic is very small: the p-value is 0.0017. \\
966-
<<<<<<< HEAD
967-
This is a significant result (p $<$ 0.05), so there is \textbf{evidence of a difference} in the cellularity between the primary ovarian mass and peritoneal deposits in patients with advanced ovarian cancer.
968-
=======
917+
969918
This is a significant result (p $<$ 0.05), so there is \textbf{evidence of a difference} in the cellularity between Site A and Site B in patients with advanced cancer.
970-
>>>>>>> gh-pages
971919
\\
972920
\subsection{What to do if the normality assumption is unreasonable?}
973921

manual.pdf

342 KB
Binary file not shown.

0 commit comments

Comments
 (0)