글 수 23
#2.2
 dataset uswages, library(faraway)
The dataset uswages is drawn as a sample fom the Current Population Survey in 1988.
Fit a model with weekly wages as the response and years of education and experience as predictors.
Report and give a simple interpretation to the regression coefficient for years of education.
Now fit the same model but with logged weekly wages. Give an interpretation to the regression
coefficient for years of education.
Which interpretation is more natural?
library(faraway)
attach(uswages)
g1<-lm( log(wage) ~ educ + exper )
g2<-lm( wage ~ educ + exper )

plot(g1)  # Fitted Values & Residuals  >plot( fitted(g1), residuals(g1))
plot(g2)

coef(g1)$educ  #  0.09050628  
coef(g2)$educ  # 51.1752,  edu : Years of education,  wage : Real weekly wages in dollars  
                               
plot( wage, exper )

summary(g1) # R2  , residual standard error , F-value , t-value 
summary(g2)

#2.4
 dataset prostate, library(faraway)
The dataset prostate comes from a study on 97 men with prostate cancer who were due to recieve a raical
prostatectomy. Fit a model with lpsa as the response and lcavol as the predictor. Record the residual standard error
and the R2. Now add lweight, svi, lqbh, age, lcp, pgg45 and gleason to the model one at a time.
For each model record the residual standard error and R2. Plot the trends in these two statistics.
plot( R-squared, residual standard error )

R2 = 1 - RSS / SS
tot
조회 수 :
17512
등록일 :
2009.09.14
14:08:49 (*.248.27.147)
엮인글 :
https://mathsci.kaist.ac.kr/ko/xe/N2009_fall_MAS456_notice/28088/687/trackback
게시글 주소 :
https://mathsci.kaist.ac.kr/ko/xe/N2009_fall_MAS456_notice/28088
List of Articles
번호 제목 글쓴이 날짜 조회 수
23 기여도와 파일변환_ ANNA 2009-12-11 1920
22 Final PROJECT ANNA 2009-12-07 1926
21 HW8(DueDate:1207) ANNA 2009-12-02 2311
20 HW7(DueDate:1130) ANNA 2009-11-19 2246
19 about Project ANNA 2009-11-13 1888
18 11.13 file ANNA 2009-11-13 2238
17 HW6(DueDate:1116) [1] ANNA 2009-11-12 2454
16 11.09 file ANNA 2009-11-09 2214
15 HW5(DueDate:1111) [1] ANNA 2009-11-04 2327
14 Term Project Team ANNA 2009-11-04 2199
13 10.16 file ANNA 2009-10-16 2466
12 10.14 file ANNA 2009-10-13 2623
11 HW4(DueDate:1028) [1] ANNA 2009-09-28 2777
10 HW3(DueDate:1007) [1] ANNA 2009-09-28 4257
9 중간고사이전까지일정입니다 ANNA 2009-09-28 2035
8 0925 ANNA 2009-09-25 2348
7 HW2(DueDate:0928) [1] ANNA 2009-09-24 14889
6 Packages:faraway file ANNA 2009-09-23 2509
5 0918 ANNA 2009-09-18 2010
» HW1(DueDate:0921) ANNA 2009-09-14 17512