楼主: maths_hjxk
7399 24

[免费]Practical Regression and Anova using R [推广有奖]

  • 2关注
  • 3粉丝

博士生

51%

还不是VIP/贵宾

-

威望
0
论坛币
1864 个
通用积分
71.0768
学术水平
2 点
热心指数
2 点
信用等级
2 点
经验
4223 点
帖子
145
精华
0
在线时间
461 小时
注册时间
2007-4-10
最后登录
2023-12-11

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

首先是个回归和方差分析的应用类教材,举例是用R软件来实现的.

Contents
1 Introduction 8
1.1 Before you start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.1 Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.2 Data Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1.3 Initial Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2 When to use Regression Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2 Estimation 16
2.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2 Linear Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3 Matrix Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.4 Estimating b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.5 Least squares estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.6 Examples of calculating ˆb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.7 Why is ˆb a good estimate? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.8 Gauss-Markov Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.9 Mean and Variance of ˆb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.10 Estimating s2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.11 Goodness of Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.12 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3 Inference 26
3.1 Hypothesis tests to compare models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.2 Some Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.2.1 Test of all predictors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.2.2 Testing just one predictor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.2.3 Testing a pair of predictors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2.4 Testing a subspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.3 Concerns about Hypothesis Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.4 Confidence Intervals for b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.5 Confidence intervals for predictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.6 Orthogonality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.7 Identifiability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.9 What can go wrong? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.9.1 Source and quality of the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

3.9.2 Error component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.9.3 Structural Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.10 Interpreting Parameter Estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4 Errors in Predictors 55
5 Generalized Least Squares 59
5.1 The general case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.2 Weighted Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
5.3 Iteratively Reweighted Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6 Testing for Lack of Fit 65
6.1 s2 known . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.2 s2 unknown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
7 Diagnostics 72
7.1 Residuals and Leverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.2 Studentized Residuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
7.3 An outlier test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.4 Influential Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.5 Residual Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.6 Non-Constant Variance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.7 Non-Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.8 Assessing Normality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.9 Half-normal plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.10 Correlated Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
8 Transformation 95
8.1 Transforming the response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
8.2 Transforming the predictors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
8.2.1 Broken Stick Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
8.2.2 Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
8.3 Regression Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
8.4 Modern Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
9 Scale Changes, Principal Components and Collinearity 106
9.1 Changes of Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
9.2 Principal Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
9.3 Partial Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
9.4 Collinearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
9.5 Ridge Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
10 Variable Selection 124
10.1 Hierarchical Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
10.2 Stepwise Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
10.2.1 Forward Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
10.2.2 Stepwise Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
10.3 Criterion-based procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

10.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
11 Statistical Strategy and Model Uncertainty 134
11.1 Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
11.2 Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
11.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
12 Chicago Insurance Redlining - a complete example 138
13 Robust and Resistant Regression 150
14 Missing Data 156
15 Analysis of Covariance 160
15.1 A two-level example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
15.2 Coding qualitative predictors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
15.3 A Three-level example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
16 ANOVA 168
16.1 One-Way Anova . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
16.1.1 The model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
16.1.2 Estimation and testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
16.1.3 An example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
16.1.4 Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
16.1.5 Multiple Comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
16.1.6 Contrasts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
16.1.7 Scheff´e’s theorem for multiple comparisons . . . . . . . . . . . . . . . . . . . . . . 177
16.1.8 Testing for homogeneity of variance . . . . . . . . . . . . . . . . . . . . . . . . . . 179
16.2 Two-Way Anova . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
16.2.1 One observation per cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
16.2.2 More than one observation per cell . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
16.2.3 Interpreting the interaction effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
16.2.4 Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
16.3 Blocking designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
16.3.1 Randomized Block design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
16.3.2 Relative advantage of RCBD over CRD . . . . . . . . . . . . . . . . . . . . . . . . 190
16.4 Latin Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
16.5 Balanced Incomplete Block design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
16.6 Factorial experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
A Recommended Books 204
A.1 Books on R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
A.2 Books on Regression and Anova . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
B R functions and data 205
CONTENTS 7
C Quick introduction to R 207
C.1 Reading the data in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
C.2 Numerical Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
C.3 Graphical Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
C.4 Selecting subsets of the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
C.5 Learning more about R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

189002.pdf (1014.48 KB)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:regression Practical regressio regress practic Using regression Practical ANOVA

本帖被以下文库推荐

沙发
zark 发表于 2008-1-17 22:33:00 |只看作者 |坛友微信交流群
感謝

使用道具

藤椅
hubeibei 发表于 2008-1-20 12:30:00 |只看作者 |坛友微信交流群

非常感谢

使用道具

板凳
bioengineer 发表于 2008-1-21 09:49:00 |只看作者 |坛友微信交流群
Thank you very much. Can you post his book "Linear model with R"?
Biomedical engineering Digital signal processing Biostatistics

使用道具

报纸
marloneusa 发表于 2008-2-22 07:22:00 |只看作者 |坛友微信交流群
good books

使用道具

地板
riverzjy 发表于 2008-3-7 11:18:00 |只看作者 |坛友微信交流群
Thanks a lot,

使用道具

7
annie_123 发表于 2008-5-14 19:47:00 |只看作者 |坛友微信交流群

have a look

thank you for sharing it

[em01]

使用道具

8
adobephoebus 发表于 2008-5-14 22:09:00 |只看作者 |坛友微信交流群

Thanks!

Thanks!

使用道具

9
caocheng8230 发表于 2008-9-20 18:53:00 |只看作者 |坛友微信交流群
thanks

使用道具

10
caocheng8230 发表于 2008-9-20 18:53:00 |只看作者 |坛友微信交流群
thanks

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-27 21:17