An Introduction To S And The Hmisc And Design Libraries-Books Pdf

An Introduction to S and the Hmisc and Design Libraries
23 May 2020 | 18 views | 0 downloads | 310 Pages | 2.23 MB

Share Pdf : An Introduction To S And The Hmisc And Design Libraries

Download and Preview : An Introduction To S And The Hmisc And Design Libraries

Report CopyRight/DMCA Form For : An Introduction To S And The Hmisc And Design Libraries



Transcription

Updates to this document may be obtained from biostat mc vanderbilt edu RS sintro pdf. 1 Introduction 1, 1 1 S S Plus R and Source References 1. 1 2 Starting S 4, 1 2 1 UNIX Linux 4, 1 2 2 Windows 5. 1 3 Commands vs GUIs 7, 1 4 Basic S Commands 7, 1 5 Methods for Entering and Saving S Commands 9. 1 5 1 Specifying System File Names in S 11, 1 6 Differences Between S and SAS 11. 1 7 A Comparison of UNIX Linux and Windows for Running S 18. 1 8 System Requirements 19, 1 9 Some Useful System Tools 19.
2 Objects Getting Help Functions Attributes and Libraries 25. 2 1 Objects 25, 2 2 Getting Help 25, 2 3 Functions 29. 2 4 Vectors 30, 2 4 1 Numeric Character and Logical Vectors 31. 2 4 2 Missing Values and Logical Comparisons 32, 2 4 3 Subscripts and Index Vectors 33. 2 5 Matrices Lists and Data Frames 34, 2 5 1 Matrices 34. 2 5 2 Lists 36, 2 5 3 Data Frames 38, 2 6 Attributes 39.
2 6 1 The Class Attribute and Factor Objects 40, 2 6 2 Summary of Basic Object Types 42. 2 7 When to Quote Constants and Object Names 43, 2 8 Function Libraries 44. 2 9 The Hmisc Library 45, 2 10 Installing Add on Libraries 51. iv CONTENTS, 2 11 Accessing Add On Libraries Automatically 52. 3 Data in S 53, 3 1 Importing Data 53, 3 2 Reading Data into S 53.
3 2 1 Reading Raw Data 53, 3 2 2 Reading S Plus Data into R 54. 3 2 3 Reading SAS Datasets 55, 3 2 4 Handling Date Variables in R 62. 3 3 Displaying Metadata 63, 3 4 Adjustments to Variables after Input 64. 3 5 Writing Out Data 65, 3 5 1 Writing ASCII files 65. 3 5 2 Transporting S Data 66, 3 5 3 Customized Printing 66.
3 5 4 Sending Output to a File 67, 3 6 Using the Hmisc Library to Inspect Data 67. 4 Operating in S 71, 4 1 Reading and Writing Data Frames and Variables 71. 4 1 1 The attach and detach Functions 72, 4 1 2 Subsetting Data Frames 76. 4 1 3 Adding Variables to a Data Frame without Attaching 78. 4 1 4 Deleting Variables from a Data Frame 78, 4 1 5 A Better Approach to Changing Data Frames upData 78. 4 1 6 assign and store 80, 4 2 Managing Project Data in R 81.
4 2 1 Accessing Remote Objects and Different Objects with the Same Names 82. 4 2 2 Documenting Data Frames 83, 4 2 3 Accessing Data in Windows S Plus 84. 4 3 Miscellaneous Functions 85, 4 3 1 Functions for Sorting 85. 4 3 2 By Processing 85, 4 3 3 Sending Multiple Variables to Functions Expecting only One 88. 4 3 4 Functions for Data Manipulation and Management 89. 4 3 5 Merging Data Frames 93, 4 3 6 Merging Baseline Data with One Number Summaries of Follow up Data 94. 4 3 7 Constructing More Complex Summaries of Follow up Data 94. 4 3 8 Subsetting a Data Frame by Examining Repeated Measurements 96. 4 3 9 Converting Between Matrices and Vectors Re shaping Serial Data 97. 4 3 10 Computing Changes in Serial Observations 101. 4 4 Recoding Variables and Creating Derived Variables 103. 4 4 1 The score binary Function 106, 4 4 2 The recode Function 106.
4 4 3 Should Derived Variables be Stored Permanently 107. 4 5 Review of Data Frame Creation Annotation and Analysis 108. CONTENTS v, 4 6 Dealing with Many Data Frames Simultaneously 110. 4 7 Missing Value Imputation using Hmisc 112, 4 8 Using S for Simulations and Bootstrapping 115. 5 Probability and Statistical Functions 123, 5 1 Basic Functions for Statistical Summaries 123. 5 2 Functions for Probability Distributions 126, 5 3 Hmisc Functions for Power and Sample Size Calculations 129. 5 4 Statistical Tests 135, 5 4 1 Nonparametric Tests 136.
5 4 2 Parametric Tests 138, 6 Making Tables 141, 6 1 S Plus supplied Functions 141. 6 2 The Hmisc summary formula Function 144, 6 2 1 Implementing Other Interfaces 150. 6 3 Graphical Depiction of Two Way Contingency Tables 151. 7 Hmisc Generalized Least Squares Modeling Functions 153. 7 1 Automatically Transforming Predictor and Response Variables 153. 7 2 Robust Serial Data Models Time and Dose Response Profiles 163. 7 2 1 Example 165, 8 Builtin S Functions for Multiple Linear Regression 169. 8 1 Sequential and Partial Sums of Squares and F tests 172. 9 The Design Library of Modeling Functions 175, 9 1 Statistical Formulas in S 175. 9 2 Purposes and Capabilities of Design 176, 9 2 1 Differences Between lm Builtin and Design s ols Function 181.
9 3 Examples of the Use of Design 181, 9 3 1 Examples with Graphical Output 181. 9 3 2 Binary Logistic Modeling with the Prostate Data Frame 194. 9 3 3 Troubleshooting Problems with factor Predictors 197. 9 3 4 A Comprehensive Hypothetical Example 198, 9 3 5 Using Design and Interactive Graphics to Generate Flexible Functions 200. 9 4 Checklist of Problems to Avoid When Using Design 201. 9 5 Describing Representation of Subjects 202, 10 Principles of Graph Construction 203. 10 1 Graphical Perception 203, 10 2 General Suggestions 204. 10 3 Tufte on Chartjunk 205, 10 4 Tufte s Views on Graphical Excellence 205.
10 5 Formatting 205, 10 6 Color Symbols and Line Styles 206. vi CONTENTS, 10 7 Scaling 206, 10 8 Displaying Estimates Stratified by Categories 206. 10 9 Displaying Distribution Characteristics 207, 10 10Showing Differences 207. 10 11Choosing the Best Graph Type 208, 10 11 1 Single Categorical Variable 208. 10 11 2 Single Continuous Numeric Variable 209, 10 11 3 Categorical Response Variable vs Categorical Ind Var 209.
10 11 4 Categorical Response vs a Continuous Ind Var 209. 10 11 5 Continuous Response Variable vs Categorical Ind Var 209. 10 11 6 Continuous Response vs Continuous Ind Var 209. 10 12Conditioning Variables 209, 11 Graphics in S 213. 11 1 Overview 213, 11 2 Adding Text or Legends and Identifying Observations 220. 11 3 Hmisc and Design High Level Plotting Functions 223. 11 4 trellis Graphics 227, 11 4 1 Multiple Response Variables and Error Bars 234. 11 4 2 Multiple x axis Variables and Error Bars in Dot Plots 236. 11 4 3 Using summarize with trellis 236, 11 4 4 A Summary of Functions for Aggregating Data for Plotting 238. 12 Controlling Graphics Details 241, 12 1 Graphics Parameters 241.
12 1 1 The Graphics Region 243, 12 1 2 Controlling Text and Margins 244. 12 1 3 Controlling Plotting Symbols 247, 12 1 4 Multiple Plots 251. 12 1 5 Skipping Over Plots 251, 12 1 6 A More Flexible Layout 251. 12 1 7 Controlling Axes 253, 12 1 8 Overlaying Figures 256. 12 2 Specifying a Graphical Output Device 260, 12 2 1 Opening Graphics Windows 261.
12 2 2 The postscript ps slide setps setpdf Functions 261. 12 2 3 The win slide and gs slide Functions 263, 12 2 4 Inserting S Graphics into Microsoft Office Documents 263. 13 Managing Batch Analyses and Writing Your Own Functions 265. 13 1 Using S in Batch Mode 265, 13 1 1 Batch Jobs in UNIX 265. 13 1 2 Batch Jobs in Windows 267, 13 2 Managing S Non Interactive Programs 267. 13 3 Reproducible Analysis 279, 13 4 Reproducible Reports 282. CONTENTS vii, 13 5 Writing Your Own Functions 282, 13 5 1 Some Programming Commands 282.
13 5 2 Creating a New Function 283, 13 6 Customizing Your Environment 284. viii CONTENTS, List of Tables, 1 1 Comparisons of SAS and S 12. 1 2 SAS Procedures and Corresponding S Functions 18. 2 1 Comparison of Some S Objects 42, 4 1 Functions for Sorting 85. 4 2 Functions for Data Manipulation and Management 90. 5 1 Functions for Statistical Summaries 124, 5 2 Probability Distribution Functions 127. 5 3 Hmisc Functions for Power Sample Size 129, 5 4 S Functions for Statistical Tests 135.
6 1 Descriptive Statistics by Treatment 150, 9 1 Operators in Formulae 176. 9 2 Special fitting functions 178, 9 3 Functions for transforming predictor variables in models 178. 9 4 Generic Functions and Methods 179, 9 5 Generic Functions and Methods 180. 11 1 Non trellis High Level Plotting Functions 224. 12 1 Low Level Plotting Functions 242, x LIST OF TABLES. List of Figures, 5 1 Characteristics of control and intervention groups 134.
6 1 A two way contingency table 152, 7 1 Transformations estimated by avas 157. 7 2 Distribution of residuals from avas fit 159, 7 3 avas transformation vs reciprocal 159. 7 4 Predicted median glyhb as a function of age and chol 162. 7 5 Nonparametric estimates of time trends for individual subjects 166. 7 6 Bootstrap estimates of time trends 167, 7 7 Simultaneous and pointwise bootstrap confidence regions 168. 9 1 Cholesterol interacting with categorized age 182. 9 2 Restricted cubic spline surface in two variables each with k 4 knots 184. 9 3 Fit with age spline cholesterol and cholesterol spline age 185. 9 4 Spline fit with simple product interaction 186. 9 5 Predictions from linear interaction model with mean age in tertiles indicated 187. 9 6 Summary of model using odds ratios and inter quartile range odds ratios 188. 9 7 Cox PH model stratified on sex with interaction between age spline and sex 191. 9 8 Nomogram from fitted Cox model 192, 9 9 Nomogram from fitted Cox model 193. 10 1 Error bars for individual means and differences 208. 11 1 Basic Plot 214, 11 2 Basic Plot with Labels and Title 215.
11 3 Plotting a Factor 216, 11 4 Example of Boxplot 216. 11 5 Example of Plot on a Fitted Model 218, 11 6 Overriding datadist Values 219. 11 7 Example of Co Plot 220, 11 8 Identifying Observations 222. 11 9 datadensity plot for the prostate data frame 225. 11 10Box percentile plot 227, xii LIST OF FIGURES, 11 11Extended box plot for titanic data Shown are the median mean solid dot and. quantile intervals containing 0 25 0 5 0 75 and 0 9 of the age distribution 231. 11 12Multi panel trellis graph produced by the Hmisc ecdf function 232. 12 1 Plot Region 244, 12 2 Text in margins 248, 12 3 Plotting Symbols 250.
12 4 Different Types of Lines 250, 12 5 Flexible layout using mfg 252. 12 6 Controlling Axis Labels Style 254, 12 7 Examples of tick marks 256. 12 8 Use of axis 258, 12 9 Overlaying high level plots 259. 12 10Example of subplot 260, 12 11Another subplot example 261. Introduction, 1 1 S S Plus R and Source References.
S Plus and R are supersets of the S language1 an interactive programming environment for data. analysis and graphics Insightful Corporation in Seattle took the AT T Bell Labs S code and. enhanced it producing many new statistical functions and graphical interfaces In this text we use. S to refer to both S Plus and R languages, S is a unique combination of a powerful language and flexible high quality graphics functions. What is most important about S is that it was designed to be extendable Insightful AT T now. Lucent Technologies and a large community of S Plus users and R developers and users are con. stantly adding new capabilities to the system all using the same high level language S allows users. to take advantage of an explosion of powerful new data analysis and statistical modeling techniques. The richness of the S language and its planned extendability allow users to perform comprehensive. analyses and data explorations with a minimum of programming As an example S functions in the. Design library see Chapter 9 can perform analyses and make graphical representations that would. take pages of programming in other systems if they could be done at all. 1 S which may stand for statistics was developed by the same lab that developed the C language. 2 CHAPTER 1 INTRODUCTION, Fit binary logistic model without assuming linearity for age or. equal shapes of the age relationship for the two sexes. Represent age using a restricted cubic spline function with 4 knots. This requires 3 age parameters per sex Model has intercept 6. coefficients x T y T causes design matrix and response vector to. be stored in the fit object f This allows certain residuals to be. computed later and it allows the original data to be re analyzed. later e g bootstrapping and cross validation, f lrm death rcs age 4 sex x T y T. Test for age sex interaction 3 d f linearity in age 4 d f. overall age effect 6 d f overall sex effect 4 d f, linearity of age interaction with sex 2 d f. Compute the 60 40 year odds ratio for females, summary f age c 40 60 sex female.
Plot the age effects separately by sex with confidence bands. plot f age NA sex NA, Validate the model using the bootstrap check for overfitting. validate f, Draw a nomogram depicting the model adding an axis for the. predicted probability of death, nomogram f fun plogis funlabel Prob death. Get predicted log odds of death for 40 year old male. predict f data frame age 40 sex male, Make a new S Plus function which analytically computes predicted. values from the fitted model, g Function f, Use this function to duplicate the above prediction for 40 year old male.
g age 40 sex male, By making a high level language the cornerstone of S you could say that S is designed to be. inefficient for some applications from a pure CPU time point of view However computer time. is inexpensive in comparison with personnel time and analysts who have learned S can be very. much more productive in doing data analyses They can usually do more complex and exploratory. analyses in the same time that standard analyses take using other systems. In its most simple use S is an interactive calculator Commands are executed or debugged. as they are entered The S language is based on the use of functions to perform calculations open. graphics windows set system options and even for exi. enhanced it producing many new statistical functions and graphical interfaces In this text we use S to refer to both S Plus and R languages S is a unique combination of a powerful language and exible high quality graphics functions

