[問題] linear model數據分析 (R介面)

看板Statistics作者 (harsh)時間18年前 (2007/09/21 11:45), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
我在作 Linear model with R (作者 Faraway) 這本書的習題 dataset: uswages source: faraway package Fit the regression model with weekly wages(wage) as the response and the years of education(educ) and experience(exper) as predictors. > w <- lm(wage~educ+exper, data= uswages) > summary(w) 於是我得到截距和 educ 和exper的係數 截距 educ係數 exper係數 -239.115 51.865 9.329 以及 residuals的中位數(median) -52.14 再計算 residuals的平均(mean) 得到 4*exp(-15) ~0 Q1. 說明中位數和平均不同所代表的含義 Q2. 有兩個人教育(educ)程度相當僅相差一年經驗(exper),問預測薪資(wage)差異多少? Wage= -239.115+ 51.865*X[educ] + 9.329*X[exper] Difference in wage= 9.33(1(year)-0(year))=9.329 請問這樣算對嗎? Q3. 將response wage置換成log(wage)得到新的regression model a. 闡述exper係數所代表意義 b. 跟原來model比較, 何者較為自然(合乎直觀/常理)? > log <- lm(log(wage)~educ+exper, data=uswages) 得到截距和係數 截距 educ係數 exper係數 4.676 0.092 0.017 所以公式為 ln(wage)= 4.676+ 0.092*X[educ] + 0.017*X[exper] wage= exp(4.676+ 0.092*X[educ] + 0.017*X[exper]) 這三題讓我困惑了 不知道怎麼下手 請大大們幫忙我解讀這份資料 先謝過大家 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 68.43.123.238
文章代碼(AID): #16ypvcmq (Statistics)