글 수 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
조회 수 :
17501
등록일 :
2009.09.14
14:08:49 (*.248.27.147)
엮인글 :
https://mathsci.kaist.ac.kr/ko/xe/N2009_fall_MAS456_notice/28088/abe/trackback
게시글 주소 :
https://mathsci.kaist.ac.kr/ko/xe/N2009_fall_MAS456_notice/28088
List of Articles
번호 제목 글쓴이 날짜 조회 수
23 기여도와 파일변환_ ANNA 2009-12-11 1910
22 Final PROJECT ANNA 2009-12-07 1915
21 HW8(DueDate:1207) ANNA 2009-12-02 2302
20 HW7(DueDate:1130) ANNA 2009-11-19 2237
19 about Project ANNA 2009-11-13 1875
18 11.13 file ANNA 2009-11-13 2226
17 HW6(DueDate:1116) [1] ANNA 2009-11-12 2444
16 11.09 file ANNA 2009-11-09 2204
15 HW5(DueDate:1111) [1] ANNA 2009-11-04 2321
14 Term Project Team ANNA 2009-11-04 2187
13 10.16 file ANNA 2009-10-16 2459
12 10.14 file ANNA 2009-10-13 2612
11 HW4(DueDate:1028) [1] ANNA 2009-09-28 2764
10 HW3(DueDate:1007) [1] ANNA 2009-09-28 4244
9 중간고사이전까지일정입니다 ANNA 2009-09-28 2027
8 0925 ANNA 2009-09-25 2341
7 HW2(DueDate:0928) [1] ANNA 2009-09-24 14854
6 Packages:faraway file ANNA 2009-09-23 2496
5 0918 ANNA 2009-09-18 1996
» HW1(DueDate:0921) ANNA 2009-09-14 17501