Related Books

A COMPARATIVE STUDY ON FINANCIAL PERFORMANCE OF PRIVATE

A COMPARATIVE STUDY ON FINANCIAL PERFORMANCE OF PRIVATE

GTU is permitted to archive reproduce and distribute my thesis in whole or in part and or my abstract in whole or in part referred to collectively as the Work anywhere in the world for non commercial purposes in all forms of media b GTU is permitted to authorize sub lease sub contract or procure any of the acts mentioned in paragraph a c GTU is authorized to submit the

Configuring Private Hosts Cisco

Configuring Private Hosts Cisco

Configuring Private Hosts This chapter describes how to configure the private hosts feature in Cisco IOS Release 12 2SX Note For complete syntax and usage information for the commands used in this chapter see the Cisco IOS

11 Semejanza Teorema de Thales y Pit goras

11 Semejanza Teorema de Thales y Pit goras

TEMA 11 SEMEJANZA TEOREMA DE THALES Y PIT GORAS 285 Grupo Editorial Bru o S L 2 Teorema de Thales Mediante la t cnica de cuadriculado haz un avi n

11 Funciones 11 IES LA BAS LICA MATEM TICAS

11 Funciones 11 IES LA BAS LICA MATEM TICAS

11 Funciones 334 Unidades did cticas Matem ticas orientadas a las ense anzas acad micas 3 ESO E n esta unidad trataremos el estudio a trav s de relaciones funcionales de la interpretaci n representaci n y tratamiento de la informa ci n En cursos anteriores los alumnos han ido conociendo algunos tipos de funciones abordaremos conceptos nuevos b sicos que los alumnos deber n

