Professional Documents
Culture Documents
Download textbook Clinical Trial Data Analysis With R And Sas Second Edition Chen ebook all chapter pdf
Download textbook Clinical Trial Data Analysis With R And Sas Second Edition Chen ebook all chapter pdf
https://textbookfull.com/product/analysis-of-correlated-data-
with-sas-and-r-mohamed-m-shoukri/
https://textbookfull.com/product/survival-analysis-with-interval-
censored-data-a-practical-approach-with-examples-in-r-sas-and-
bugs-1st-edition-kris-bogaerts/
https://textbookfull.com/product/analysis-of-clinical-trials-
using-sas-a-practical-guide-second-edition-alex-dmitrienko/
https://textbookfull.com/product/clinical-trial-optimization-
using-r-1st-edition-alex-dmitrienko/
Graphical Data Analysis with R Antony Unwin
https://textbookfull.com/product/graphical-data-analysis-with-r-
antony-unwin/
https://textbookfull.com/product/data-analysis-with-r-2nd-
edition-tony-fischetti/
https://textbookfull.com/product/applied-time-series-analysis-
with-r-second-edition-elliott/
https://textbookfull.com/product/step-by-step-programming-with-
base-sas-9-4-second-edition-sas-institute/
https://textbookfull.com/product/applied-meta-analysis-with-r-
and-stata-chapman-hall-crc-biostatistics-series-2nd-edition-chen/
Clinical Trial
Data Analysis
Using R and SAS
Second Edition
Editor-in-Chief
Shein-Chung Chow, Ph.D., Professor, Department of Biostatistics and Bioinformatics,
Duke University School of Medicine, Durham, North Carolina
Series Editors
Byron Jones, Biometrical Fellow, Statistical Methodology, Integrated Information Sciences,
Novartis Pharma AG, Basel, Switzerland
Jen-pei Liu, Professor, Division of Biometry, Department of Agronomy,
National Taiwan University, Taipei, Taiwan
Karl E. Peace, Georgia Cancer Coalition, Distinguished Cancer Scholar, Senior Research Scientist
and Professor of Biostatistics, Jiann-Ping Hsu College of Public Health,
Georgia Southern University, Statesboro, Georgia
Bruce W. Turnbull, Professor, School of Operations Research and Industrial Engineering,
Cornell University, Ithaca, New York
Published Titles
Adaptive Design Methods in Clinical Basic Statistics and Pharmaceutical
Trials, Second Edition Statistical Applications, Second Edition
Shein-Chung Chow and Mark Chang James E. De Muth
Adaptive Designs for Sequential Bayesian Adaptive Methods for
Treatment Allocation Clinical Trials
Alessandro Baldi Antognini Scott M. Berry, Bradley P. Carlin,
and Alessandra Giovagnoli J. Jack Lee, and Peter Muller
Adaptive Design Theory and Bayesian Analysis Made Simple:
Implementation Using SAS and R, An Excel GUI for WinBUGS
Second Edition Phil Woodward
Mark Chang Bayesian Designs for Phase I–II
Advanced Bayesian Methods for Clinical Trials
Medical Test Accuracy Ying Yuan, Hoang Q. Nguyen,
Lyle D. Broemeling and Peter F. Thall
Analyzing Longitudinal Clinical Trial Data: Bayesian Methods for Measures
A Practical Guide of Agreement
Craig Mallinckrodt and Ilya Lipkovich Lyle D. Broemeling
Applied Biclustering Methods for Big Bayesian Methods for Repeated Measures
and High-Dimensional Data Using R Lyle D. Broemeling
Adetayo Kasim, Ziv Shkedy, Bayesian Methods in Epidemiology
Sebastian Kaiser, Sepp Hochreiter, Lyle D. Broemeling
and Willem Talloen
Bayesian Methods in Health Economics
Applied Meta-Analysis with R Gianluca Baio
Ding-Geng (Din) Chen and Karl E. Peace
Bayesian Missing Data Problems: EM,
Applied Surrogate Endpoint Evaluation Data Augmentation and Noniterative
Methods with SAS and R Computation
Ariel Alonso, Theophile Bigirumurame, Ming T. Tan, Guo-Liang Tian,
Tomasz Burzykowski, Marc Buyse, and Kai Wang Ng
Geert Molenberghs, Leacky Muchene,
Nolen Joy Perualila, Ziv Shkedy,
and Wim Van der Elst
Published Titles
Harry Yang
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
This book contains information obtained from authentic and highly regarded sources. Reasonable
efforts have been made to publish reliable data and information, but the author and publisher 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
storage or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, please access
www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc.
(CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization
that provides licenses and registration for a variety of users. For organizations that have been granted
a photocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and
are used only for identification and explanation without intent to infringe.
Names: Chen, Ding-Geng. | Peace, Karl E., 1941- | Zhang, Pinggao. | Chen,
Ding-Geng. Clinical trial data analysis using R.
Title: Clinical trial data analysis using R and SAS.
Other titles: Clinical trial data analysis using R
Description: Second edition / Ding-Geng Chen, Karl E. Peace, Pinggao Zhang. |
Boca Raton : CRC Press, 2017. | “Major updates to include SAS
programs”--Preface. | Previous edition: Clinical trial data analysis using
R / Ding-Geng Chen, Karl E. Peace (Boca Raton, Florida : CRC Press, 2011).
Identifiers: LCCN 2016057399 | ISBN 9781498779524 (hardback)
Subjects: LCSH: Clinical trials--Statistical methods. | R (Computer program
language) | SAS (Computer program language)
Classification: LCC R853.C55 C43 2017 | DDC 610.72/7--dc23
LC record available at https://lccn.loc.gov/2016057399
To my parents and parents-in-law who value high education and hard work,
and to my wife, Ke, my son, John D. Chen, and my daughter, Jenny K. Chen,
for their love and support.
Ding-Geng(Din) Chen
To the memory of my late mother, Elsie Mae Cloud Peace, my late wife, Jiann-
Ping Hsu (JP), and to my son, Christopher K. Peace, daughter-in-law, Ashley
Hopkins Peace, granddaughter, Camden, and grandson, Henry. Memories of
my mom and wife JP continue to sustain me. My son, Chris, and his family
provide much joy and esteem.
Karl E. Peace
ix
Contents
1 Introduction to R 1
1.1 What is R? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Steps on Installing R and Updating R Packages . . . . . . . . 2
1.2.1 First Step: Install R Base System . . . . . . . . . . . . 3
1.2.2 Second Step: Installing and Updating R Packages . . . 3
1.2.3 Steps to Get Help and Documentation . . . . . . . . . 4
1.3 R for Clinical Trials . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 A Simple Simulated Clinical Trial . . . . . . . . . . . . . . . 7
1.4.1 Data Simulation . . . . . . . . . . . . . . . . . . . . . 7
1.4.1.1 R Functions . . . . . . . . . . . . . . . . . . . 7
1.4.1.2 Data Generation and Manipulation . . . . . 8
1.4.1.3 Basic R Graphics . . . . . . . . . . . . . . . . 10
1.4.2 Data Analysis . . . . . . . . . . . . . . . . . . . . . . . 13
1.5 Summary and Recommendations for Further Reading . . . . 15
1.6 Appendix: SAS Programs . . . . . . . . . . . . . . . . . . . . 15
xi
xii Contents
2.4.2 Objective . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.4.3 Plan of Study . . . . . . . . . . . . . . . . . . . . . . . 22
2.4.3.1 Study Population . . . . . . . . . . . . . . . 22
2.4.3.2 Study Design . . . . . . . . . . . . . . . . . . 22
2.4.3.3 Problem Management . . . . . . . . . . . . . 24
2.4.4 Statistical Analysis Section . . . . . . . . . . . . . . . 24
2.4.4.1 Study Objectives as Statistical Hypotheses . 24
2.4.4.2 Endpoints . . . . . . . . . . . . . . . . . . . 25
2.4.4.3 Statistical Methods . . . . . . . . . . . . . . 25
2.4.4.4 Statistical Monitoring Procedures . . . . . . 26
2.4.5 Statistical Design Considerations . . . . . . . . . . . . 27
2.4.6 Subset Analyses . . . . . . . . . . . . . . . . . . . . . 28
2.5 Concluding Remarks . . . . . . . . . . . . . . . . . . . . . . 29
Bibliography 363
Index 373
List of Figures
xix
xx List of Figures
8.1 Forest Plot for the Betablockers Trial with 95% CIs from Fixed-
Effects Meta-Analysis . . . . . . . . . . . . . . . . . . . . . . 225
8.2 Funnel Plot for the Betablocker Trial . . . . . . . . . . . . . . 226
8.3 Forest Plot for the Betablocker Trial with 95% CIs from
Random-Effects Meta-Analysis . . . . . . . . . . . . . . . . . 228
8.4 Forestplot with More Options . . . . . . . . . . . . . . . . . 229
8.5 Forestplot for Cochrane Data . . . . . . . . . . . . . . . . . 231
8.6 A Detailed Forest Plot for the Angina Trial with 95% CIs . . 234
8.7 Funnel Plot for the Angina Trial . . . . . . . . . . . . . . . . 234
10.1 Bootstrap Distribution for the Mean of the Individual Ratios 297
10.2 Bootstrap Distribution for the Ratio of the Means . . . . . . 298
10.3 QQ-Plot for the Ratio of the Means . . . . . . . . . . . . . . 299
10.4 The Concentration-by-Time for First Sequence and Second Pe-
riod. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
10.5 The Mean Concentration-by-Time for First Sequence and Sec-
ond Period . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
10.6 Bootstrap Distribution for the Mean of the Individual Ratios 312
10.7 Bootstrap Distribution for the Ratio of the Means . . . . . . 313
xxi
Preface for the Second Edition
Since the publication of the first edition of this book in 2011, we have received
extensive compliments on how well it was structured for use by clinical trial
statisticians and analysts in analyzing their own clinical trial data following the
detailed step-by-step illustrations using R. We have also received suggestions
and comments for further improvement among which is to add SAS to the new
edition. A feature of this second edition is to also illustrate data analyses using
the SAS system. Therefore, in this second edition, we have incorporated all
suggestions and comments from enthusiastic readers and corrected all errors
and typos in addition to including SAS programs for data analysis. The SAS
programs appear in the appendix of each chapter corresponding to the sections
where analyses using R were performed.
Another major update is to change the way data are loaded into R. In the
first edition, we used RODBC to read the dataset from an Excel book (named
as datR4CTDA.xlsx) where all data are stored. Many readers communicated
to us that they had difficulties in using RODBC. Therefore, in this edition, we
saved all the datasets into .csv (comma separated values) files and use the R
command read.csv to read the data into R. Readers can also use read.table
to read the data into R for analysis.
We have updated the chapters. In Chapter 3, we included the clinical
trial data analysis for correlated data using multivariate analysis of variance
(MANOVA) in Section 3.2.1.4 with R implementation of this MANOVA ap-
proach in Section 3.3.1.6. The associated SAS programs are included in an
appendix at the end of the chapter. In Chapter 4, we also included the clinical
trial data analysis for correlated data using multivariate analysis of covariance
(MANCOVA) in Section 4.3.1.3. The associated SAS programs are included
in an appendix at the end of the chapter.
In Chapter 5, the IntCox package is no longer supported, but can be ob-
tained from https://cran.r-project.org/web/packages/intcox/index.
html. So we kept Section 5.4.3 for the description of this method as well as the
R implementation in Section 5.5.2.4. However, we updated the analysis using
another R package of ictest to test treatment effect using semiparametric
estimation in Section 5.5.2.5. In addition, we updated the analysis using yet
another R package for interval-censored data (i.e., interval) to fit Turnbull’s
nonparametric estimator in Section 5.5.2.2. The SAS programs for all the
analyses are included in an appendix at the end of this chapter.
In Chapter 6, we updated the analysis using lmerTest. In analysis of
xxiii
xxiv Preface for the Second Edition
With the exception of two chapters, our first book: “Clinical Trial Methodol-
ogy” (Peace and Chen (2010)) contained no statistical analysis software code
for the analysis results presented therein. In this book we provide a thor-
ough presentation of biostatistical analyses of clinical trial data with detailed
step-by-step illustrations on their implementation using R. In each chapter, ex-
amples of clinical trials based on the authors’ actual experience in many areas
of clinical drug development are presented. After understanding the applica-
tion, various biostatistical methods appropriate for analyzing data from the
clinical trials are identified. Then analysis code is developed using appropri-
ate R packages and functions to analyze the data. Analysis code development
and results are presented in a stepwise fashion. This stepwise approach should
enable readers to follow the logic and gain an understanding of the analysis
methods and the R implementation so that they may use R to analyze their
own clinical trial data.
Based on their experience in biostatistical research and working in clinical
development, the authors understand that there are gaps between developed
statistical methods and applications of statistical methods by students and
practitioners. This book is intended to fill this gap by illustrating the im-
plementation of statistical methods using R applied to real clinical trial data
following a step-by-step presentation style.
With this style, the book is suitable as a text for a course in clinical trial
data analysis at the graduate level (Master’s or Doctorate’s), particularly for
students seeking degrees in statistics or biostatistics. In addition, the book
should be a valuable reference for self-study and a learning tool for clinical
trial practitioners and biostatisticians in public health, medical research uni-
versities, governmental agencies and the pharmaceutical industry, particularly
those with little or no experience in using R.
R has become widely used in statistical modeling and computing since its
creation in the mid 1990s and it is now an integrated and essential software
for statistical analyses. Becoming familiar with R is then an imperative for the
next generation of statistical data analysts. In Chapter 1, we present a basic
introduction to the R system, where to get R, how to install R and how to
upgrade R packages. Readers who are already familiar with R may skip this
chapter and go directly to any of the remaining chapters.
In Chapter 2, we provide an overview of the phases and objectives of
clinical trials as well as biostatistical aspects of clinical trials.
xxvii
xxviii Preface for the First Edition
Yet how long ago it was! If the little sister had lived, she
might now have been an anxious-looking mother herself,
with grown-up children. And Frank—baby Frank—what had
become of him? Dead, probably,—yes, surely he was dead,
and better dead. But Michael heaved a sigh as he thought of
his brother. He had not been so moved for years. Certainly
the visit of that little maiden had exercised a softening
influence upon him. How long it was since he had seen his
brother!
"I'm glad to hear it, sir. Look round, and welcome. Take
your time over it. There's a new lot of books here that I've
purchased lately. Maybe you'd fancy some of them."
CHAPTER III
LITTLE MARGERY'S LOSS
"Professor Lavers."
"I never 'eard of 'im," she said again. "Is 'e ill, then? What's
the matter with 'im?"
About noon the bell over his door tinkled, and looking up he
saw with pleasure that little Margery was entering the shop,
accompanied by a servant maid, who carried several small
parcels.
"It was no matter, miss. You need not have troubled about
it. And do you like the book as much as you thought you
would?"
"Oh yes; the pictures are lovely. But it is such a pity: we
can't have any nice plays now; we're in dreadful trouble at
home. My father is very ill, and Noel has been sent away to
Aunt Susie's because he would make a noise, and I'm all
alone, and I don't like it."
"I don't think so," said the little girl, with unshed tears in
her eyes as she lifted them to his, "for mother was crying
this morning, and she would not have cried if father had
been better. We're quite in the Slough of Despond at home,
aren't we, Jane?"
"He's no better," she said in a low tone, "and I'm sore afraid
he'll never be no better."
"Had you ever a little brother or sister to play with you, Mr.
Betts?—when you were a little boy, I mean. Of course it's a
very long time ago."
"Well, yes, miss, I had a little brother once; but, as you say,
it's a long time ago."
"Do you live here all by yourself, Mr. Betts? It's very lonely
for you, isn't it? But I suppose people don't mind that when
they get old."
He made no reply, except to bid her good day; and the next
minute the green cloak and long golden locks had floated on
the wind round the corner, and he was alone once more.
CHAPTER IV
MICHAEL MAKES A GOOD BARGAIN
"Well, yes, she cried a great deal. She was fond of her
father, was Miss Margery. And it upset her to see her
mother crying. But she got over it sooner than you would
think. Children quickly forget their troubles. If you could
have seen her and her little brother playing together on the
day their father was buried, you'd have been surprised. But,
there, it wasn't to be expected they could miss their father,
for they saw so little of him. He was always shut up in his
study with his books. A regular bookworm he was. You
couldn't call him nothing else."
"Then I may tell Mrs. Lavers that you will come to-morrow
morning at ten o'clock?" said the maid as she turned to go.
Michael assented. He was not surprised that Mrs. Lavers
should send for him. It frequently happened that his
attendance was requested at houses where there had been
a recent bereavement, necessitating considerable changes.
The professor's widow doubtless wished to dispose of some
or all of her husband's books.
"I sent for you, Mr. Betts," she said, "because I am obliged
to part with my husband's books. I have to move into a
very small house, into which I cannot take them. And
indeed for other reasons I feel it my duty to sell them. I
have been advised to show them to you; I have been told
that I may trust you to give me a fair price for them."
"I can give you as good a price for them as any one in the
trade, madam," replied Michael promptly. "Though I say it
myself, it's true that I understand the second-hand book
market as well as any one can. Do I understand that you
wish to part with all the books in this room?"
"Yes, all of them," said the lady, with a sigh; "I have taken
away such as I want to retain."
"' I've no doubt he did, madam; but buying and selling are
different things. I know what I may expect to make by
these books, and I assure you it would not pay me to give
more."
With that he bade her good day, and went back to his shop.
He did not see Mrs. Lavers ere he set about his task of
dismantling the bookshelves. Doubtless she felt it a cruel
necessity which forced her to dispose of her husband's
books. It was little wonder if she shrank from the pain of
seeing them carried out of the house, and therefore kept
out of the way.
"Oh, where did you find it?" exclaimed the child. "Noel and I
have wanted it for days, and nurse said she did not know
where it was."
"I am going to take them away, missy. You see, your poor
father won't want them any more, and they'd only be a
trouble to your mother, especially as she is leaving this
house, so I am going to take them to my shop."
"Come, come, Miss Margery, this won't do," she said, not
unkindly, though in a tone of remonstrance, as she bent
over the weeping child. "You mustn't give way like this.
Come, come now."
And taking the child in her arms, she carried her from the
room.
He could not forget the child. He sat up late that night, still
busied with the books, for it was not easy to find room for
them all in the limited space which his premises afforded.
Margery's words kept ringing in his ears—"I should think
you would cross soon, Mr. Betts, for you are so very old.
You are older than my father was, aren't you?"
The child was right, though how she knew he could not
imagine. Michael had seen the professor's age recorded in
the newspaper—he was fifty-one, whereas Michael was fifty-
nine. But what of that?
No one but a child would think him old. Many men lived to
be eighty, and some even to ninety. And he was so well and
strong. No, he need not think yet of that dark, chill river of
death, the very thought of which made him shiver. But he
reflected, and the thought caused him to breathe more than
one heavy sigh, that when his time came to pass that river
there would be no one to go with him to the brink, no loving
voice to bid him farewell, no child to mourn for him as little
Margery mourned for her father. There had been no time in
his hard-working, self-centred, business absorbed life to
cultivate love; but Michael Betts was beginning to feel that
its absence made a sore and woeful lack in his life.
CHAPTER V
UNRIGHTEOUS GAIN
ON the following day, Michael was still busy with the late
professor's books. As he examined them more fully, he was
disposed to congratulate himself on the bargain he had
made. There were several valuable old books in the lot, and
others which, if less aged, were much in request. Michael
foresaw that he would make money by them. It was true his
returns would come in slowly; but nevertheless, he must in
time gain a handsome profit on the sum he had expended.
"I'll take them with me, if you will just put a piece of paper
round them," the gentleman said. "But, stay what is this?"
But how did the notes come to be within the old book? Who
had put them there? Had they belonged to Professor
Lavers?