下载全文:
Longhow Lam: An introduction to S-Plus for Windows>>>
Contents
CONTENTS........5
1. Introduction....................10
1.1 INSTALLATION................11
1.1.1 System requirements11
1.1.2 The S-PLUS network version.........11
1.1.3 Directory choices.....12
1.1.4 Excel add-in and SPSS Link..........12
1.1.5 Acrobat Reader........12
1.1.6 S-PLUS-Libraries....12
1.2 STARTING S-PLUS..........12
1.3 OTHER PRODUCTS BASED ON S AND S-PLUS..............13
1.3.1 S-PLUS for UNIX and Linux.........13
1.3.2 The S-PLUS standard edition........13
1.3.3 S-PLUS modules......13
1.3.4 StatServer and S-PLUS analytical Server...........14
2. Help and documentation.....................15
2.1 ONLINE DOCUMENTATION.....................15
2.2 ONLINE HELP INFORMATION..................15
2.3 BOOKS......15
2.4 RESOURCES ON THE WEB.17
3. Importing data...............18
3.1 IMPORT.....18
3.2 IMPORT OPTIONS.............20
3.2.1 Column and row names, data block location.......21
3.2.2 Delimiters...............21
3.2.3 Importing characters.....................21
3.3 FILTERING DATA.............22
3.3.1 Filter expressions....22
3.3.2 Block reads and writes..................22
4. Managing objects and projects...........23
4.1 INTRODUCTION...............23
4.2 THE WORKING DATABASE, A CHAPTER AND THE SEARCHPATH.........23
4.2.1 Selecting a working database to work with.........24
4.2.2 Starting S-PLUS in a new Chapter25
4.2.3 The SearchPath.......25
4.2.4 Masked objects........28
4.3 THE OBJECT EXPLORER...28
4.3.1 Folder filters...........29
4.3.2 Creating new folders.....................30
4.3.3 Object Explorer pages...................31
4.3.4 Right pane settings...32
4.3.5 Saving an Object Explorer............32
4.3.6 Searching for objects in the Object Explorer......32
5. Data in S-PLUS..............35
5.1 DATA WINDOWS............35
5.1.1 Hot spots in data windows.............35
5.2 DATA TYPES AND DATA STRUCTURES....37
5.2.1 Data types...............37
5.2.2 Data structures.......37
5.3 DATA ENTRY IN DATA WINDOWS...........38
5.3.1 Typing in data..........38
5.3.2 Changing data types39
5.3.3 Copying and pasting data..............40
5.3.4 Importing data.........40
5.3.5 Generating data.......40 5
5.3.6 Moving data.............42
5.4 MANIPULATING DATA.....44
5.4.1 Merging data frames.....................44
5.4.2 Recode values..........46
5.4.3 Splitting data...........47
5.4.4 Create categories.....47
5.4.5 Stack and unstack....49
5.4.6 Creating subsets......51
5.4.7 Selecting cases by name................53
5.4.8 Creating missing values.................54
5.5 USING EXCEL DATA MANIPULATION FEATURES...........54
5.5.1 Opening a new Excel sheet in S-PLUS................55
5.5.2 Linking the Excel data to S-PLUS.58
5.5.3 Opening existing Excel worksheets.....................61
5.6 EXPORTING DATA............61
5.6.1 Export options and Filter..............61
6. Creating graphics...........63
6.1 INTRODUCTION...............63
6.2 TWO-DIMENSIONAL GRAPHS..................63
6.2.1 Plot buttons.............63
6.2.2 Scatter plot with linear fit..............64
6.2.3 Interactive graphics.64
6.2.4 A graph as object.....66
6.3 FURTHER POSSIBILITIES WITH S-PLUS GRAPHS..........67
6.3.1 Adding objects.........67
6.3.2 Adding titles and texts....................67
6.3.3 Adding symbols........67
6.3.4 Identifying points.....67
6.3.5 Scaling Axes.............69
6.3.6 Setting tickmarks and labels on the axes.............69
6.4 MULTIPLE GRAPHS..........74
6.4.1 Add an extra plot to an existing one....................74
6.4.2 Inserting a second Y axis...............75
6.4.3 Multiple graphs on one graphsheet.....................77
6.4.4 Multi page Graphsheets.................78
6.5 TRELLIS GRAPHICS.........79
6.5.1 Introduction............79
6.5.2 Further examples.....81
6.6 THREE-DIMENSIONAL GRAPHS...............83
6.6.1 Surface plot.............83
6.6.2 2D graphs in a 3D graph...............84
6.6.3 A 3D scatter plot with text.............85
6.7 EXPORTING GRAPHS........87
6.7.1 S-PLUS graphsheet format............87
6.7.2 Other formats..........87
6.7.3 Copy and Paste........88
6.7.4 The PowerPoint presentation Wizard..................88
6.8 GRAPHING EXCEL DATA..88
6.8.1 Drag and drop.........88
6.8.2 The S-PLUS add-in..89
6.8.3 Excel Active Document Support....90
7. Statistics using the GUI.91
7.1 INTRODUCTION...............91
7.2 AN OVERVIEW OF THE STATISTICS MENU IN S-PLUS...91
7.3 BASIC STATISTICS...........94
7.3.1 Summary statistics...94
7.3.2 Correlations............95
7.4 COMPARING SAMPLES.....95
7.4.1 One sample.............95
7.4.2 Two or more samples.....................97 6
7.5 STATISTICAL MODELS......99
7.5.1 Linear regression...100
7.5.2 Survival analysis....105
7.5.3 Linear mixed effects models.........111
7.5.4 Nonlinear Regression..................115
8. The basics of the S programming language...........119
8.1 INTRODUCTION.............119
8.2 THE COMMANDS WINDOW AND SCRIPT FILE.............119
8.3 DATA OBJECTS.............122
8.3.1 Data types.............122
8.3.2 Data Structures......127
8.4 DATA MANIPULATION....135
8.4.1 Vector subscripts...135
8.4.2 Matrix subscripts...137
8.4.3 Data frames...........139
8.4.4 Other useful functions to manipulate data frames...................140
8.4.5 Attributes..............142
8.4.6 Character manipulation..............143
8.4.7 Creating factors from continuous data..............145
8.5 GRAPHICAL FUNCTIONS.145
8.5.1 Traditional graphics vs. editable object oriented graphics.....145
8.5.2 Traditional graphics....................146
8.5.3 Graphical parameters..................150
8.5.4 Trellis graphics......157
9. Further possibilities with the S language...............161
9.1 STATISTICS AND THE S LANGUAGE......161
9.1.1 Basic Statistics.......161
9.1.2 Formula objects.....164
9.1.3 Linear regression models............166
9.1.4 Factor (categorical) variables as regression variables...........169
9.1.5 Cox proportional hazards models.....................171
9.1.6 Nonlinear regression...................173
9.2 WRITING FUNCTIONS.....176
9.2.1 Introduction..........176
9.2.2 Function arguments and return value...............177
9.2.3 Control Flow.........178
9.3 EFFICIENT CALCULATIONS...................180
9.3.1 Vectorized calculations................180
9.3.2 The apply and outer functions.....181
9.4 GENERATING SCRIPTS AND S-PLUS CODE.................184
9.4.1 Introduction..........184
9.4.2 Creating the same plot for different data sets....185
9.4.3 Importing files from a directory..186
9.5 BLOCK READS AND WRITES.................187
9.5.1 Minimum and maximum..............188
9.5.2 Scatter plot.............188
10. Modifying the graphical user interface (GUI).....190
10.1 INTRODUCTION...........190
10.2 CREATING NEW MENUS191
10.3 CREATING NEW TOOLBARS................194
10.4 CREATING NEW DIALOGS...................196
10.5 VIEWING EXISTING DIALOGS IN THE OBJECT EXPLORER................205
10.6 S-PLUS FUNCTIONS FOR EXTENDING THE USER INTERFACE..........206
10.7 DEPLOYING AND REMOVING CUSTOMIZED USER INTERFACES........208
10.7.1 Deploying...........208
10.7.2 Removing............208
Appendix A Plot toolbars....................210
2D PLOTS.....210
Pie plot....210 7
Grouped Bar Charts.......211
Box plots..212
3D PLOTS.....213
ANNOTATIONS...................214
Appendix B Preferences215
Appendix C What’s new in S-PLUS 6 for Windows....................218
Appendix D Exercises....221
INDEX.........229