TEMA 11 REPRESENTACI N DE FUNCIONES

TEMA 11 REPRESENTACI N DE FUNCIONES

Tema 11 Representaci n de funciones Matem ticas II 2 Bachillerato 3 EJERCICIO 4 Representa la funci n 4 3x 8x f x 4 3 Soluci n Dominio R Simetr as No es par ni impar no es sim trica respecto al eje Y ni respecto 4 3x 8x f x 4 3 al origen

MATEM TICAS TEMA 11 12

MATEM TICAS TEMA 11 12

TEMA 11 12 Inferencia Estad stica 4 Como todas las distribuciones normales tienen propiedades comunes respecto de sus par metros se puede reducir una de ellas a cualquier otra mediante un cambio de variable que ajuste los par metros de ambas Por tanto basta tener las tablas de una nica distribuci n normal para poder calcular probabilidades de otra Se han elaborado las tablas de

STRATEGI KOMUNIKASI DINAS SOSIAL KOTA MAKASSAR DALAM

 STRATEGI KOMUNIKASI DINAS SOSIAL KOTA MAKASSAR DALAM

STRATEGI KOMUNIKASI DINAS SOSIAL KOTA MAKASSAR DALAM UPAYA PEMBERDAYAAN MASYARAKAT DI TAMANGAPA KECAMATAN MANGGALA Skripsi Diajukan untuk Memenuhi Salah Satu Syarat Meraih Gelar Sarjana Sosial Jurusan Ilmu Komunikasi pada Fakultas Dakwah dan Komunikasi UIN Alauddin Makassar Oleh Andi Nurhikmawati NIM 50700111002 FAKULTAS DAKWAH DAN KOMUNIKASI UIN ALAUDDIN MAKASSAR 2015 2 20 3 KATA

