First edition published 2015
Second edition published 2024
by CRC Press
2385 NW Executive Center Drive, Suite 320, Boca Raton FL 33431
and by CRC Press
4 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN
CRC Press is an imprint of Taylor & Francis Group, LLC
© 2024 Taylor & Francis Group, LLC
Reasonable efforts have been made to publish reliable data and information, but the author and pub-
lisher cannot assume responsibility for the validity of all materials or the consequences of their use.
The authors and publishers have attempted to trace the copyright holders of all material reproduced
in this publication and apologize to copyright holders if permission to publish in this form has not
been obtained. If any copyright material has not been acknowledged please write and let us know so
we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or
hereafter invented, including photocopying, microfilming, and recording, or in any information stor-
age or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.copyright.com
or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,
978-750-8400. For works that are not available on CCC please contact
Trademark notice: Product or corporate names may be trademarks or registered trademarks and are
used only for identification and explanation without intent to infringe.
ISBN: 978-0-367-65135-0 (hbk)
ISBN: 978-1-032-75197-9 (pbk)
ISBN: 978-1-003-03961-7 (ebk)
DOI: 10.1201/9781003039617
Typeset in CMR10
by KnowledgeWorks Global Ltd.
Publisher’s note: This book has been prepared from camera-ready copy provided by the authors.
,Contents
Preface xiii
Preface from the First Edition xv
1 Introduction 1
1.1 Data and Notation . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.1 Data Types in R . . . . . . . . . . . . . . . . . . . . . 2
1.1.2 Vector and Matrix Notation . . . . . . . . . . . . . . . 3
1.1.3 Data Frames . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.4 Ranks . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2 Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Monte Carlo Simulation . . . . . . . . . . . . . . . . . . . . . 11
1.3.1 Estimates of Center: Sample Mean and Sample Median 13
1.4 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.4.1 Single Line Functions . . . . . . . . . . . . . . . . . . 17
1.4.2 Level and Power of a Statistical Test . . . . . . . . . . 17
1.4.3 Functions . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.5 Randomization . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.6 Density Estimation . . . . . . . . . . . . . . . . . . . . . . . 24
1.6.1 Some Details . . . . . . . . . . . . . . . . . . . . . . . 26
1.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2 One-Sample Problems 33
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2 One-Sample Proportion Problems . . . . . . . . . . . . . . . 33
2.3 Sign Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.3.1 Power Simulation . . . . . . . . . . . . . . . . . . . . . 37
2.4 Signed-Rank Wilcoxon . . . . . . . . . . . . . . . . . . . . . 39
2.4.1 Estimation and Confidence Intervals . . . . . . . . . . 40
2.4.2 Computation in R . . . . . . . . . . . . . . . . . . . . 42
2.4.3 Density Estimation Revisited . . . . . . . . . . . . . . 44
2.5 Adjustments for Ties . . . . . . . . . . . . . . . . . . . . . . 45
2.5.1 Sign Test . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.5.2 Signed-Rank Wilcoxon . . . . . . . . . . . . . . . . . . 47
2.6 Confidence Interval Based Estimates of Standard Errors . . . 48
2.7 Asymptotic Tests . . . . . . . . . . . . . . . . . . . . . . . . 52
, viii Contents
2.7.1 Signed-Rank Wilcoxon Test . . . . . . . . . . . . . . . 53
2.7.2 Sign Test . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.8 Bootstrap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.8.1 Percentile Bootstrap Confidence Intervals . . . . . . . 57
2.8.2 Bootstrap Tests of Hypotheses . . . . . . . . . . . . . 58
2.9 Robustness . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.10 Power and Sample Size Determination . . . . . . . . . . . . . 63
2.10.1 Power of One-Sample Rank-Based Tests . . . . . . . . 63
2.10.2 Sample Size Determination . . . . . . . . . . . . . . . 66
2.10.3 Randomized Paired Design . . . . . . . . . . . . . . . 68
2.10.4 Sign Test . . . . . . . . . . . . . . . . . . . . . . . . . 70
2.10.5 Sample Size Determination for Estimation . . . . . . . 71
2.11 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3 Two-Sample Problems 79
3.1 Introductory Example . . . . . . . . . . . . . . . . . . . . . . 79
3.2 Rank-Based Analyses . . . . . . . . . . . . . . . . . . . . . . 81
3.2.1 Wilcoxon Test for Stochastic Ordering of Alternatives 81
3.2.2 Analyses for a Shift in Location . . . . . . . . . . . . . 84
3.2.3 Analyses Based on General Score Functions . . . . . . 89
3.2.4 Linear Regression Model . . . . . . . . . . . . . . . . . 91
3.3 Sign Scores Two-Sample Analysis . . . . . . . . . . . . . . . 94
3.3.1 Mood’s Median Test . . . . . . . . . . . . . . . . . . . 94
3.3.2 Estimation of the Shift in Location . . . . . . . . . . . 98
3.4 Adjustments for Ties . . . . . . . . . . . . . . . . . . . . . . 100
3.5 Scale Problem . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3.6 Placement Test for the Behrens–Fisher Problem . . . . . . . 106
3.6.1 Estimation of a Shift Parameter, ∆ . . . . . . . . . . . 109
3.6.2 Classical Behrens–Fisher Model . . . . . . . . . . . . . 110
3.7 Efficiency and Optimal Scores . . . . . . . . . . . . . . . . . 114
3.7.1 Efficiency . . . . . . . . . . . . . . . . . . . . . . . . . 115
3.8 Adaptive Rank Scores Tests . . . . . . . . . . . . . . . . . . 120
3.9 Power and Sample Size Determination for Rank-Based Tests 123
3.9.1 Power of Rank-Based Tests . . . . . . . . . . . . . . . 124
3.9.2 Sample Size Determination . . . . . . . . . . . . . . . 128
3.10 k-Nearest Neighbors and Cross-Validation . . . . . . . . . . 134
3.11 Kaplan–Meier and Log-Rank Test . . . . . . . . . . . . . . . 139
3.11.1 Gehan’s Test . . . . . . . . . . . . . . . . . . . . . . . 144
3.11.2 Composite Outcomes . . . . . . . . . . . . . . . . . . . 145
3.12 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147