List of figures |
|
xvii | |
List of tables |
|
xix | |
Preface to the second edition |
|
xxi | |
Preface to the first edition |
|
xxiii | |
1 Data input and output |
|
1 | (16) |
|
|
1 | (10) |
|
|
1 | (1) |
|
1.1.2 Fixed format text files |
|
|
2 | (1) |
|
|
3 | (1) |
|
1.1.4 Reading more complex text files |
|
|
3 | (1) |
|
1.1.5 Comma separated value (CSV) files |
|
|
4 | (1) |
|
1.1.6 Read sheets from an Excel file |
|
|
5 | (1) |
|
1.1.7 Read data from R into SAS |
|
|
5 | (1) |
|
1.1.8 Read data from SAS into R |
|
|
6 | (1) |
|
1.1.9 Reading datasets in other formats |
|
|
6 | (1) |
|
1.1.10 Reading data with a variable number of words in a field |
|
|
7 | (1) |
|
1.1.11 Read a file byte by byte |
|
|
8 | (1) |
|
1.1.12 Access data from a URL |
|
|
9 | (1) |
|
1.1.13 Read an XML-formatted file |
|
|
9 | (1) |
|
|
10 | (1) |
|
|
11 | (4) |
|
|
11 | (1) |
|
1.2.2 Number of digits to display |
|
|
11 | (1) |
|
1.2.3 Save a native dataset |
|
|
12 | (1) |
|
1.2.4 Creating datasets in text format |
|
|
12 | (1) |
|
1.2.5 Creating Excel spreadsheets |
|
|
12 | (1) |
|
1.2.6 Creating files for use by other packages |
|
|
13 | (1) |
|
1.2.7 Creating HTML formatted output |
|
|
14 | (1) |
|
1.2.8 Creating XML datasets and output |
|
|
14 | (1) |
|
|
15 | (2) |
2 Data management |
|
17 | (36) |
|
2.1 Structure and meta-data |
|
|
17 | (2) |
|
2.1.1 Access variables from a dataset |
|
|
17 | (1) |
|
2.1.2 Names of variables and their types |
|
|
17 | (1) |
|
2.1.3 Values of variables in a dataset |
|
|
18 | (1) |
|
|
18 | (1) |
|
2.1.5 Add comment to a dataset or variable |
|
|
19 | (1) |
|
2.2 Derived variables and data manipulation |
|
|
19 | (10) |
|
2.2.1 Add derived variable to a dataset |
|
|
19 | (1) |
|
2.2.2 Rename variables in a dataset |
|
|
19 | (1) |
|
2.2.3 Create string variables from numeric variables |
|
|
20 | (1) |
|
2.2.4 Create categorical variables from continuous variables |
|
|
20 | (1) |
|
2.2.5 Recode a categorical variable |
|
|
21 | (1) |
|
2.2.6 Create a categorical variable using logic |
|
|
21 | (1) |
|
2.2.7 Create numeric variables from string variables |
|
|
22 | (1) |
|
2.2.8 Extract characters from string variables |
|
|
23 | (1) |
|
2.2.9 Length of string variables |
|
|
23 | (1) |
|
2.2.10 Concatenate string variables |
|
|
24 | (1) |
|
|
24 | (1) |
|
2.2.12 Find strings within string variables |
|
|
25 | (1) |
|
2.2.13 Find approximate strings |
|
|
25 | (1) |
|
2.2.14 Replace strings within string variables |
|
|
26 | (1) |
|
2.2.15 Split strings into multiple strings |
|
|
26 | (1) |
|
2.2.16 Remove spaces around string variables |
|
|
27 | (1) |
|
2.2.17 Upper to lower case |
|
|
27 | (1) |
|
|
28 | (1) |
|
2.2.19 Formatting values of variables |
|
|
28 | (1) |
|
|
29 | (1) |
|
2.2.21 Accessing databases using SQL (structured query language) |
|
|
29 | (1) |
|
2.3 Merging, combining, and subsetting datasets |
|
|
29 | (8) |
|
2.3.1 Subsetting observations |
|
|
30 | (1) |
|
2.3.2 Drop or keep variables in a dataset |
|
|
30 | (1) |
|
2.3.3 Random sample of a dataset |
|
|
31 | (1) |
|
|
32 | (1) |
|
|
32 | (1) |
|
2.3.6 Identify duplicated values |
|
|
32 | (1) |
|
2.3.7 Convert from wide to long (tall) format |
|
|
33 | (1) |
|
2.3.8 Convert from long (tall) to wide format |
|
|
34 | (1) |
|
2.3.9 Concatenate and stack datasets |
|
|
35 | (1) |
|
|
35 | (1) |
|
|
35 | (2) |
|
2.4 Date and time variables |
|
|
37 | (2) |
|
2.4.1 Create date variable |
|
|
37 | (1) |
|
|
38 | (1) |
|
|
38 | (1) |
|
|
38 | (1) |
|
|
38 | (1) |
|
2.4.6 Create time variable |
|
|
39 | (1) |
|
|
39 | (1) |
|
|
39 | (14) |
|
2.6.1 Data input and output |
|
|
39 | (4) |
|
|
43 | (1) |
|
2.6.3 Derived variables and data manipulation |
|
|
44 | (7) |
|
2.6.4 Sorting and subsetting datasets |
|
|
51 | (2) |
3 Statistical and mathematical functions |
|
53 | (18) |
|
3.1 Probability distributions and random number generation |
|
|
53 | (6) |
|
3.1.1 Probability density function |
|
|
53 | (1) |
|
3.1.2 Quantiles of a probability density function |
|
|
54 | (1) |
|
3.1.3 Setting the random number seed |
|
|
55 | (1) |
|
3.1.4 Uniform random variables |
|
|
55 | (1) |
|
3.1.5 Multinomial random variables |
|
|
56 | (1) |
|
3.1.6 Normal random variables |
|
|
56 | (1) |
|
3.1.7 Multivariate normal random variables |
|
|
56 | (2) |
|
3.1.8 Truncated multivariate normal random variables |
|
|
58 | (1) |
|
3.1.9 Exponential random variables |
|
|
58 | (1) |
|
3.1.10 Other random variables |
|
|
58 | (1) |
|
3.2 Mathematical functions |
|
|
59 | (4) |
|
|
59 | (1) |
|
3.2.2 Trigonometric functions |
|
|
60 | (1) |
|
|
60 | (1) |
|
|
60 | (1) |
|
3.2.5 Comparisons of floating point variables |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
62 | (1) |
|
3.2.9 Optimization problems |
|
|
62 | (1) |
|
|
63 | (5) |
|
3.3.1 Create matrix from vector |
|
|
63 | (1) |
|
3.3.2 Combine vectors or matrices |
|
|
63 | (1) |
|
|
64 | (1) |
|
|
64 | (1) |
|
3.3.5 Find the dimension of a matrix or dataset |
|
|
64 | (1) |
|
3.3.6 Matrix multiplication |
|
|
65 | (1) |
|
|
65 | (1) |
|
3.3.8 Component-wise multiplication |
|
|
66 | (1) |
|
|
66 | (1) |
|
3.3.10 Create a diagonal matrix |
|
|
66 | (1) |
|
3.3.11 Create a vector of diagonal elements |
|
|
67 | (1) |
|
3.3.12 Create a vector from a matrix |
|
|
67 | (1) |
|
3.3.13 Calculate the determinant |
|
|
67 | (1) |
|
3.3.14 Find eigenvalues and eigenvectors |
|
|
67 | (1) |
|
3.3.15 Find the singular value decomposition |
|
|
68 | (1) |
|
|
68 | (3) |
|
3.4.1 Probability distributions |
|
|
68 | (3) |
4 Programming and operating system interface |
|
71 | (12) |
|
4.1 Control flow, programming, and data generation |
|
|
71 | (6) |
|
|
71 | (1) |
|
4.1.2 Conditional execution |
|
|
72 | (1) |
|
4.1.3 Sequence of values or patterns |
|
|
73 | (1) |
|
4.1.4 Referring to a range of variables |
|
|
74 | (1) |
|
4.1.5 Perform an action repeatedly over a set of variables |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
76 | (1) |
|
|
76 | (1) |
|
|
77 | (1) |
|
|
77 | (1) |
|
|
78 | (1) |
|
4.3 Interactions with the operating system |
|
|
78 | (5) |
|
|
78 | (1) |
|
4.3.2 Suspend execution for a time interval |
|
|
79 | (1) |
|
4.3.3 Execute a command in the operating system |
|
|
79 | (1) |
|
|
80 | (1) |
|
4.3.5 Find working directory |
|
|
80 | (1) |
|
4.3.6 Change working directory |
|
|
80 | (1) |
|
4.3.7 List and access files |
|
|
81 | (2) |
5 Common statistical procedures |
|
83 | (30) |
|
|
83 | (4) |
|
5.1.1 Means and other summary statistics |
|
|
83 | (1) |
|
|
84 | (1) |
|
|
84 | (1) |
|
|
85 | (1) |
|
5.1.5 Centering, normalizing, and scaling |
|
|
85 | (1) |
|
5.1.6 Mean and 95% confidence interval |
|
|
86 | (1) |
|
5.1.7 Proportion and 95% confidence interval |
|
|
86 | (1) |
|
5.1.8 Maximum likelihood estimation of parameters |
|
|
86 | (1) |
|
|
87 | (3) |
|
5.2.1 Epidemiologic statistics |
|
|
87 | (1) |
|
5.2.2 Test characteristics |
|
|
87 | (2) |
|
|
89 | (1) |
|
|
89 | (1) |
|
|
90 | (2) |
|
5.3.1 Display cross-classification table |
|
|
90 | (1) |
|
5.3.2 Displaying missing value categories in a table |
|
|
90 | (1) |
|
5.3.3 Pearson chi-square statistic |
|
|
91 | (1) |
|
5.3.4 Cochran—Mantel—Haenszel test |
|
|
91 | (1) |
|
|
91 | (1) |
|
5.3.6 Fisher's exact test |
|
|
92 | (1) |
|
|
92 | (1) |
|
5.4 Tests for continuous variables |
|
|
92 | (3) |
|
5.4.1 Tests for normality |
|
|
92 | (1) |
|
|
93 | (1) |
|
5.4.3 Test for equal variances |
|
|
93 | (1) |
|
5.4.4 Nonparametric tests |
|
|
94 | (1) |
|
|
94 | (1) |
|
|
95 | (1) |
|
5.5 Analytic power and sample size calculations |
|
|
95 | (2) |
|
|
97 | (1) |
|
|
97 | (16) |
|
5.7.1 Summary statistics and exploratory data analysis |
|
|
97 | (4) |
|
5.7.2 Bivariate relationships |
|
|
101 | (2) |
|
|
103 | (4) |
|
5.7.4 Two sample tests of continuous variables |
|
|
107 | (4) |
|
5.7.5 Survival analysis: logrank test |
|
|
111 | (2) |
6 Linear regression and ANOVA |
|
113 | (36) |
|
|
113 | (5) |
|
|
113 | (1) |
|
6.1.2 Linear regression with categorical covariates |
|
|
114 | (1) |
|
6.1.3 Changing the reference category |
|
|
114 | (1) |
|
6.1.4 Parameterization of categorical covariates |
|
|
115 | (1) |
|
6.1.5 Linear regression with no intercept |
|
|
116 | (1) |
|
6.1.6 Linear regression with interactions |
|
|
117 | (1) |
|
6.1.7 One-way analysis of variance |
|
|
117 | (1) |
|
6.1.8 Analysis of variance with two or more factors |
|
|
117 | (1) |
|
6.2 Tests, contrasts, and linear functions of parameters |
|
|
118 | (2) |
|
6.2.1 Joint null hypotheses: several parameters equal 0 |
|
|
118 | (1) |
|
6.2.2 Joint null hypotheses: sum of parameters |
|
|
118 | (1) |
|
6.2.3 Tests of equality of parameters |
|
|
119 | (1) |
|
6.2.4 Multiple comparisons |
|
|
119 | (1) |
|
6.2.5 Linear combinations of parameters |
|
|
120 | (1) |
|
|
120 | (4) |
|
|
120 | (1) |
|
|
121 | (1) |
|
6.3.3 Standardized and Studentized residuals |
|
|
121 | (1) |
|
|
122 | (1) |
|
|
122 | (1) |
|
|
123 | (1) |
|
|
123 | (1) |
|
6.3.8 Heteroscedasticity tests |
|
|
124 | (1) |
|
6.4 Model parameters and results |
|
|
124 | (4) |
|
6.4.1 Parameter estimates |
|
|
124 | (1) |
|
6.4.2 Standardized regression coefficients |
|
|
124 | (1) |
|
6.4.3 Standard errors of parameter estimates |
|
|
125 | (1) |
|
6.4.4 Confidence interval for parameter estimates |
|
|
125 | (1) |
|
6.4.5 Confidence limits for the mean |
|
|
125 | (1) |
|
|
126 | (1) |
|
|
127 | (1) |
|
6.4.8 Design and information matrix |
|
|
127 | (1) |
|
6.4.9 Covariance matrix of parameter estimates |
|
|
127 | (1) |
|
6.4.10 Correlation matrix of parameter estimates |
|
|
128 | (1) |
|
|
128 | (1) |
|
|
128 | (21) |
|
6.6.1 Scatterplot with smooth fit |
|
|
129 | (1) |
|
6.6.2 Linear regression with interaction |
|
|
130 | (5) |
|
6.6.3 Regression diagnostics |
|
|
135 | (3) |
|
6.6.4 Fitting the regression model separately for each value of another variable |
|
|
138 | (1) |
|
|
139 | (5) |
|
6.6.6 Multiple comparisons |
|
|
144 | (2) |
|
|
146 | (3) |
7 Regression generalizations and modeling |
|
149 | (62) |
|
7.1 Generalized linear models |
|
|
149 | (5) |
|
7.1.1 Logistic regression model |
|
|
149 | (2) |
|
7.1.2 Conditional logistic regression model |
|
|
151 | (1) |
|
7.1.3 Exact logistic regression |
|
|
152 | (1) |
|
7.1.4 Ordered logistic model |
|
|
152 | (1) |
|
7.1.5 Generalized logistic model |
|
|
152 | (1) |
|
|
153 | (1) |
|
7.1.7 Negative binomial model |
|
|
153 | (1) |
|
|
153 | (1) |
|
7.2 Further generalizations |
|
|
154 | (2) |
|
7.2.1 Zero-inflated Poisson model |
|
|
154 | (1) |
|
7.2.2 Zero-inflated negative binomial model |
|
|
154 | (1) |
|
7.2.3 Generalized additive model |
|
|
155 | (1) |
|
7.2.4 Nonlinear least squares model |
|
|
155 | (1) |
|
|
156 | (1) |
|
7.3.1 Quantile regression model |
|
|
156 | (1) |
|
7.3.2 Robust regression model |
|
|
156 | (1) |
|
7.3.3 Ridge regression model |
|
|
156 | (1) |
|
7.4 Models for correlated data |
|
|
157 | (6) |
|
7.4.1 Linear models with correlated outcomes |
|
|
157 | (1) |
|
7.4.2 Linear mixed models with random intercepts |
|
|
158 | (1) |
|
7.4.3 Linear mixed models with random slopes |
|
|
158 | (1) |
|
7.4.4 More complex random coefficient models |
|
|
159 | (1) |
|
|
160 | (1) |
|
7.4.6 Generalized linear models with correlated outcomes |
|
|
160 | (1) |
|
7.4.7 Generalized linear mixed models |
|
|
161 | (1) |
|
7.4.8 Generalized estimating equations |
|
|
161 | (1) |
|
|
162 | (1) |
|
|
162 | (1) |
|
|
163 | (3) |
|
7.5.1 Proportional hazards (Cox) regression model |
|
|
163 | (1) |
|
7.5.2 Proportional hazards (Cox) model with frailty |
|
|
163 | (1) |
|
7.5.3 Nelson—Aalen estimate of cumulative hazard |
|
|
164 | (1) |
|
7.5.4 Testing the proportionality of the Cox model |
|
|
164 | (1) |
|
7.5.5 Cox model with time-varying predictors |
|
|
165 | (1) |
|
7.6 Multivariate statistics and discriminant procedures |
|
|
166 | (2) |
|
|
166 | (1) |
|
|
166 | (1) |
|
7.6.3 Recursive partitioning |
|
|
166 | (1) |
|
7.6.4 Linear discriminant analysis |
|
|
167 | (1) |
|
7.6.5 Latent class analysis |
|
|
167 | (1) |
|
7.6.6 Hierarchical clustering |
|
|
168 | (1) |
|
7.7 Complex survey design |
|
|
168 | (1) |
|
7.8 Model selection and assessment |
|
|
169 | (3) |
|
|
169 | (1) |
|
|
170 | (1) |
|
7.8.3 Akaike Information Criterion (AIC) |
|
|
170 | (1) |
|
7.8.4 Bayesian Information Criterion (BIC) |
|
|
170 | (1) |
|
|
171 | (1) |
|
7.8.6 Hosmer—Lemeshow goodness of fit |
|
|
171 | (1) |
|
7.8.7 Goodness of fit for count models |
|
|
171 | (1) |
|
|
172 | (1) |
|
|
172 | (39) |
|
7.10.1 Logistic regression |
|
|
172 | (4) |
|
7.10.2 Poisson regression |
|
|
176 | (2) |
|
7.10.3 Zero-inflated Poisson regression |
|
|
178 | (2) |
|
7.10.4 Negative binomial regression |
|
|
180 | (1) |
|
7.10.5 Quantile regression |
|
|
181 | (1) |
|
|
182 | (1) |
|
7.10.7 Generalized logistic model |
|
|
183 | (2) |
|
7.10.8 Generalized additive model |
|
|
185 | (2) |
|
7.10.9 Reshaping a dataset for longitudinal regression |
|
|
187 | (3) |
|
7.10.10 Linear model for correlated data |
|
|
190 | (3) |
|
7.10.11 Linear mixed (random slope) model |
|
|
193 | (4) |
|
7.10.12 Generalized estimating equations |
|
|
197 | (2) |
|
7.10.13 Generalized linear mixed model |
|
|
199 | (1) |
|
7.10.14 Cox proportional hazards model |
|
|
200 | (1) |
|
|
201 | (1) |
|
|
202 | (3) |
|
7.10.17 Recursive partitioning |
|
|
205 | (1) |
|
7.10.18 Linear discriminant analysis |
|
|
206 | (2) |
|
7.10.19 Hierarchical clustering |
|
|
208 | (3) |
8 A graphical compendium |
|
211 | (30) |
|
|
211 | (4) |
|
|
211 | (1) |
|
|
212 | (1) |
|
|
212 | (1) |
|
|
213 | (1) |
|
|
213 | (1) |
|
8.1.6 Empirical cumulative probability density plot |
|
|
214 | (1) |
|
|
214 | (1) |
|
|
215 | (1) |
|
8.2 Univariate plots by grouping variable |
|
|
215 | (2) |
|
8.2.1 Side-by-side histograms |
|
|
215 | (1) |
|
8.2.2 Side-by-side boxplots |
|
|
215 | (1) |
|
8.2.3 Overlaid density plots |
|
|
216 | (1) |
|
8.2.4 Bar chart with error bars |
|
|
216 | (1) |
|
|
217 | (4) |
|
|
217 | (1) |
|
8.3.2 Scatterplot with multiple y values |
|
|
218 | (1) |
|
8.3.3 Scatterplot with binning |
|
|
219 | (1) |
|
8.3.4 Transparent overplotting scatterplot |
|
|
219 | (1) |
|
8.3.5 Bivariate density plot |
|
|
220 | (1) |
|
8.3.6 Scatterplot with marginal histograms |
|
|
220 | (1) |
|
|
221 | (2) |
|
8.4.1 Matrix of scatterplots |
|
|
221 | (1) |
|
|
221 | (1) |
|
|
222 | (1) |
|
|
222 | (1) |
|
8.5 Special purpose plots |
|
|
223 | (7) |
|
|
223 | (1) |
|
|
223 | (1) |
|
8.5.3 Plots for categorical data |
|
|
224 | (1) |
|
|
224 | (1) |
|
8.5.5 Plot an arbitrary function |
|
|
224 | (1) |
|
8.5.6 Normal quantile-quantile plot |
|
|
225 | (1) |
|
8.5.7 Receiver operating characteristic (ROC) curve |
|
|
225 | (1) |
|
8.5.8 Plot confidence intervals for the mean |
|
|
226 | (1) |
|
8.5.9 Plot prediction limits from a simple linear regression |
|
|
226 | (1) |
|
8.5.10 Plot predicted lines for each value of a variable |
|
|
226 | (1) |
|
|
227 | (1) |
|
8.5.12 Hazard function plotting |
|
|
228 | (1) |
|
8.5.13 Mean-difference plots |
|
|
228 | (2) |
|
|
230 | (1) |
|
|
230 | (11) |
|
8.7.1 Scatterplot with multiple axes |
|
|
230 | (2) |
|
|
232 | (1) |
|
8.7.3 Scatterplot with marginal histograms |
|
|
232 | (2) |
|
|
234 | (1) |
|
|
235 | (1) |
|
|
236 | (2) |
|
8.7.7 Visualize correlation matrix |
|
|
238 | (3) |
9 Graphical options and configuration |
|
241 | (20) |
|
|
241 | (9) |
|
9.1.1 Arbitrary straight line |
|
|
242 | (1) |
|
|
242 | (1) |
|
9.1.3 Add points to an existing graphic |
|
|
243 | (1) |
|
|
243 | (1) |
|
9.1.5 Regression line fit to points |
|
|
244 | (1) |
|
|
244 | (1) |
|
|
245 | (1) |
|
|
245 | (1) |
|
|
246 | (1) |
|
|
246 | (1) |
|
|
246 | (1) |
|
9.1.12 Mathematical symbols |
|
|
247 | (1) |
|
|
247 | (1) |
|
|
248 | (1) |
|
|
248 | (1) |
|
9.1.16 Identifying and locating points |
|
|
249 | (1) |
|
9.2 Options and parameters |
|
|
250 | (6) |
|
|
250 | (1) |
|
9.2.2 Grid of plots per page |
|
|
250 | (1) |
|
9.2.3 More general page layouts |
|
|
251 | (1) |
|
|
252 | (1) |
|
9.2.5 Point and text size |
|
|
252 | (1) |
|
|
252 | (1) |
|
|
253 | (1) |
|
|
253 | (1) |
|
9.2.9 Axis range and style |
|
|
253 | (1) |
|
9.2.10 Axis labels, values, and tick marks |
|
|
254 | (1) |
|
|
254 | (1) |
|
|
255 | (1) |
|
|
255 | (1) |
|
|
255 | (1) |
|
|
256 | (1) |
|
|
256 | (5) |
|
|
256 | (1) |
|
|
256 | (1) |
|
|
257 | (1) |
|
|
258 | (1) |
|
9.3.5 Windows Metafile (WMF) |
|
|
258 | (1) |
|
9.3.6 Bitmap image file (BMP) |
|
|
258 | (1) |
|
9.3.7 Tagged image file format (TIFF) |
|
|
259 | (1) |
|
9.3.8 Portable Network Graphics (PNG) |
|
|
259 | (1) |
|
9.3.9 Closing a graphic device |
|
|
260 | (1) |
10 Simulation |
|
261 | (20) |
|
|
261 | (13) |
|
10.1.1 Generate categorical data |
|
|
261 | (2) |
|
10.1.2 Generate data from a logistic regression |
|
|
263 | (1) |
|
10.1.3 Generate data from a generalized linear mixed model |
|
|
264 | (3) |
|
10.1.4 Generate correlated binary data |
|
|
267 | (2) |
|
10.1.5 Generate data from a Cox model |
|
|
269 | (2) |
|
10.1.6 Sampling from a challenging distribution |
|
|
271 | (3) |
|
10.2 Simulation applications |
|
|
274 | (6) |
|
10.2.1 Simulation study of Student's t test |
|
|
274 | (2) |
|
10.2.2 Diploma (or hat-check) problem |
|
|
276 | (2) |
|
10.2.3 Monty Hall problem |
|
|
278 | (2) |
|
|
280 | (1) |
11 Special topics |
|
281 | (34) |
|
|
281 | (3) |
|
11.2 Simulation-based power calculations |
|
|
284 | (3) |
|
11.3 Reproducible analysis and output |
|
|
287 | (3) |
|
11.4 Advanced statistical methods |
|
|
290 | (23) |
|
|
290 | (6) |
|
|
296 | (7) |
|
|
303 | (1) |
|
|
304 | (7) |
|
11.4.5 Finite mixture models with concomitant variables |
|
|
311 | (2) |
|
|
313 | (2) |
12 Case studies |
|
315 | (26) |
|
12.1 Data management and related tasks |
|
|
315 | (6) |
|
12.1.1 Finding two closest values in a vector |
|
|
315 | (2) |
|
12.1.2 Tabulate binomial probabilities |
|
|
317 | (1) |
|
12.1.3 Calculate and plot a running average |
|
|
318 | (2) |
|
12.1.4 Create a Fibonacci sequence |
|
|
320 | (1) |
|
12.2 Read variable format files |
|
|
321 | (3) |
|
|
324 | (5) |
|
12.3.1 Massachusetts counties, continued |
|
|
324 | (1) |
|
|
325 | (2) |
|
|
327 | (2) |
|
12.4 Data scraping and visualization |
|
|
329 | (7) |
|
12.4.1 Scraping data from HTML files |
|
|
330 | (1) |
|
12.4.2 Reading data with two lines per observation |
|
|
331 | (2) |
|
12.4.3 Plotting time series data |
|
|
333 | (1) |
|
12.4.4 URL APIs-and truly random numbers |
|
|
334 | (2) |
|
12.5 Manipulating bigger datasets |
|
|
336 | (1) |
|
12.6 Constrained optimization: the knapsack problem |
|
|
337 | (4) |
A Introduction to SAS |
|
341 | (16) |
|
|
341 | (1) |
|
A.2 Running SAS and a sample session |
|
|
341 | (5) |
|
A.3 Learning SAS and getting help |
|
|
346 | (1) |
|
A.4 Fundamental elements of SAS syntax |
|
|
347 | (2) |
|
A.5 Work process: The cognitive style of SAS |
|
|
349 | (1) |
|
A.6 Useful SAS background |
|
|
349 | (2) |
|
|
349 | (1) |
|
|
350 | (1) |
|
A.6.3 Formats and informats |
|
|
350 | (1) |
|
A.7 Output Delivery System |
|
|
351 | (4) |
|
A.7.1 Saving output as datasets and controlling output |
|
|
351 | (4) |
|
A.7.2 Output file types and ODS destinations |
|
|
355 | (1) |
|
|
355 | (1) |
|
|
356 | (1) |
B Introduction to R and RStudio |
|
357 | (22) |
|
|
358 | (2) |
|
B.1.1 Installation under Windows |
|
|
358 | (1) |
|
B.1.2 Installation under Mac OS X |
|
|
359 | (1) |
|
|
359 | (1) |
|
B.1.4 Other graphical interfaces |
|
|
359 | (1) |
|
B.2 Running R and sample session |
|
|
360 | (2) |
|
B.2.1 Replicating examples from the book and sourcing commands |
|
|
361 | (1) |
|
|
362 | (1) |
|
B.3 Learning R and getting help |
|
|
362 | (3) |
|
B.4 Fundamental structures and objects |
|
|
365 | (4) |
|
B.4.1 Objects and vectors |
|
|
365 | (1) |
|
|
365 | (1) |
|
|
366 | (1) |
|
|
366 | (1) |
|
|
367 | (1) |
|
|
367 | (2) |
|
B.4.7 Attributes and classes |
|
|
369 | (1) |
|
|
369 | (1) |
|
|
369 | (2) |
|
|
369 | (1) |
|
B.5.2 The apply family of functions |
|
|
370 | (1) |
|
|
371 | (6) |
|
B.6.1 Introduction to packages |
|
|
371 | (1) |
|
|
372 | (1) |
|
B.6.3 Installed libraries and packages |
|
|
373 | (1) |
|
B.6.4 Packages referenced in this book |
|
|
374 | (3) |
|
B.6.5 Datasets available with R |
|
|
377 | (1) |
|
|
377 | (2) |
C The HELP study dataset |
|
379 | (6) |
|
C.1 Background on the HELP study |
|
|
379 | (1) |
|
C.2 Roadmap to analyses of the HELP dataset |
|
|
379 | (2) |
|
C.3 Detailed description of the dataset |
|
|
381 | (4) |
References |
|
385 | (14) |
Subject index |
|
399 | (20) |
SAS index |
|
419 | (12) |
R index |
|
431 | |