-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMASS.html
16660 lines (13449 loc) · 717 KB
/
MASS.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>Package 'MASS' reference manual</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<!-- styling for math. katex.min.css expects fonts in same dir so use CDN -->
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.9/katex.min.css">
<link rel="stylesheet" type="text/css" href="https://r-universe.dev/static/R.css">
<link rel="stylesheet" type="text/css" href="https://r-universe.dev/static/prism.css">
<!-- for (future) customizations -->
<script src="https://r-universe.dev/static/manual.js"></script>
<link rel="stylesheet" type="text/css" href="https://r-universe.dev/static/manual.css?nocache=1">
</head>
<body class="postdoc macintosh">
<h1 class="manual-title">Package 'MASS'</h1>
<table class="description-table">
<tr>
<th>Title:</th>
<td class="description-title">Support Functions and Datasets for Venables and Ripley's MASS</td>
</tr>
<tr>
<th>Description:</th>
<td class="description-description">Functions and datasets to support Venables and Ripley,
"Modern Applied Statistics with S" (4th edition, 2002).</td>
</tr>
<tr>
<th>Authors:</th>
<td class="description-author"><span>Brian Ripley [aut, cre, cph],
Bill Venables [aut, cph],
Douglas M. Bates [ctb],
Kurt Hornik [trl] (partial port ca 1998),
Albrecht Gebhardt [trl] (partial port ca 1998),
David Firth [ctb] (support functions for polr)</span></td>
</tr>
<tr>
<th>Maintainer:</th>
<td class="description-maintainer">Brian Ripley <[email protected]></td>
</tr>
<tr>
<th>License:</th>
<td class="description-license">GPL-2 | GPL-3</td>
</tr>
<tr>
<th>Version:</th>
<td class="description-version">7.3-61</td>
</tr>
<tr>
<th>Built:</th>
<td class="description-date">2024-06-13 08:44:38 UTC</td>
</tr>
<tr>
<th>Source:</th>
<td class="description-source">CRAN</td>
</tr>
</table>
<a href="#help-index" style="color:black;"><h2 id="help-index">Help Index</h2></a>
<ul id="help-index-list">
<li class="help-index-item"><a href="#abbey">
Determinations of Nickel Content
</a></li>
<li class="help-index-item"><a href="#accdeaths">
Accidental Deaths in the US 1973-1978
</a></li>
<li class="help-index-item"><a href="#addterm">
Try All One-Term Additions to a Model
</a></li>
<li class="help-index-item"><a href="#Aids2">
Australian AIDS Survival Data
</a></li>
<li class="help-index-item"><a href="#Animals">
Brain and Body Weights for 28 Species
</a></li>
<li class="help-index-item"><a href="#anorexia">
Anorexia Data on Weight Change
</a></li>
<li class="help-index-item"><a href="#anova.negbin">
Likelihood Ratio Tests for Negative Binomial GLMs
</a></li>
<li class="help-index-item"><a href="#area">
Adaptive Numerical Integration
</a></li>
<li class="help-index-item"><a href="#bacteria">
Presence of Bacteria after Drug Treatments
</a></li>
<li class="help-index-item"><a href="#bandwidth.nrd">
Bandwidth for density() via Normal Reference Distribution
</a></li>
<li class="help-index-item"><a href="#bcv">
Biased Cross-Validation for Bandwidth Selection
</a></li>
<li class="help-index-item"><a href="#beav1">
Body Temperature Series of Beaver 1
</a></li>
<li class="help-index-item"><a href="#beav2">
Body Temperature Series of Beaver 2
</a></li>
<li class="help-index-item"><a href="#phones">
Belgium Phone Calls 1950-1973
</a></li>
<li class="help-index-item"><a href="#biopsy">
Biopsy Data on Breast Cancer Patients
</a></li>
<li class="help-index-item"><a href="#birthwt">
Risk Factors Associated with Low Infant Birth Weight
</a></li>
<li class="help-index-item"><a href="#Boston">
Housing Values in Suburbs of Boston
</a></li>
<li class="help-index-item"><a href="#boxcox">
Box-Cox Transformations for Linear Models
</a></li>
<li class="help-index-item"><a href="#cabbages">
Data from a cabbage field trial
</a></li>
<li class="help-index-item"><a href="#caith">
Colours of Eyes and Hair of People in Caithness
</a></li>
<li class="help-index-item"><a href="#Cars93">
Data from 93 Cars on Sale in the USA in 1993
</a></li>
<li class="help-index-item"><a href="#cats">
Anatomical Data from Domestic Cats
</a></li>
<li class="help-index-item"><a href="#cement">
Heat Evolved by Setting Cements
</a></li>
<li class="help-index-item"><a href="#chem">
Copper in Wholemeal Flour
</a></li>
<li class="help-index-item"><a href="#con2tr">
Convert Lists to Data Frames for use by lattice
</a></li>
<li class="help-index-item"><a href="#confint">
Confidence Intervals for Model Parameters
</a></li>
<li class="help-index-item"><a href="#contr.sdif">
Successive Differences Contrast Coding
</a></li>
<li class="help-index-item"><a href="#coop">
Co-operative Trial in Analytical Chemistry
</a></li>
<li class="help-index-item"><a href="#corresp">
Simple Correspondence Analysis
</a></li>
<li class="help-index-item"><a href="#cov.rob">
Resistant Estimation of Multivariate Location and Scatter
</a></li>
<li class="help-index-item"><a href="#cov.trob">
Covariance Estimation for Multivariate t Distribution
</a></li>
<li class="help-index-item"><a href="#cpus">
Performance of Computer CPUs
</a></li>
<li class="help-index-item"><a href="#crabs">
Morphological Measurements on Leptograpsus Crabs
</a></li>
<li class="help-index-item"><a href="#Cushings">
Diagnostic Tests on Patients with Cushing's Syndrome
</a></li>
<li class="help-index-item"><a href="#DDT">
DDT in Kale
</a></li>
<li class="help-index-item"><a href="#deaths">
Monthly Deaths from Lung Diseases in the UK
</a></li>
<li class="help-index-item"><a href="#denumerate">
Transform an Allowable Formula for 'loglm' into one for 'terms'
</a></li>
<li class="help-index-item"><a href="#dose.p">
Predict Doses for Binomial Assay model
</a></li>
<li class="help-index-item"><a href="#drivers">
Deaths of Car Drivers in Great Britain 1969-84
</a></li>
<li class="help-index-item"><a href="#dropterm">
Try All One-Term Deletions from a Model
</a></li>
<li class="help-index-item"><a href="#eagles">
Foraging Ecology of Bald Eagles
</a></li>
<li class="help-index-item"><a href="#epil">
Seizure Counts for Epileptics
</a></li>
<li class="help-index-item"><a href="#eqscplot">
Plots with Geometrically Equal Scales
</a></li>
<li class="help-index-item"><a href="#farms">
Ecological Factors in Farm Management
</a></li>
<li class="help-index-item"><a href="#fgl">
Measurements of Forensic Glass Fragments
</a></li>
<li class="help-index-item"><a href="#fitdistr">
Maximum-likelihood Fitting of Univariate Distributions
</a></li>
<li class="help-index-item"><a href="#forbes">
Forbes' Data on Boiling Points in the Alps
</a></li>
<li class="help-index-item"><a href="#fractions">
Rational Approximation
</a></li>
<li class="help-index-item"><a href="#GAGurine">
Level of GAG in Urine of Children
</a></li>
<li class="help-index-item"><a href="#galaxies">
Velocities for 82 Galaxies
</a></li>
<li class="help-index-item"><a href="#gamma.dispersion">
Calculate the MLE of the Gamma Dispersion Parameter in a GLM Fit
</a></li>
<li class="help-index-item"><a href="#gamma.shape.glm">
Estimate the Shape Parameter of the Gamma Distribution in a GLM Fit
</a></li>
<li class="help-index-item"><a href="#gehan">
Remission Times of Leukaemia Patients
</a></li>
<li class="help-index-item"><a href="#genotype">
Rat Genotype Data
</a></li>
<li class="help-index-item"><a href="#geyser">Old Faithful Geyser Data</a></li>
<li class="help-index-item"><a href="#gilgais">
Line Transect of Soil in Gilgai Territory
</a></li>
<li class="help-index-item"><a href="#ginv">
Generalized Inverse of a Matrix
</a></li>
<li class="help-index-item"><a href="#glm.convert">
Change a Negative Binomial fit to a GLM fit
</a></li>
<li class="help-index-item"><a href="#glm.nb">
Fit a Negative Binomial Generalized Linear Model
</a></li>
<li class="help-index-item"><a href="#glmmPQL">
Fit Generalized Linear Mixed Models via PQL
</a></li>
<li class="help-index-item"><a href="#hills">
Record Times in Scottish Hill Races
</a></li>
<li class="help-index-item"><a href="#hist.scott">
Plot a Histogram with Automatic Bin Width Selection
</a></li>
<li class="help-index-item"><a href="#housing">
Frequency Table from a Copenhagen Housing Conditions Survey
</a></li>
<li class="help-index-item"><a href="#huber">
Huber M-estimator of Location with MAD Scale
</a></li>
<li class="help-index-item"><a href="#hubers">
Huber Proposal 2 Robust Estimator of Location and/or Scale
</a></li>
<li class="help-index-item"><a href="#immer">
Yields from a Barley Field Trial
</a></li>
<li class="help-index-item"><a href="#Insurance">
Numbers of Car Insurance claims
</a></li>
<li class="help-index-item"><a href="#isoMDS">
Kruskal's Non-metric Multidimensional Scaling
</a></li>
<li class="help-index-item"><a href="#kde2d">
Two-Dimensional Kernel Density Estimation
</a></li>
<li class="help-index-item"><a href="#lda">
Linear Discriminant Analysis
</a></li>
<li class="help-index-item"><a href="#ldahist">
Histograms or Density Plots of Multiple Groups
</a></li>
<li class="help-index-item"><a href="#leuk">
Survival Times and White Blood Counts for Leukaemia Patients
</a></li>
<li class="help-index-item"><a href="#lm.gls">
Fit Linear Models by Generalized Least Squares
</a></li>
<li class="help-index-item"><a href="#lm.ridge">
Ridge Regression
</a></li>
<li class="help-index-item"><a href="#loglm">
Fit Log-Linear Models by Iterative Proportional Scaling
</a></li>
<li class="help-index-item"><a href="#logtrans">
Estimate log Transformation Parameter
</a></li>
<li class="help-index-item"><a href="#lqs">
Resistant Regression
</a></li>
<li class="help-index-item"><a href="#mammals">
Brain and Body Weights for 62 Species of Land Mammals
</a></li>
<li class="help-index-item"><a href="#mca">
Multiple Correspondence Analysis
</a></li>
<li class="help-index-item"><a href="#mcycle">
Data from a Simulated Motorcycle Accident
</a></li>
<li class="help-index-item"><a href="#Melanoma">
Survival from Malignant Melanoma
</a></li>
<li class="help-index-item"><a href="#menarche">
Age of Menarche in Warsaw
</a></li>
<li class="help-index-item"><a href="#michelson">
Michelson's Speed of Light Data
</a></li>
<li class="help-index-item"><a href="#minn38">
Minnesota High School Graduates of 1938
</a></li>
<li class="help-index-item"><a href="#motors">
Accelerated Life Testing of Motorettes
</a></li>
<li class="help-index-item"><a href="#muscle">
Effect of Calcium Chloride on Muscle Contraction in Rat Hearts
</a></li>
<li class="help-index-item"><a href="#mvrnorm">Simulate from a Multivariate Normal Distribution</a></li>
<li class="help-index-item"><a href="#negative.binomial">
Family function for Negative Binomial GLMs
</a></li>
<li class="help-index-item"><a href="#newcomb">
Newcomb's Measurements of the Passage Time of Light
</a></li>
<li class="help-index-item"><a href="#nlschools">
Eighth-Grade Pupils in the Netherlands
</a></li>
<li class="help-index-item"><a href="#npk">
Classical N, P, K Factorial Experiment
</a></li>
<li class="help-index-item"><a href="#npr1">
US Naval Petroleum Reserve No. 1 data
</a></li>
<li class="help-index-item"><a href="#Null">
Null Spaces of Matrices
</a></li>
<li class="help-index-item"><a href="#oats">
Data from an Oats Field Trial
</a></li>
<li class="help-index-item"><a href="#OME">
Tests of Auditory Perception in Children with OME
</a></li>
<li class="help-index-item"><a href="#painters">
The Painter's Data of de Piles
</a></li>
<li class="help-index-item"><a href="#pairs.lda">
Produce Pairwise Scatterplots from an 'lda' Fit
</a></li>
<li class="help-index-item"><a href="#parcoord">
Parallel Coordinates Plot
</a></li>
<li class="help-index-item"><a href="#petrol">
N. L. Prater's Petrol Refinery Data
</a></li>
<li class="help-index-item"><a href="#Pima.tr">
Diabetes in Pima Indian Women
</a></li>
<li class="help-index-item"><a href="#plot.lda">
Plot Method for Class 'lda'
</a></li>
<li class="help-index-item"><a href="#plot.mca">
Plot Method for Objects of Class 'mca'
</a></li>
<li class="help-index-item"><a href="#polr">
Ordered Logistic or Probit Regression
</a></li>
<li class="help-index-item"><a href="#predict.glmmPQL">Predict Method for glmmPQL Fits</a></li>
<li class="help-index-item"><a href="#predict.lda">
Classify Multivariate Observations by Linear Discrimination
</a></li>
<li class="help-index-item"><a href="#predict.lqs">
Predict from an lqs Fit
</a></li>
<li class="help-index-item"><a href="#predict.mca">
Predict Method for Class 'mca'
</a></li>
<li class="help-index-item"><a href="#predict.qda">
Classify from Quadratic Discriminant Analysis
</a></li>
<li class="help-index-item"><a href="#profile.glm">Method for Profiling glm Objects</a></li>
<li class="help-index-item"><a href="#qda">
Quadratic Discriminant Analysis
</a></li>
<li class="help-index-item"><a href="#quine">
Absenteeism from School in Rural New South Wales
</a></li>
<li class="help-index-item"><a href="#Rabbit">
Blood Pressure in Rabbits
</a></li>
<li class="help-index-item"><a href="#rational">
Rational Approximation
</a></li>
<li class="help-index-item"><a href="#renumerate">
Convert a Formula Transformed by 'denumerate'
</a></li>
<li class="help-index-item"><a href="#rlm">
Robust Fitting of Linear Models
</a></li>
<li class="help-index-item"><a href="#rms.curv">
Relative Curvature Measures for Non-Linear Regression
</a></li>
<li class="help-index-item"><a href="#rnegbin">
Simulate Negative Binomial Variates
</a></li>
<li class="help-index-item"><a href="#road">
Road Accident Deaths in US States
</a></li>
<li class="help-index-item"><a href="#rotifer">
Numbers of Rotifers by Fluid Density
</a></li>
<li class="help-index-item"><a href="#Rubber">
Accelerated Testing of Tyre Rubber
</a></li>
<li class="help-index-item"><a href="#sammon">
Sammon's Non-Linear Mapping
</a></li>
<li class="help-index-item"><a href="#ships">
Ships Damage Data
</a></li>
<li class="help-index-item"><a href="#shoes">
Shoe wear data of Box, Hunter and Hunter
</a></li>
<li class="help-index-item"><a href="#shrimp">
Percentage of Shrimp in Shrimp Cocktail
</a></li>
<li class="help-index-item"><a href="#shuttle">
Space Shuttle Autolander Problem
</a></li>
<li class="help-index-item"><a href="#Sitka">
Growth Curves for Sitka Spruce Trees in 1988
</a></li>
<li class="help-index-item"><a href="#Sitka89">
Growth Curves for Sitka Spruce Trees in 1989
</a></li>
<li class="help-index-item"><a href="#Skye">
AFM Compositions of Aphyric Skye Lavas
</a></li>
<li class="help-index-item"><a href="#snails">
Snail Mortality Data
</a></li>
<li class="help-index-item"><a href="#SP500">
Returns of the Standard and Poors 500
</a></li>
<li class="help-index-item"><a href="#stdres">
Extract Standardized Residuals from a Linear Model
</a></li>
<li class="help-index-item"><a href="#steam">
The Saturated Steam Pressure Data
</a></li>
<li class="help-index-item"><a href="#stepAIC">
Choose a model by AIC in a Stepwise Algorithm
</a></li>
<li class="help-index-item"><a href="#stormer">
The Stormer Viscometer Data
</a></li>
<li class="help-index-item"><a href="#studres">
Extract Studentized Residuals from a Linear Model
</a></li>
<li class="help-index-item"><a href="#summary.loglm">
Summary Method Function for Objects of Class 'loglm'
</a></li>
<li class="help-index-item"><a href="#summary.negbin">
Summary Method Function for Objects of Class 'negbin'
</a></li>
<li class="help-index-item"><a href="#summary.rlm">
Summary Method for Robust Linear Models
</a></li>
<li class="help-index-item"><a href="#survey">
Student Survey Data
</a></li>
<li class="help-index-item"><a href="#synth.tr">
Synthetic Classification Problem
</a></li>
<li class="help-index-item"><a href="#theta.md">
Estimate theta of the Negative Binomial
</a></li>
<li class="help-index-item"><a href="#topo">
Spatial Topographic Data
</a></li>
<li class="help-index-item"><a href="#Traffic">
Effect of Swedish Speed Limits on Accidents
</a></li>
<li class="help-index-item"><a href="#truehist">
Plot a Histogram
</a></li>
<li class="help-index-item"><a href="#ucv">
Unbiased Cross-Validation for Bandwidth Selection
</a></li>
<li class="help-index-item"><a href="#UScereal">
Nutritional and Marketing Information on US Cereals
</a></li>
<li class="help-index-item"><a href="#UScrime">
The Effect of Punishment Regimes on Crime Rates
</a></li>
<li class="help-index-item"><a href="#VA">
Veteran's Administration Lung Cancer Trial
</a></li>
<li class="help-index-item"><a href="#waders">
Counts of Waders at 15 Sites in South Africa
</a></li>
<li class="help-index-item"><a href="#whiteside">
House Insulation: Whiteside's Data
</a></li>
<li class="help-index-item"><a href="#width.SJ">
Bandwidth Selection by Pilot Estimation of Derivatives
</a></li>
<li class="help-index-item"><a href="#write.matrix">
Write a Matrix or Data Frame
</a></li>
<li class="help-index-item"><a href="#wtloss">
Weight Loss Data from an Obese Patient
</a></li>
</ul>
<hr>
<div class="manual-pages-content">
<div class="container manual-page" id="abbey"><div class="page-main">
<a href="#abbey" class="help-page-title"><h2>
Determinations of Nickel Content
</h2></a>
<h3>Description</h3>
<p>A numeric vector of 31 determinations of nickel content (ppm) in
a Canadian syenite rock.
</p>
<h3>Usage</h3>
<pre class="language-r"><code class="language-r-input" hidden="hidden">abbey
</code><code class="language-r">abbey</code></pre>
<h3>Source</h3>
<p>S. Abbey (1988) <em>Geostandards Newsletter</em> <b>12</b>, 241.
</p>
<h3>References</h3>
<p>Venables, W. N. and Ripley, B. D. (2002)
<em>Modern Applied Statistics with S.</em> Fourth edition. Springer.
</p>
<hr>
</div></div>
<div class="container manual-page" id="accdeaths"><div class="page-main">
<a href="#accdeaths" class="help-page-title"><h2>
Accidental Deaths in the US 1973-1978
</h2></a>
<h3>Description</h3>
<p>A regular time series giving the monthly totals of accidental
deaths in the USA.
</p>
<h3>Usage</h3>
<pre class="language-r"><code class="language-r-input" hidden="hidden">accdeaths
</code><code class="language-r">accdeaths</code></pre>
<h3>Details</h3>
<p>The values for first six months of 1979 (p. 326) were
<code>7798 7406 8363 8460 9217 9316</code>.
</p>
<h3>Source</h3>
<p>P. J. Brockwell and R. A. Davis (1991)
<em>Time Series: Theory and Methods.</em>
Springer, New York.
</p>
<h3>References</h3>
<p>Venables, W. N. and Ripley, B. D. (2002)
<em>Modern Applied Statistics with S-PLUS.</em> Fourth Edition. Springer.
</p>
<hr>
</div></div>
<div class="container manual-page" id="addterm"><div class="page-main">
<a href="#addterm" class="help-page-title"><h2>
Try All One-Term Additions to a Model
</h2></a>
<h3>Description</h3>
<p>Try fitting all models that differ from the current model by adding a
single term from those supplied, maintaining marginality.
</p>
<p>This function is generic; there exist methods for classes <code>lm</code> and
<code>glm</code> and the default method will work for many other classes.
</p>
<h3>Usage</h3>
<pre class="language-r"><code class="language-r-input" hidden="hidden">addterm(object, ...)
## Default S3 method:
addterm(object, scope, scale = 0, test = c("none", "Chisq"),
k = 2, sorted = FALSE, trace = FALSE, ...)
## S3 method for class 'lm'
addterm(object, scope, scale = 0, test = c("none", "Chisq", "F"),
k = 2, sorted = FALSE, ...)
## S3 method for class 'glm'
addterm(object, scope, scale = 0, test = c("none", "Chisq", "F"),
k = 2, sorted = FALSE, trace = FALSE, ...)
</code><code class="language-r">addterm<span class="token punctuation">(</span>object<span class="token punctuation">,</span> <span class="token ellipsis">...</span><span class="token punctuation">)</span>
<span class="token comment">## Default S3 method:</span>
addterm<span class="token punctuation">(</span>object<span class="token punctuation">,</span> scope<span class="token punctuation">,</span> scale <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> test <span class="token operator">=</span> c<span class="token punctuation">(</span><span class="token string">"none"</span><span class="token punctuation">,</span> <span class="token string">"Chisq"</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
k <span class="token operator">=</span> <span class="token number">2</span><span class="token punctuation">,</span> sorted <span class="token operator">=</span> <span class="token boolean">FALSE</span><span class="token punctuation">,</span> trace <span class="token operator">=</span> <span class="token boolean">FALSE</span><span class="token punctuation">,</span> <span class="token ellipsis">...</span><span class="token punctuation">)</span>
<span class="token comment">## S3 method for class 'lm'</span>
addterm<span class="token punctuation">(</span>object<span class="token punctuation">,</span> scope<span class="token punctuation">,</span> scale <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> test <span class="token operator">=</span> c<span class="token punctuation">(</span><span class="token string">"none"</span><span class="token punctuation">,</span> <span class="token string">"Chisq"</span><span class="token punctuation">,</span> <span class="token string">"F"</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
k <span class="token operator">=</span> <span class="token number">2</span><span class="token punctuation">,</span> sorted <span class="token operator">=</span> <span class="token boolean">FALSE</span><span class="token punctuation">,</span> <span class="token ellipsis">...</span><span class="token punctuation">)</span>
<span class="token comment">## S3 method for class 'glm'</span>
addterm<span class="token punctuation">(</span>object<span class="token punctuation">,</span> scope<span class="token punctuation">,</span> scale <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> test <span class="token operator">=</span> c<span class="token punctuation">(</span><span class="token string">"none"</span><span class="token punctuation">,</span> <span class="token string">"Chisq"</span><span class="token punctuation">,</span> <span class="token string">"F"</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
k <span class="token operator">=</span> <span class="token number">2</span><span class="token punctuation">,</span> sorted <span class="token operator">=</span> <span class="token boolean">FALSE</span><span class="token punctuation">,</span> trace <span class="token operator">=</span> <span class="token boolean">FALSE</span><span class="token punctuation">,</span> <span class="token ellipsis">...</span><span class="token punctuation">)</span></code></pre>
<h3 class="r-arguments-title">Arguments</h3>
<table>
<tr>
<td><code id="object">object</code></td>
<td>
<p>An object fitted by some model-fitting function.
</p>
</td>
</tr>
<tr>
<td><code id="scope">scope</code></td>
<td>
<p>a formula specifying a maximal model which should include the current
one. All additional terms in the maximal model with all marginal terms
in the original model are tried.
</p>
</td>
</tr>
<tr>
<td><code id="scale">scale</code></td>
<td>
<p>used in the definition of the AIC statistic for selecting the models,
currently only for <code>lm</code>, <code>aov</code> and <code>glm</code> models. Specifying <code>scale</code>
asserts that the residual standard error or dispersion is known.
</p>
</td>
</tr>
<tr>
<td><code id="test">test</code></td>
<td>
<p>should the results include a test statistic relative to the original
model? The F test is only appropriate for <code>lm</code> and <code>aov</code> models,
and perhaps for some over-dispersed <code>glm</code> models. The
Chisq test can be an exact test (<code>lm</code> models with known scale) or a
likelihood-ratio test depending on the method.
</p>
</td>
</tr>
<tr>
<td><code id="k">k</code></td>
<td>
<p>the multiple of the number of degrees of freedom used for the penalty.
Only <code>k=2</code> gives the genuine AIC: <code>k = log(n)</code> is sometimes referred
to as BIC or SBC.
</p>
</td>
</tr>
<tr>
<td><code id="sorted">sorted</code></td>
<td>
<p>should the results be sorted on the value of AIC?
</p>
</td>
</tr>
<tr>
<td><code id="trace">trace</code></td>
<td>
<p>if <code>TRUE</code> additional information may be given on the fits as they are tried.
</p>
</td>
</tr>
<tr>
<td><code id="...">...</code></td>
<td>
<p>arguments passed to or from other methods.
</p>
</td>
</tr>
</table>
<h3>Details</h3>
<p>The definition of AIC is only up to an additive constant: when
appropriate (<code>lm</code> models with specified scale) the constant is taken
to be that used in Mallows' Cp statistic and the results are labelled
accordingly.
</p>
<h3>Value</h3>
<p>A table of class <code>"anova"</code> containing at least columns for the change
in degrees of freedom and AIC (or Cp) for the models. Some methods
will give further information, for example sums of squares, deviances,
log-likelihoods and test statistics.
</p>
<h3>References</h3>
<p>Venables, W. N. and Ripley, B. D. (2002)
<em>Modern Applied Statistics with S.</em> Fourth edition. Springer.
</p>
<h3>See Also</h3>
<p><code><a href="#dropterm">dropterm</a></code>, <code><a href="#stepAIC">stepAIC</a></code>
</p>
<h3>Examples</h3>
<pre class="language-r"><code class="language-r-input" hidden="hidden">quine.hi <- aov(log(Days + 2.5) ~ .^4, quine)
quine.lo <- aov(log(Days+2.5) ~ 1, quine)
addterm(quine.lo, quine.hi, test="F")
house.glm0 <- glm(Freq ~ Infl*Type*Cont + Sat, family=poisson,
data=housing)
addterm(house.glm0, ~. + Sat:(Infl+Type+Cont), test="Chisq")
house.glm1 <- update(house.glm0, . ~ . + Sat*(Infl+Type+Cont))
addterm(house.glm1, ~. + Sat:(Infl+Type+Cont)^2, test = "Chisq")
</code><code class="language-r">quine.hi <span class="token operator"><-</span> aov<span class="token punctuation">(</span>log<span class="token punctuation">(</span>Days <span class="token operator">+</span> <span class="token number">2.5</span><span class="token punctuation">)</span> <span class="token operator">~</span> .<span class="token operator">^</span><span class="token number">4</span><span class="token punctuation">,</span> quine<span class="token punctuation">)</span>
quine.lo <span class="token operator"><-</span> aov<span class="token punctuation">(</span>log<span class="token punctuation">(</span>Days<span class="token operator">+</span><span class="token number">2.5</span><span class="token punctuation">)</span> <span class="token operator">~</span> <span class="token number">1</span><span class="token punctuation">,</span> quine<span class="token punctuation">)</span>
addterm<span class="token punctuation">(</span>quine.lo<span class="token punctuation">,</span> quine.hi<span class="token punctuation">,</span> test<span class="token operator">=</span><span class="token string">"F"</span><span class="token punctuation">)</span>
house.glm0 <span class="token operator"><-</span> glm<span class="token punctuation">(</span>Freq <span class="token operator">~</span> Infl<span class="token operator">*</span>Type<span class="token operator">*</span>Cont <span class="token operator">+</span> Sat<span class="token punctuation">,</span> family<span class="token operator">=</span>poisson<span class="token punctuation">,</span>
data<span class="token operator">=</span>housing<span class="token punctuation">)</span>
addterm<span class="token punctuation">(</span>house.glm0<span class="token punctuation">,</span> <span class="token operator">~</span>. <span class="token operator">+</span> Sat<span class="token operator">:</span><span class="token punctuation">(</span>Infl<span class="token operator">+</span>Type<span class="token operator">+</span>Cont<span class="token punctuation">)</span><span class="token punctuation">,</span> test<span class="token operator">=</span><span class="token string">"Chisq"</span><span class="token punctuation">)</span>
house.glm1 <span class="token operator"><-</span> update<span class="token punctuation">(</span>house.glm0<span class="token punctuation">,</span> . <span class="token operator">~</span> . <span class="token operator">+</span> Sat<span class="token operator">*</span><span class="token punctuation">(</span>Infl<span class="token operator">+</span>Type<span class="token operator">+</span>Cont<span class="token punctuation">)</span><span class="token punctuation">)</span>
addterm<span class="token punctuation">(</span>house.glm1<span class="token punctuation">,</span> <span class="token operator">~</span>. <span class="token operator">+</span> Sat<span class="token operator">:</span><span class="token punctuation">(</span>Infl<span class="token operator">+</span>Type<span class="token operator">+</span>Cont<span class="token punctuation">)</span><span class="token operator">^</span><span class="token number">2</span><span class="token punctuation">,</span> test <span class="token operator">=</span> <span class="token string">"Chisq"</span><span class="token punctuation">)</span></code></pre>
<hr>
</div></div>
<div class="container manual-page" id="Aids2"><div class="page-main">
<a href="#Aids2" class="help-page-title"><h2>
Australian AIDS Survival Data
</h2></a>
<h3>Description</h3>
<p>Data on patients diagnosed with AIDS in Australia before 1 July 1991.
</p>
<h3>Usage</h3>
<pre class="language-r"><code class="language-r-input" hidden="hidden">Aids2
</code><code class="language-r">Aids2</code></pre>
<h3>Format</h3>
<p>This data frame contains 2843 rows and the following columns:
</p>
<dl>
<dt><code>state</code></dt>
<dd>
<p>Grouped state of origin: <code>"NSW "</code>includes ACT and
<code>"other"</code> is WA, SA, NT and TAS.
</p>
</dd>
<dt><code>sex</code></dt>
<dd>
<p>Sex of patient.
</p>
</dd>
<dt><code>diag</code></dt>
<dd>
<p>(Julian) date of diagnosis.</p>
</dd>
<dt><code>death</code></dt>
<dd>
<p>(Julian) date of death or end of observation.
</p>
</dd>
<dt><code>status</code></dt>
<dd>
<p><code>"A"</code> (alive) or <code>"D"</code> (dead) at end of observation.
</p>
</dd>
<dt><code>T.categ</code></dt>
<dd>
<p>Reported transmission category.
</p>
</dd>
<dt><code>age</code></dt>
<dd>
<p>Age (years) at diagnosis.
</p>
</dd>
</dl>
<h3>Note</h3>
<p>This data set has been slightly jittered as a
condition of its release, to ensure patient confidentiality.
</p>
<h3>Source</h3>
<p>Dr P. J. Solomon and the Australian National Centre in HIV Epidemiology
and Clinical Research.
</p>
<h3>References</h3>
<p>Venables, W. N. and Ripley, B. D. (2002)
<em>Modern Applied Statistics with S.</em> Fourth edition. Springer.
</p>
<hr>
</div></div>
<div class="container manual-page" id="Animals"><div class="page-main">
<a href="#Animals" class="help-page-title"><h2>
Brain and Body Weights for 28 Species
</h2></a>
<h3>Description</h3>
<p>Average brain and body weights for 28 species of land animals.
</p>
<h3>Usage</h3>
<pre class="language-r"><code class="language-r-input" hidden="hidden">Animals
</code><code class="language-r">Animals</code></pre>
<h3>Format</h3>
<dl>
<dt><code>body</code></dt>
<dd>
<p>body weight in kg.
</p>
</dd>
<dt><code>brain</code></dt>
<dd>
<p>brain weight in g.
</p>
</dd>
</dl>
<h3>Note</h3>
<p>The name <code>Animals</code> avoided conflicts with a system dataset
<code>animals</code> in S-PLUS 4.5 and later.
</p>
<h3>Source</h3>
<p>P. J. Rousseeuw and A. M. Leroy (1987)
<em>Robust Regression and Outlier Detection.</em>
Wiley, p. 57.
</p>
<h3>References</h3>
<p>Venables, W. N. and Ripley, B. D. (2002)
<em>Modern Applied Statistics with S-PLUS.</em> Fourth Edition. Springer.
</p>
<hr>
</div></div>
<div class="container manual-page" id="anorexia"><div class="page-main">
<a href="#anorexia" class="help-page-title"><h2>
Anorexia Data on Weight Change
</h2></a>
<h3>Description</h3>
<p>The <code>anorexia</code> data frame has 72 rows and 3 columns.
Weight change data for young female anorexia patients.
</p>
<h3>Usage</h3>
<pre class="language-r"><code class="language-r-input" hidden="hidden">anorexia
</code><code class="language-r">anorexia</code></pre>
<h3>Format</h3>
<p>This data frame contains the following columns:
</p>
<dl>
<dt><code>Treat</code></dt>
<dd>
<p>Factor of three levels: <code>"Cont"</code> (control), <code>"CBT"</code>
(Cognitive Behavioural treatment) and <code>"FT"</code> (family
treatment).
</p>
</dd>
<dt><code>Prewt</code></dt>
<dd>
<p>Weight of patient before study period, in lbs.
</p>
</dd>
<dt><code>Postwt</code></dt>
<dd>
<p>Weight of patient after study period, in lbs.
</p>
</dd>
</dl>
<h3>Source</h3>
<p>Hand, D. J., Daly, F., McConway, K., Lunn, D. and Ostrowski, E. eds (1993)
<em>A Handbook of Small Data Sets.</em>
Chapman & Hall, Data set 285 (p. 229)
</p>
<p>(Note that the original source mistakenly says that weights are in kg.)
</p>
<h3>References</h3>
<p>Venables, W. N. and Ripley, B. D. (2002)
<em>Modern Applied Statistics with S.</em> Fourth edition. Springer.
</p>
<hr>
</div></div>
<div class="container manual-page" id="anova.negbin"><div class="page-main">
<a href="#anova.negbin" class="help-page-title"><h2>
Likelihood Ratio Tests for Negative Binomial GLMs
</h2></a>
<h3>Description</h3>
<p>Method function to perform sequential likelihood ratio tests for Negative
Binomial generalized linear models.
</p>
<h3>Usage</h3>
<pre class="language-r"><code class="language-r-input" hidden="hidden">## S3 method for class 'negbin'
anova(object, ..., test = "Chisq")
</code><code class="language-r"><span class="token comment">## S3 method for class 'negbin'</span>
anova<span class="token punctuation">(</span>object<span class="token punctuation">,</span> <span class="token ellipsis">...</span><span class="token punctuation">,</span> test <span class="token operator">=</span> <span class="token string">"Chisq"</span><span class="token punctuation">)</span></code></pre>
<h3 class="r-arguments-title">Arguments</h3>
<table>
<tr>
<td><code id="object">object</code></td>
<td>
<p>Fitted model object of class <code>"negbin"</code>, inheriting from
classes <code>"glm"</code> and <code>"lm"</code>, specifying a Negative Binomial
fitted GLM. Typically the output of <code><a href="#glm.nb">glm.nb</a>()</code>.
</p>
</td>
</tr>
<tr>
<td><code id="...">...</code></td>
<td>
<p>Zero or more additional fitted model objects of class <code>"negbin"</code>. They
should form a nested sequence of models, but need not be specified in any
particular order.