STRATEGI PEMBERDAYAAN EKONOMI KERAKYATAN

STRATEGI PEMBERDAYAAN EKONOMI KERAKYATAN

STRATEGI PEMBERDAYAAN EKONOMI KERAKYATAN Oleh Natalia Artha Malau SE M Si Dosen Fakultas Ekonomi Universitas Negeri Manado Abstrak Penulisan makalah ini bertujuan untuk mengetahui strategi pemberdayaan ekonomi kerakyatan Penulisan makalah ini menggunakan metode tinjauan literatur library research Dari pembahasan dapat disimpulkan bahwa roh dari ekonomi kerakyatan adalah bagaimana

PEMBERDAYAAN MASYARAKAT Pendekatan Teoritis

PEMBERDAYAAN MASYARAKAT Pendekatan Teoritis

implikasinya terhadap strategi dan program pemberdayaan yang diterapkan di lapangan Untuk mempermudah pemahaman diakhir tulisan ini digambarkan sebuah tabel yang menjelaskan perbedaan perbedaan yang signifikan dari paradigma dan teori yang berpengaruh terhadap pandangan mengenai pemberdayaan masyarakat ini B Sejarah Kemunculan Konsep Pemberdayaan Masyarakat Empowerment atau pemberdayaan

STRATEGI PENGEMBANGAN DESA WISATA MELALUI PEMBERDAYAAN

