Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
Introduction to Robust
Estimation and HypothesisTesting3rd Edition
Rand Wilcox
AMSTERDAM • BOSTON • HEIDELBERG • LONDON
NEW YORK • OXFORD • PARIS • SAN DIEGO
SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO
Academic Press is an imprint ofElsevier
Contents
Preface *'*
Chapter 1 Introduction 1
1.1 Problems with Assuming Normality 1
1.2 Transformations 5
1.3 The Influence Curve 7
1.4 The Central Limit Theorem 8
1.5 Is the ANOVA F Robust? •9
1.6 Regression 10
1.7 More Remarks 11
1.8 Using the Computer: R 11
1.9 Some Data Management Issues 13
1.9.1 Eliminating Missing Values 22
Chapter 2 A Foundation for Robust Methods 23
2.1 Basic Tools for Judging Robustness 23
2.1.1 Qualitative Robustness 24
2.1.2 Infinitesimal Robustness 27
2.1.3 Quantitative Robustness 28
2.2 Some Measures of Location and Their Influence Function 29
2.2.1 Quantiles 29
2.2.2 The Winsorized Mean 30
2.2.3 The Trimmed Mean 32
2.2.4 M-Measures of Location 32
2.2.5 R-Measures of Location 35
2.3 Measures of Scale 36
2.4 Scale Equivariant M-Measures of Location 38
2.5 Winsorized Expected Values 39
Chapter 3 Estimating Measures ofLocation and Scale 43
3.1 A Bootstrap Estimate of a Standard Error 43
3.1.1 R Function bootse 45
v
Contents
3.2 Density Estimators 46
3.2.1 Normal Kernel 46
3.2.2 Rosenblatt's Shifted Histogram 47
3.2.3 The Expected Frequency Curve 47
3.2.4 An Adaptive Kernel Estimator 48
3.2.5 R Functions skerd, kerden, kdplot, rdplot, akerd, and splot 49
3.3 The Sample Trimmed Mean 54
3.3.1 R Functions mean, tmean, and Hoc 57
3.3.2 Estimating the Standard Error of the Trimmed Mean 57
3.3.3 Estimating the Standard Error of the Sample Winsorized Mean..
62
3.3.4 R Functions winmean, winvar, trimse, and winse 62
3.3.5 Estimating the Standard Error of the Sample Median, M 62
3.3.6 R Function msmedse 63
3.4 The Finite Sample Breakdown Point 63
3.5 Estimating Quantiles 64
3.5.1 Estimating the Standard Error of the Sample Quantile 65
3.5.2 R Function qse 66
3.5.3 The Maritz-Jarrett Estimate of the Standard Error of xq 67
3.5.4 R Function mjse 68
3.5.5 The Harrell-Davis Estimator 68
3.5.6 R Function hdv
69
3.5.7 A Bootstrap Estimate of the Standard Error of 0q 69
3.5.8 R Function hdseb 70
3.6 An M-Estimator of Location 70
3.6.1 R Function mad 75
3.6.2 Computing an M-estimator of Location 75
3.6.3 R Functions mest 77
3.6.4 Estimating the Standard Error of the M-estimator 78
3.6.5 R Function mestse 80
3.6.6 A Bootstrap Estimate of the Standard Error of j±m 80
3.6.7 R Function mestseb 81
3.7 One-Step M-estimator 82
3.7.1 R Function onestep 83
3.8 W-estimators 83
3.8.1 Tau Measure of Location 84
3.8.2 R Function tauloc 85
3.8.3 Zuo's Weighted Estimator 85
3.9 The Hodges-Lehmann Estimator 85
3.10 Skipped Estimators 85
3.10.1 R Functions mom and bmean 86
3.11 Some Comparisons of the Location Estimators 86
vi
Contents
3.12 More Measures of Scale 89
3.12.1 The Biweight Midvariance 90
3.12.2 R Function bivar 92
3.12.3 The Percentage Bend Midvariance and tau Measure of
Variation 92
3.12.4 R Functions pbvar, tauvar 94
3.12.5 The Interquartile Range 95
3.12.6 R Function idealf 96
3.13 Some Outlier Detection Methods 96
3.13.1 Rules Based on Means and Variances 96
3.13.2 A Method Based on the Interquartile Range 96
3.13.3 Carling's Modification 97
3.13.4 A MAD-Median Rule 97
3.13.5 R Functions outbox, out, and boxplot 98
3.13.6 Skewness and the Boxplot Rule 99
3.13.7 R Function adjboxout 100
3.14 Exercises 100
Chapter 4 Confidence Intervals in the One-Sample Case 103
4.1 Problems when Working with Means 103
4.2 The g-and-h Distribution,
107
4.2.1 R Functions ghdist and rmul ' 110
4.3 Inferences About the Trimmed and Winsorized Means Ill
4.3.1 R Functions trimci and winci 114
4.4 Basic Bootstrap Methods 115
4.4.1 The Percentile Bootstrap Method 115
4.4.2 R Function onesampb 116
4.4.3 Bootstrap-t Method : 117
4.4.4 Bootstrap Methods when Using a Trimmed Mean 118
4.4.5 Singh's Modification 123
4.4.6 R Functions trimpb and trimcibt 123
4.5 Inferences About M-Estimators 124
4.5.1 R Functions mestci and momci 126
4.6 Confidence Intervals for Quantiles 126
4.6.1 Beware of Tied Values when Using the Median 129
4.6.2 Alternative Method for the Median 130
4.6.3 R Functions qmjci, hdci, sint, sintv2, qci, and qint 131
4.7 Empirical Likelihood 132
4.7.1 Bartlett Corrected Empirical Likelihood 133
4.8 Concluding Remarks 135
4.9 Exercises 135
vii
Contents
Chapter 5 Comparing Two Croups 137
5.1 The Shift Function 138
5.1.1 The Kolmogorov-Smirnov Test 141
5.1.2 R Functions ks, kssig, kswsig, and kstiesig 144
5.1.3 The S Band and W Band for the Shift Function 146
5.1.4 R Functions sband and wband 147
5.1.5 Confidence Band for the Deciles Only 150
5.1.6 R Function shifthd 151
5.1.7 R Functions g2plot and splotg2 153
5.2 Student's Mest 153
5.3 Comparing Medians and Other Trimmed Means 157
5.3.1 R Function yuen 160
5.3.2 A Bootstrap-t Method for Comparing Trimmed Means 161
5.3.3 R Functions yuenbt and yhbt 163
5.3.4 Measuring Effect Size: Robust Analogs of Cohen's d 166
5.3.5 R Functions akp.effect, yuenv2, and ees.ci 169
5.3.6 Comments on Measuring Effect Size 170
5.4 Inferences Based on a Percentile Bootstrap Method 170
5.4.1 Comparing M-Estimators 171
5.4.2 Comparing TrimmedMeans and Medians 172
5.4.3 R Functions trimpb2, pb2gen, m2ci, and medpb2 173
5.5 Comparing Measures of Scale 174
5.5.1 Comparing Variances 174
5.5.2 R Function comvar2 175
5.5.3 Comparing Biweight Midvariances 176
5.5.4 R Function b2ci 176
5.6 Permutation Tests 176
5.6.1 R Function permg 177
5.7 Inferences About a Probabilistic Measure of Effect Size 177
5.7.1 R Function mee 179
5.7.2 The Cliff and Bruner-Munzel Methods: Handling Tied Values.. 180
5.7.3 R Functions cid, cidv2, bmp, and wmwloc 184
5.8 Comparing Two Independent Binomials 186
5.8.1 Storer-Kim Method 187
5.8.2 Beal's Method 188
5.8.3 KMS Method 189
5.8.4 R Functions twobinom, twobici, bi2KMS, bi2KMSv2, and
bi2CR 189
5.8.5 Comparing Discrete Distributions: R Functions binband
and disc2com 190
via
Contents
5.9 Comparing Dependent Groups 190
5.9.1 A Shift Function for Dependent Groups 190
5.9.2 R Function lband 192
5.9.3 Comparing Deciles 192
5.9.4 R Function shiftdhd 193
5.9.5 Comparing Trimmed Means 195
5.9.6 R Functions yuend and yuendv2 197
5.9.7 A Bootstrap-t Method for Marginal Trimmed Means 198
5.9.8 R Function ydbt 198
5.9.9 Inferences about the Distribution of Difference Scores 199
5.9.10 R Functions loc2dif and 12drmci 200
5.9.11 Percentile Bootstrap: Comparing Medians, M-Estimators
and Other Measures of Location and Scale 201
5.9.12 R Function bootdpci 202
5.9.13 Handling Missing Values 203
5.9.14 R Functions rm2miss and rmmismcp 207
5.9.15 Comparing Variances 208
5.9.16 The Sign Test and Inferences about the Binomial Distribution... 208
5.9.17 R Functions binomci and acbinomci 211
5.10 Exercises 212
Chapter 6 Some Multivariate Methods 215
6.1 Generalized Variance 215
6.2 Depth 216
6.2.1 Mahalanobis Depth 216
6.2.2 Halfspace Depth 216
6.2.3 Computing Halfspace Depth 218
6.2.4 R Functions depth2, depth, fdepth, fdepthv2, and unidepth 221
6.2.5 Projection Depth 222
6.2.6 R functions pdis and pdisMC 223
6.2.7 Other Measures of Depth 223
6.2.8 R Function zdepth 224
6.3 Some Affine Equivariant Estimators 224
6.3.1 Minimum Volume Ellipsoid Estimator 225
6.3.2 The Minimum Covariance Determinant Estimator 226
6.3.3 S-Estimators and Constrained M-Estimators 227
6.3.4 R Function tbs 228
6.3.5 Donoho-Gasko Generalization of a Trimmed Mean 228
6.3.6 R Functions dmean and dcov 229
6.3.7 The Stahel-Donoho W-Estimator 230
ix
Contents
6.3.8 R Function sdwe 231
6.3.9 Median Ball Algorithm 231
6.3.10 R Function rmba 232
6.3.11 OGK Estimator 232
6.3.12 R Function ogk 233
6.3.13 An M-Estimator 234
6.3.14 R Function MARest 234
6.4 Multivariate Outlier Detection Methods 235
6.4.1 ARelplot 236
6.4.2 R Function relplot 23 8
6.4.3 The MVE Method 239
6.4.4 The MCD Method 239
6.4.5 R Functions covmve and covmcd 239
6.4.6 R function out 240
6.4.7 The MGV Method 241
6.4.8 R Function outmgv 243
6.4.9 A Projection Method 244
6.4.10 R functions outpro and out3d 246
6.4.11 Outlier Identification in High Dimensions 247
6.4.12 R Function outproad and outmgvad 247
6.4.13 Approaches Based on Geometric Quantiles 248
6.4.14 Comments on Choosing a Method 248
6.5 A Skipped Estimator of Location and Scatter 250
6.5.1 R Functions smean, wmcd, wmve, mgvmean, Llmedcen,
spat, mgvcov, skip, skipcov, and dcov 252
6.6 Robust Generalized Variance 254
6.6.1 R Function gvarg 255
6.7 Inference in the One-Sample Case 2556.7.1 Inferences Based on the OP Measure of Location 255
6.7.2 Extension of Hotelling's T2 to Trimmed Means 256
6.7.3 R Functions smeancrv2 and hotell.tr 257
6.7.4 Inferences Based on the MGV Estimator 259
6.7.5 R Function smgvcr 259
6.8 Two-Sample Case 2596.8.1 R Functions smean2, smean2v2, matsplit, and mat2grp 260
6.8.2 Comparing Robust Generalized Variances 262
6.8.3 R function gvar2g 262
6.9 Multivariate Density Estimators 262
6.10 A Two-Sample, Projection-Type Extension of the
Wilcoxon-Mann-Whitney Test 263
6.10.1 R functions mulwmw and mulwmwv2 265
x
Contents
6.11 A Relative Depth Analog of the Wilcoxon-Mann-Whitney Test 267
6.11.1 R function mwmw 268
6.12 Comparisons Based on Depth 269
6.12.1 R Functions lsqs3 and depthg2 272
6.13 Comparing Dependent Groups Based on All Pairwise Differences 275
6.13.1 R Function dfried 277
6.14 Robust Principal Components Analysis 277
6.14.1 R Functions prcomp and regpca 279
6.14.2 Maronna's Method 279
6.14.3 The SPCA Method 280
6.14.4 Method HRVB 280
6.14.5 Method OP 281
6.14.6 Method PPCA 281
6.14.7 R Functions outpca, robpca, robpcaS, SPCA, Ppca, and
Ppca.summary 282
6.14.8 Comments on Choosing the Number of Components 283
6.15 Cluster Analysis 287
6.15.1 R Functions Kmeans, kmeans.grp, TKmeans, and
TKmeans.grp 288
6.16 Exercises 288
Chapter 7 One-Way and Higher Designs for Independent Croups 291
7.1 Trimmed Means and a One-Way Design 292
7.1.1 A Welch-Type Procedure and a Robust Measure of Effect Size.. 293
7.1.2 R Functions tlway, tlwayv2, esmcp, fac21ist, and tlwayF 295
7.1.3 A Generalization of Box's Method 298
7.1.4 R Function boxlway 299
7.1.5 Comparing Medians 300
7.1.6 R Function medlway 301
7.1.7 A Bootstrap-t method 301
7.1.8 R Functions tlwaybt and btrim 302
7.1.9 Percentile Bootstrap Methods 304
7.2 Two-Way Designs and Trimmed Means 304
7.2.1 R Functions t2way 308
7.2.2 Comparing Medians 310
7.2.3 R Function med2way 311
7.3 ThreesWay Designs and Trimmed Means 311
7.3.1 R Functions t3way and fac21ist 313
7.4 Multiple Comparisons Based on Medians and Other Trimmed Means ..316
7.4.1 An Extension of Yuen's Method to Trimmed Means 317
7.4.2 R Function lincon 319
xi
Contents
7.4.3 Multiple Comparisons for Two-way and Three-Way
Designs 322
7.4.4 R Functions mcp2atm, mcp2med, mcp3atm, mcp3med,
con2way, and con3way 323
7.4.5 A Bootstrap-t Procedure 325
7.4.6 R Functions linconb, bbtrim, and bbbtrim 327
7.4.7 Percentile Bootstrap Methods for Comparing Medians and
Other Trimmed Means 329
7.4.8 R Functions tmcppb, bbmcppb, bbbmcppb, medpb,
med2mcp, med3mcp, and mcppb20 331
7.4.9 Judging Sample Sizes 333
7.4.10 R Function hochberg 334
7.4.11 Explanatory Measure of Effect Size 335
7.4.12 R Functions ESmainMCP and eslmcp 335
7.5 A Random Effects Model for Trimmed Means 336
7.5.1 A Winsorized Intraclass Correlation 338
7.5.2 R Function rananova 339
7.6 Global Tests Based on M-Measures of Location 340
7.6.1 R Functions blway and pbadepth 343
7.6.2 M-estimators and Multiple Comparisons 344
7.6.3 R Functions linconm and pbmcp 347
7.6.4 M-Estimators and the Random Effects Model 348
7.6.5 Other Methods for One-Way Designs 348
7.7 M-Measures of Location and a Two-Way Design 348
7.7.1 R Functions pbad2way and mcp2a 351
7.8 Ranked-Based Methods for a One-Way Design 351
7.8.1 The Rust-Fligner Method 352
7.8.2 R Function rfanova 353
7.8.3 A Heteroscedastic Rank-Based Method that Allows
Tied Values 354
7.8.4 R Function bdm 354
7.8.5 Inferences about a Probabilistic Measure of Effect Size 356
7.8.6 R Functions cidmulv2, wmwaov and cidM 358
7.9 A Rank-Based Method for a Two-Way Design 359
7.9.1 R Function bdm2way 361
7.9.2 The Patel-Hoel Approach to Interactions 361
7.9.3 R Function rimul 362
7.10 MANOVA Based on Trimmed Means 363
7.10.1 R Functions MULtr.anova, MULAOVp, bw21ist, and
YYmanova 365
7.10.2 Linear Contrasts 367
xii
Contents
7.10.3 R Functions linconMpb, linconSpb, YYmcp, fac2Mlist,and fac2BBMlist 369
7.11 Nested Designs 371
7.11.1 R Functions anova.nestA, mcp.nestA, and anova.nestAP 374
7.12 Exercises 374
Chapter 8 Comparing Multiple Dependent Croups 379
8.1 Comparing Trimmed Means 379
8.1.1 Omnibus Test Based on the Trimmed Means of the
Marginal Distributions 380
8.1.2 R Function rmanova 380
8.1.3 Pairwise Comparisons and Linear Contrasts Based on
Trimmed Means 381
8.1.4 Linear Contrasts Based on the Marginal Random Variables 384
8.1.5 R Functionrmmcp and rmmismcp 385
8.1.6 Judging the Sample Size 386
8.1.7 R Functions stein1 .tr and stein2.tr 387
8.2 Bootstrap Methods Based on Marginal Distributions 387
8.2.1 Comparing Trimmed Means 387
8.2.2 R Function rmanovab 388
8.2.3 Multiple Comparisons Based on Trimmed Means 388
8.2.4 R Functions pairdepb and bptd 390
8.2.5 Percentile Bootstrap Methods 392
8.2.6 R Functions bdlway and ddep 394
8.2.7 Multiple Comparisons Using M-estimators or SkippedEstimators 395
8.2.8 R Functions lindm and mcpOV 397
8.3 Bootstrap Methods Based on Difference Scores 398
8.3.1 R Function rmdzero 400
8.3.2 Multiple Comparisons 400
8.3.3 R Functions rmmcppb, wmcppb, dmedpb, and lindepbt 402
8.4 Comments on which Method to Use 404
8.5 Some Rank-Based Methods 406
8.5.1 R Functions apanova and bprm 408
8.6 Between-by-Within and Within-by-Within Designs 408
8.6.1 Analyzing a Between-by-Within Design Based on
Trimmed Means 408
8.6.2 R Functions bwtrim and tsplit 410
8.6.3 Data Management: R Function bw21ist 412
8.6.4 Bootstrap-t Method for a Between-by-Within Design 413
8.6.5 R Functions bwtrimbt and tsplitbt 414
xiii
Contents
8.6.6 Percentile Bootstrap Methods for a Between-by-WithinDesign 414
8.6.7 R Functions sppba, sppbb, and sppbi 417
8.6.8 Multiple Comparisons 418
8.6.9 R Functions bwmcp, bwamcp, bwbmcp, bwimcp, spmcpa,
spmcpb, and spmcpi 421
8.6.10 Within-by-Within Designs 422
8.6.11 R Functions wwtrim, wwtrimbt, wwmcppb, and wwmcpbt 423
8.6.12 A Rank-Based Approach 423
8.6.13 R Function bwrank 427
8.6.14 Rank-Based Multiple Comparisons 429
8.6.15 R Function bwrmcp 429
8.6.16 Multiple Comparisons when Using a Patel-Hoel Approachto Interactions 429
8.6.17 R Function sisplit 431
8.7 Some Rank-Based Multivariate Methods 431
8.7.1 The Munzel-Brunner Method 431
8.7.2 R Function mulrank 433
8.7.3 The Choi-Marden Multivariate Rank Test 434
8.7.4 R Function cmanova 435
8.8 Three-Way Designs 436
8.8.1 Global Tests Based on Trimmed Means 436
8.8.2 R Functions bbwtrim, bwwtrim, wwwtrim, bbwtrimbt,
bwwtrimbt, and wwwtrimbt 437
8.8.3 Data Management: R Functions bw21ist and bbw21ist 437
8.8.4 Multiple Comparisons 438
8.8.5 R Function rm3mcp 439
8.8.6 R Functions bbwmcp, bwwmcp, bbwmcppb, bwwmcppb,and wwwmcppb 439
8.9 Exercises 440
Chapter 9 Correlation and Tests ofIndependence 447
9.1 Problems with the Product Moment Correlation 441
9.1.1 Features of Data that Affect r and T 444
9.1.2 Heteroscedasticity and the Classic Test that p = 0 445
9.2 Two Types of Robust Correlations 446
9.3 Some Type M-Measures of Correlation 446
9.3.1 The Percentage Bend Correlation 446
9.3.2 A Test of Independence Based on Ppb 447
9.3.3 R Function pbcor 449
9.3.4 A Test of Zero Correlation among p Random Variables 449
xiV
Contents
9.3.5 R Function pball 451
9.3.6 The Winsorized Correlation 452
9.3.7 R Functions wincor and winall 453
9.3.8 The Biweight Midcovariance 454
9.3.9 R Functions bicov and bicovm 455
9.3.10 Kendall's tau 456
9.3.11 Spearman's rho 457
9.3.12 R Functions tau, spear, cor, and taureg 457
9.3.13 Heteroscedastic Tests of Zero Correlation 458
9.3.14 R Functions corb, pcorb, and pcorhc4 459
9.4 Some Type O Correlations 460
9.4.1 MVE and MCD Correlations 460
9.4.2 Skipped Measures of Correlation 460
9.4.3 The OP Correlation 461
9.4.4 Inferences Based on Multiple Skipped Correlations 461
9.4.5 R Functions scor and mscor 463
9.5 A Test of Independence Sensitive to Curvature 464
9.5.1 R Functions indt, indtall, and medind 466
9.6 Comparing Correlations: Independent Case 467
9.6.1 Comparing Pearson Correlations 467
9.6.2 Comparing Robust Correlations 468
9.6.3 R Functions twopcor and twocor 468
9.7 Exercises 468
Chapter 10 Robust Regression 471
10.1 Problems with Ordinary Least Squares 472
10.1.1 Computing Confidence Intervals under Heteroscedasticity 475
10.1.2 An Omnibus Test 479
10.1.3 R Functions IsfitNci, lsfitci, olshc4, hc4test, and hc4wtest 480
10.1.4 Comments on Comparing Means via Dummy Coding 483
10.1.5 Comments on Trying to Salvage the HomoscedasticityAssumption 483
'
10.2 Theil-Sen Estimator 484
10.2.1 R Functions tsreg, correg, and regplot 486
10.3 Least Median of Squares 487
10.3.1 R Function lmsreg 487
10.4 Least Trimmed Squares Estimator 488
10.4.1 R Functions ltsreg and ltsgreg 488
10.5 Least Trimmed Absolute Value Estimator 488
10.5.1 R Function ltareg 489
10.6 M-Estimators ....: 489
XV
Contents
10.7 The Hat Matrix 490
10.8 Generalized M-Estimators 493
10.8.1 R Function bmreg 497
10.9 The Coakley-Hettmansperger and Yohai Estimators 498
10.9.1 MM-Estimator 499
10.9.2 R Functions chreg and MMreg 500
10.10 Skipped Estimators 500
10.10.1 R Functions mgvreg and opreg 501
10.11 Deepest Regression Line 502
10.11.1 R Function mdepreg 502
10.12 A Criticism of Methods with a High Breakdown Point 503
10.13 Some Additional Estimators 503
10.13.1 S-Estimators and t-Estimators 503
10.13.2 R Functions snmreg and stsreg 504
10.13.3 E-Type Skipped Estimators 505
10.13.4 R Functions mbmreg, tstsreg, and gyreg 506
10.13.5 Methods Based on Robust Covariances 507
10.13.6 R Functions bireg, winreg, and COVreg 509
10.13.7 L-Estimators 510
10.13.8 Lx and Quantile Regression 510
10.13.9 R Functions qreg and rqfit 511
10.13.10 Methods Based on Estimates of the Optimal Weights 511
10.13.11 Projection Estimators 512
10.13.12 Methods Based on Ranks 513
10.14 Comments About Various Estimators 514
10.14.1 Contamination Bias 515
10.15 Outlier Detection Based on a Robust Fit 520
10.15.1 Detecting Regression Outliers 520
10.15.2 R Function reglev 521
10.16 Logistic Regression and the General Linear Model 522
10.16.1 R Functions glm, logreg, wlogreg, and logreg.plot 523
10.16.2 The General Linear Model 524
10.16.3 R Function glmrob 525
10.17 Multivariate Regression 525
10.17.1 The RADA Estimator 526
10.17.2 The Least Distance Estimator 527
10.17.3 R Functions mlrreg and Mreglde 528
10.17.4 Multivariate Least Trimmed Squares Estimator 529
10.17.5 R Function MULTtsreg 530
10.17.6 Other Robust Estimators 530
10.18 Exercises 530
xvi
Contents
Chapter 11 More Regression Methods 533
11.1 Inferences About Robust Regression Parameters 533
11.1.1 Omnibus Tests for Regression Parameters 534
11.1.2 R Function regtest 538
11.1.3 Inferences About Individual Parameters 539
11.1.4 R Functions regci and wlogregci 541
11.1.5 Methods Based on the Quantile Regression Estimator 543
11.1.6 R Functions rqtest, qregci, and qrchk 544
11.1.7 Inferences Based on the OP-Estimator 545
11.1.8 R Functions opregpb and opregpbMC 546
11.1.9 Hypothesis Testing when Using the Multivariate
Regression Estimator RADA 547
11.1.10 R Function mlrGtest 548
11.1.11 Robust ANOVA via Dummy Coding 549
11.2 Comparing the Parameters of Two Independent Groups 549
11.2.1 R Function reg2ci 551
11.3 Detecting Heteroscedasticity 553
11.3.1 A Quantile Regression Approach : 553
11.3.2 Koenker's Method 554
11.3.3 R Functions qhomt and khomreg 555
11.4 Curvature and Half-Slope Ratios 555
11.4.1 R Function hratio 556
11.5 Curvature and Nonparametric Regression 558
11.5.1 Smoothers 558
11.5.2 Kernel Estimators and Cleveland's LOWESS 559
11.5.3 R Functions lplot and kerreg 561
11.5.4 The Running Interval Smoother 561
11.5.5 R Functions runmean, rungen, runmbo, and runhat 566
11.5.6 Skipped Smoothers 569
11.5.7 Smoothers for Estimating Quantiles via Splines 569
11.5.8 R Function qsmcobs 570
11.5.9 Special Methods for Binary Outcomes 570
11.5.10 R Functions logrsm bkreg, logSM, and rplotbin 572
11.5.11 Smoothing with More than One Predictor 573
11.5.12 R Functions runm3d, run3hat, rung3d, run3bo, rung3hat,
rplot, rplotsm, and runpd 574
11.5.13 LOESS 578
11.5.14 Other Approaches 581
11.5.15 R Function adrun, adrunl, gamplot, and gamplotINT 583
11.6 Checking the Specification of a Regression Model 584
11.6.1 Testing the Hypothesis of a Linear Association 585
xvii
Contents
11.6.2 R Function lintest 586
11.6.3 Testing the Hypothesis of a Generalized Additive Model 586
11.6.4 R Function adtest 587
11.6.5 Inferences About the Components of a GeneralizedAdditive Model 588
11.6.6 R Function adcom 588
11.7 Regression Interactions and Moderator Analysis 589
11.7.1 R Functions kercon, riplot, runsm2g, ols.plot.inter, and
reg.plot.inter 591
11.7.2 Mediation Analysis 594
11.7.3 R functions ZYmediate, regmed2, and regmediate 596
11.8 Comparing Parametric, Additive, and Nonparametric Fits 596
11.8.1 R Functions adpchk and pmodchk 597
11.9 Measuring the Strength of an Association Given a Fit to the Data 598
11.9.1 R Function RobRsq 600
11.9.2 Comparing Two Independent Groups via Explanatory Power.... 600
11.9.3 R Functions smcorcom and smstrcom 601
11.10 Comparing Predictors 601
11.10.1 Comparing Pearson Correlations 602
11.10.2 Methods Based on Estimating Prediction Error 603
11.10.3 R Functions TWOpov, regpre, and regpreCV 605
11.10.4 R Function larsR 607
11.10.5 Comparing Predictors via Explanatory Power and a
Robust Fit 607
11.10.6 R Functions ts2str and sm2strv7 608
11.11 ANCOVA 609
11.11.1 Methods Based on Specific Design Points 610
11.11.2 R Functions ancova, ancpb, runmean2g, lplot2g, ancboot,ancbbpb, and cobs2g 613
11.11.3 Multiple Covariates 618
11.11.4 R Functions ancdes, ancovamp, ancmppb, and ancmg 619
11.11.5 Some Global Tests 620
11.11.6 R Functions ancsm and Qancsm 624
11.12 Marginal Longitudinal Data Analysis: Comments on ComparingGroups 624
11.12.1 R Functions long2g, longreg, longreg.plot, and xyplot 626
11.13 Exercises 627
References 631
Index 687
xviii