找回密码
 注册
查看: 3541|回复: 0

The Basics of S-PLUS

  [复制链接]
发表于 2010-12-17 14:09:15 | 显示全部楼层 |阅读模式
The Basics of S-PLUS .rar (2.3 MB, 下载次数: 0, 售价: 10 金钱)

Contents
Preface ............................... v
Figures ............................... xvii
Tables................................ xxi
1 Introduction 1
1.1 The History of S and S-Plus ............... 2
1.2 S-Plus onDi?erentOperatingSystems ......... 4
1.3 Notational Conventions ................... 6
2 Graphical User Interface 9
2.1 Introduction......................... 9
2.2 SystemOverview ...................... 10
2.2.1 UsingaMouse.................... 11
2.2.2 ObjectExplorer................... 11
2.2.3 CommandsWindow ................ 11
2.2.4 Toolbars....................... 12
2.2.5 GraphSheets .................... 12
2.2.6 ScriptWindow ................... 12
2.3 GettingStartedwiththeInterface............. 13
2.3.1 Importing Data ................... 13
2.3.2 Graphs........................ 13
2.3.3 Data and Statistics ................. 15
2.3.4 CustomizingtheToolbars ............. 15
2.3.5 Chapters....................... 16
2.4 DetailedUseoftheGUIInterface............. 18
x Contents
2.5 ObjectExplorer....................... 18
2.6 Help ............................. 19
2.7 Data Export ......................... 21
2.8 WorkingDirectory ..................... 23
2.9 Data Import ......................... 24
2.10 Data Summaries ....................... 27
2.11 Graphs............................ 29
2.12 Trellis Graphs ........................ 36
2.13 Linear Regression ...................... 38
2.14 PowerPoint(WindowsOnly)................ 42
2.15 Excel(WindowsOnly) ................... 44
2.16 ScriptWindow........................ 45
2.17 UNIX/Linux GUI ...................... 47
2.18 Summary........................... 56
2.19 Exercises........................... 57
2.20 Solutions........................... 58
3 A First Session 73
3.1 GeneralInformation..................... 73
3.1.1 StartingandQuitting................ 74
3.1.2 TheHelpSystem .................. 75
3.1.3 BeforeBeginning .................. 75
3.2 SimpleStructures...................... 76
3.2.1 Arithmetic Operators ................ 76
3.2.2 Assignments..................... 77
3.2.3 The Concatenate Command: c ........... 79
3.2.4 The Sequence Command: seq ........... 80
3.2.5 The Replicate Command: rep ........... 81
3.3 MathematicalOperations ................. 82
3.4 UseofBrackets ....................... 84
3.5 Logical Values ........................ 85
3.6 Review............................ 88
3.7 Exercises........................... 91
3.8 Solutions........................... 92
4 A Second Session 95
4.1 Constructing and Manipulating Data ........... 95
4.1.1 Matrices....................... 96
4.1.2 Arrays ........................ 101
4.1.3 Data Frames ..................... 104
4.1.4 Lists ......................... 107
4.2 IntroductiontoFunctions ................. 108
4.3 IntroductiontoMissingValues............... 109
4.4 Merging Data ........................ 110
4.5 PuttingItAllTogether................... 111
Contents xi
4.6 Exercises........................... 114
4.7 Solutions........................... 116
5 Graphics 125
5.1 BasicGraphicsCommands................. 125
5.2 GraphicsDevices ...................... 126
5.2.1 WorkingwithMultipleGraphicsDevices..... 128
5.3 Plotting Data ........................ 128
5.3.1 The plot Command ................ 129
5.3.2 Modifying the Data Display ............ 130
5.3.3 ModifyingFigureElements............. 131
5.4 AddingElementstoExistingPlots ............ 133
5.4.1 FunctionstoAddElementstoGraphs ...... 133
5.4.2 More About abline ................ 135
5.4.3 MoreonAddingAxes ............... 135
5.4.4 AddingTexttoGraphs............... 137
5.5 SettingOptions ....................... 138
5.6 FigureLayouts ....................... 140
5.6.1 Layouts Using Trellis Graphs ........... 140
5.6.2 MatricesofGraphs................. 140
5.6.3 Multiple-ScreenGraphs............... 141
5.6.4 FiguresofSpecifiedSize .............. 142
5.7 Exercises........................... 145
5.8 Solutions........................... 146
6 Trellis Graphics 153
6.1 AnExample......................... 154
6.2 Trellis Basics ......................... 156
6.2.1 Trellis Syntax .................... 156
6.2.2 Trellis Functions .................. 157
6.2.3 DisplayingandStoringGraphs .......... 157
6.3 OutputDevices ....................... 158
6.4 Customizing Trellis Graphs ................. 160
6.4.1 SettingOptions................... 160
6.4.2 Arranging the Layout of a Trellis Graph ..... 161
6.4.3 OrderingofGraphs................. 163
6.4.4 AxisCustomization................. 164
6.4.5 ModifyingPanelStrips............... 165
6.4.6 Arranging Several Graphs on a Single Page . . . 165
6.4.7 Updating Existing Trellis Graphs ......... 167
6.4.8 WritingPanelFunctions .............. 168
6.5 Further Trellis Hints .................... 171
6.5.1 Useful General Trellis Settings ........... 172
6.5.2 GraphingIndividualProfiles............ 173
6.5.3 Preparing Data to Use for Trellis ......... 174
xii Contents
6.5.4 ThesubsetOption ................. 175
6.5.5 AddingaKey.................... 175
6.5.6 ThesubscriptsOptioninPanelFunctions .... 177
6.6 Exercises........................... 181
6.7 Solutions........................... 183
7 Exploring Data 193
7.1 Descriptive Data Exploration ............... 193
7.2 GraphicalExploration ................... 204
7.2.1 InteractiveDynamicGraphics........... 219
7.2.2 Old-StyleGraphics ................. 219
7.3 DistributionsandRelatedFunctions ........... 220
7.4 Confirmatory Statistics and Hypothesis Testing ..... 225
7.5 Missing and Infinite Values ................. 231
7.5.1 TestingforMissingValues............. 232
7.5.2 Supplying Data with Missing Values to Functions 232
7.5.3 MissingValuesinGraphs ............. 233
7.5.4 Infinite Values .................... 233
7.6 Exercises........................... 235
7.7 Solutions........................... 238
8 Statistical Modeling 251
8.1 IntroductoryExamples................... 251
8.1.1 Regression ...................... 251
8.1.2 Regression Diagnostics ............... 253
8.2 Statistical Models ...................... 255
8.3 ModelSyntax ........................ 256
8.4 Regression .......................... 257
8.4.1 Linear Regression and Modeling Techniques . . . 258
8.4.2 ANOVA ....................... 261
8.4.3 Logistic Regression ................. 263
8.4.4 Survival Data Analysis ............... 265
8.4.5 Endnote ....................... 267
8.5 Exercises........................... 268
8.6 Solutions........................... 271
9 Programming 285
9.1 Lists ............................. 285
9.1.1 AddingandDeletingListElements........ 287
9.1.2 NamingListElements ............... 288
9.1.3 Applying the Same Function to List Elements . . 290
9.1.4 UnlistingaList ................... 294
9.1.5 Generating a List by Using split ......... 294
9.2 WritingFunctions...................... 294
9.2.1 DocumentingFunctions .............. 297
Contents xiii
9.2.2 ScopeofVariables.................. 297
9.2.3 ParametersandDefaults ............. 298
9.2.4 Passing an Unspecified Number
ofParameterstoaFunction............ 300
9.2.5 TestingforExistenceofanArgument....... 301
9.2.6 ReturningWarningsandErrors.......... 301
9.2.7 Using Function Arguments in Graphics Labels . . 302
9.3 Iteration ........................... 303
9.3.1 The for Loop.................... 303
9.3.2 The while Loop................... 304
9.3.3 The repeat Loop.................. 305
9.3.4 VectorizingaLoop ................. 305
9.3.5 LargeLoops..................... 307
9.4 Debugging:SearchingforErrors.............. 308
9.4.1 SyntaxErrors.................... 309
9.4.2 InvalidArguments ................. 310
9.4.3 ExecutionorRun-TimeErrors........... 310
9.4.4 Logical Errors .................... 311
9.5 Output Using the cat Function .............. 314
9.6 The paste Function..................... 316
9.7 Exercises........................... 318
9.8 Solutions........................... 319
10 Object-Oriented Programming 323
10.1 Creating Classes and Objects ............... 325
10.2 CreatingMethods...................... 328
10.3 Debugging.......................... 333
10.4 Help ............................. 334
10.5 SummaryandOverview .................. 334
10.6 Exercises........................... 335
10.7 Solutions........................... 336
11 Input and Output 349
11.1 Reading S-Plus Commands from a File:
The source Function.................... 349
11.2 Data Import/Export: Easiest Method ........... 350
11.3 Data Import/Export: General Method .......... 352
11.4 Data Import/Export: Basic Method ............ 353
11.5 Reading Data from the Terminal ............. 354
11.6 Editing Data ......................... 355
11.7 Transferring Data ...................... 356
11.8 Recording a Session ..................... 356
11.9 Exercises........................... 358
11.10Solutions........................... 359
xiv Contents
12 Tips and Tricks 363
12.1 UsefulTechniques...................... 363
12.1.1Housekeeping:CleaningUpDirectories...... 363
12.1.2 Storing and Restoring Graphical Parameters . . . 364
12.1.3NamingofObjects ................. 364
12.1.4RepeatingCommands ............... 365
12.2 ProgrammingEnvironmentandTechniques ....... 366
12.2.1 The Process of Developing a Function ...... 366
12.2.2 Setting up an Editor and Running the Code
in S-Plus ...................... 366
12.2.3 Treating Data Frames as Lists ........... 368
12.2.4WorkingwithGraphSheets ............ 369
12.2.5 Incorporating and Accessing C and Fortran Pro-
grams ........................ 371
12.2.6BatchJobs...................... 374
12.2.7Libraries....................... 376
12.3 Factors............................ 378
12.3.1CreatingFactorsandOrderedFactors ...... 378
12.3.2 Internal Representation of Factors ......... 380
12.3.3WhereLevelsPlayaRole ............. 381
12.3.4WhereFactorsCanLeadTheirOwnLives.... 382
12.3.5HowFactorsComeIntoLife............ 384
12.3.6AddingandDroppingFactorLevels........ 385
12.4 Including Graphs in Text Processors ........... 386
12.4.1 Generating Graphs for Windows Applications . . 387
12.4.2GeneratingPostScriptGraphs........... 388
A
12.4.3 PostScript Graphs in L
T X ............ 389
E
12.4.4IfYouDon¡¯tHaveaPostScriptPrinter...... 390
12.4.5GreekLettersinGraphs .............. 390
12.5 Exercises........................... 392
12.6 Solutions........................... 394
13 S-Plus Internals 401
13.1 How S-Plus Works Under UNIX ............. 401
13.1.1TheWorkingChapter ............... 402
13.1.2CustomizationonStart-UpandExit ....... 402
13.2 How S-Plus WorksUnderWindows ........... 404
13.2.1CommandLineOptions .............. 404
13.2.2Start-upandExitFunctions............ 405
13.2.3HowtheScriptWindowworks........... 406
13.3 StoringMechanism ..................... 407
13.4 LevelsofCalls........................ 408
13.5 Exercises........................... 410
13.6 Solutions........................... 411
Contents xv
14 Information Sources on and Around S-Plus 413
14.1 Insightful........................... 413
14.2 S-News: Exchanging Information with Other Users . . . 414
14.3 The StatLib Server ..................... 414
14.4 WhatNext?......................... 415
15 R 417
15.1 Development......................... 418
15.2 Some Similarities Between R and S ............ 418
15.3 Some Di?erences Between R and S ............ 418
15.3.1Language ...................... 419
15.3.2Libraries....................... 420
15.3.3 Trellis-Type Graphs ................. 420
15.3.4ColorsandLines .................. 421
15.3.5 Data Import and Export Formats ......... 421
15.3.6MemoryHandling.................. 421
15.3.7MathematicalFormulaeinGraphs ........ 421
15.3.8GraphicalUserInterfaces.............. 421
15.3.9Start-UpMechanism ................ 422
15.3.10WindowsIntegration ................ 422
15.3.11Support ....................... 422
15.4 Summary........................... 423
16 Bibliography 425
16.1 PrintBibliography ..................... 425
16.2 On-LineBibliography.................... 427
16.2.1 S-Plus RelatedSources .............. 427
16.2.2 T X-RelatedSources ................ 429
E
16.2.3OtherSources.................... 429
Index 431


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-23 16:06 , Processed in 0.024565 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表