STRATEGI PENGEMBANGAN DESA WISATA MELALUI PEMBERDAYAAN

PEMBERDAYAAN MASYARAKAT DESA KETENGER BATURRADEN SKRIPSI Diajukan kepada Fakultas Ekonomi dan Bisnis Islam IAIN Purwokerto Untuk Memenuhi Salah Satu Syarat Guna Memperoleh Gelar Sarjana Ekonomi S E Oleh RIMAS MARTIARINI NIM 1323203084 JURUSAN EKONOMI SYARIAH FAKULTAS EKONOMI DAN BISNIS ISLAM INSTITUT AGAMA ISLAM NEGERI PURWOKERTO 2017 ii STRATEGI PENGEMBANGAN DESA WISATA MELALUI

STRATEGI PEMBERDAYAAN PETANI DALAM BERUSAHATANI

STRATEGI PEMBERDAYAAN PETANI DALAM BERUSAHATANI

1 1 Strategi Pemberdayaan Kegiatan pemberdayaan masyarakat adalah suatu kegiatan yang memiliki tujuan yang jelas dan harus dicapai oleh sebab itu setiap pelaksanaan pemberdayaan masyarakat perlu dilandasi dengan strategi kerja tertentu demi keberhasilannya untuk mencapai tujuan yang diinginkan Dalam