




已閱讀5頁,還剩40頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
迴歸分析 相關(guān)係數(shù) Correlation 描述兩個(gè)變數(shù)X Y之間的線性相關(guān)Example data1中的身高及體重 2 如何量化這樣的線性關(guān)係呢 Correlation Linearcorrelation 相關(guān)係數(shù) Correlation Bydefinition thecorrelationbetweenXandYisItsestimate Pearson scorrelationcoefficient 3 相關(guān)係數(shù) Correlation r o positivelycorrelatedr 0 negativelycorrelatedr 0 nolinearcorrelationr 0不代表 Y之間沒有關(guān)係 有可能只是他們之間的關(guān)係不是線性的 畫圖還是必要的 4 相關(guān)係數(shù) Correlation R程式 cor x y method c pearson kendall spearman x 數(shù)值向量或是矩陣y 數(shù)值向量 當(dāng)x是矩陣的時(shí)候 可以不需輸入 5 相關(guān)係數(shù) Correlation 若想進(jìn)一步檢定vs 檢定統(tǒng)計(jì)量95 confidenceinterval 6 相關(guān)係數(shù) Correlation R程式 cor test x y alternative c two sided less greater method c pearson kendall spearman exact NULL conf level 0 95 continuity FALSE x 數(shù)值向量y 數(shù)值向量exact T或F 表示是否計(jì)算exactp valuecontinuity 是否需要進(jìn)行連續(xù)校正 7 所以身高與體重有統(tǒng)計(jì)顯著的正相關(guān) Practice 8 請畫出在Surgicaldata中 liver與clot的散佈圖 請問由圖中 可以看出liver與clot的關(guān)係嗎 請計(jì)算liver與clot的相關(guān)係數(shù) 請檢定liver與clot之相關(guān)係數(shù)是否為0 Q 除了看相關(guān)性的強(qiáng)度 能不能看彼此如何影響 Regression LinearRegression Step1 血壓的分布 該分布是否男女有別 Step2 血壓是否和體重有線性相關(guān) Step3 該線性關(guān)係如何描述 Step4 如何描述血壓和體重 性別 等等的關(guān)係 Y responsevariable dependentvariable say bp X covariate explanatoryvariable independentvariable say weight 9 LinearRegression Q howdoesXaffectY Canwefitalineinthescatterplot Infact weshouldsay where iscallederror isnormalwithzeromeanandvariance 2 10 Regressionmodel simplelinearregression 11 直線上的點(diǎn)是估的 叫fittedvalues 這是已知體重X之後 期望的血壓值 是期望值 故人稱regresstowardthemean 這和觀察值不同 有samplingvariation Estimatecoefficients Howtofind intercept and slope LeastSquares MinimizeresidualsumofsquaresTakederivative 12 residual isthedifferencebetweenfittedandobservedvalues Y軸的差 Estimatecoefficients Rearrangetheterms getnormalequationsSolvingthenormalequations wegetestimates 13 AretheseLSEgood Aretheyunbiased Standarderrorsoftheseestimates 14 Unbiased AretheseLSEgood Instatistics toask Aretheseestimatesgood isthesameasasking Aretheyclosetothetruevalues Theyaregoodinthesensethattheyareunbiased Theyarebestlinearunbiasedestimators BLUE Gauss Markovtheorem Undertheconditionsofregressionmodel mean constantvariance uncorrelatederrors theleastsquaresestimatorsareunbiasedandhaveminimumvarianceamongallunbiasedlinearestimators 15 Estimationofvariance canbeestimatedbyTherefore 16 LinearregressionusingR R程式 lm formula data formula y x 其中y是response x是covariate 17 3 943 70 8432 17 9663 Linearregression Confidenceintervalofand Uset distributionwithdf n 2Testingifthecoefficient 0 If 0 Usetwithdf n 2Anincreaseof1kginWeightleadstoanincreaseof0 7167inBp Ifsomeoneweighs70kg thenhis herbpisestimatedby70 84 0 72 70 121 24 interpolation 18 Linearregression Meaningfulwhenestimatingbpwith120kg notreally outsidetherangeofthedata dangerousextrapolationRegressiondoesnotimplycausality ItsimplyreflectstheregressionrelationbetweenX weight andY bp ThisregressiondoesnotsayXcausesY Canweusebptopredictweight yes ifweightisthevariableofinterest 19 Practice 想知道在Surgicaldata中 clot如何影響liver 請建立liver與clot之迴歸模式 如何解釋此模型呢 請問clot對liver的影響是顯著的嗎 20 Homework 想知道在Surgicaldata中 enzyme如何影響SVtime 請建立enzyme與SVtime之迴歸模式 如何解釋此模型呢 請問enzyme對SVtime的影響是顯著的嗎 21 Howgoodistheregression Howgooddoesthelineexplainallthevariationiny Howgooddoesthefittedcorrelationof X Y explainY 因?yàn)槎x判斷係數(shù) coefficientofdetermination Pearson scorrelationcoefficientInsimplelinearregression 22 totaldeviationinresponsesaroundthegrandmean deviationofobservationsaroundfittedline deviationoffittedvaluesaroundthegrandmean SSTO SSE SSR percentageofvariationexplainedbyregressionline Example 23 R2 0 4149 AVOVAtableofregression 24 SSE SSR Practice 在Surgicaldata中 模式為liver clot請問在此模型中 判斷係數(shù)為多少 25 Diagnostics 26 基本假設(shè) 殘差平均為0 相差變異數(shù)相同 殘差之間不相關(guān) 看看殘差的分佈情況 看殘差和index的關(guān)係 應(yīng)該要沒關(guān)係 殘差應(yīng)該要和fittedvalue無關(guān) 殘差應(yīng)該要與解釋變數(shù)無關(guān) Diagnostics If 27 Randomlyscatteredaroundzero Fromminustopositive Modelmaynotbeproper Timeeffect Ifx time Linearity有問題試試polynomial或transformX Constantvar有問題 若X值大則var大 試試加別的X或是weightedLS Example 28 Q Qplot 如果殘差服從常態(tài)分配 那麼除了它的長條圖像常態(tài)之外 它的排名的值和實(shí)際母體同排名的值像不像呢 Thequantileoftheresidualversusthenormalquantile 29 將殘差標(biāo)準(zhǔn)化 再排序 第2 6 0 33 分位的quantile是 1 33即P ei 1 33 2 6 算出排序的名次 對常態(tài)來說 第2 6 0 33 分位的quantile是 0 43 即P Z 0 43 2 6 33 對常態(tài)來說第0 26分位的quantile是 0 64 即P Z 0 64 26 Plotthesetwocolumns Q Qplot IfclosetoaX Ystraightline thenresidualsclosetonormality R程式 qqnorm model1 residuals 30 殘差中排名4 6的殘差值和N 0 1 中累積機(jī)率為4 6的值 Q Qplot 31 Yisrightskewed Yisleftskewed DiagnosticsinR 32 Diagnostics plotstoexamineThelineareffectofeachpredictor orConstantvariance Independenceofsamples orNormalityassumption Q QplotOtherimportantpredictors Say Arethereoutliers scatterplot IfYes examineifitistrueoutlier orgrosserror IfYes moredatanearthispoint IfNo deletethedatapointbeforeregressionanalysis 6 fittedmodel 2 3 1 4 5 33 Practice 在Surgicaldata中 模式為liver clot請問此模式符合迴歸的假設(shè)嗎 34 Multiplelinearregression ExtensionofSLR includingmorethanonepredictorsinthemodel 35 Linear Linear Difference Multiplelinearregression Model regressioncoefficients observeddataareindependentInmatrixform 36 Multiplelinearregression 哪些term可以放到X中呢 Predictors 如例子中的weight age sexTransformationsofpredictorsPolynomials andDummyvariablesandfactorsInteractionsandothercombinationsofpredictors 37 Example 38 Inferenceofregressioncoefficients 和SLR時(shí)一樣 用最小平方法satisfyGauss MarkovThm 39 Inferenceofregressioncoefficients 和在SLR中相同 我們想要估計(jì)的confidenceinterval 或是進(jìn)行檢定 需要先估計(jì)出Recall inSLR 40 Hiscalledhatmatrix SST SSE SSR Therearep 1covariatesintheregressionmodel Therearenobservationsandpparameters Inferenceofregressioncoefficients 想要知道整個(gè)模式fit如何 Under E MSR otherwiseE MSR Define withdf p 1 n p 在H0之下 所以如果F偏離1太遠(yuǎn) 我們就傾向拒絕H0H1是什麼呢 41 Inferenceofregressioncoefficients 若是針對某個(gè) 想知道是否和有
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 圍堰施工課題申報(bào)書
- 軟件測試申報(bào)書課題
- 課題申報(bào)書方案構(gòu)建模板
- 合伙企業(yè)人合同范本
- 單位買電合同范本
- 合同范本分包合同
- 課題申報(bào)書課題類型
- 特殊學(xué)生教育課題申報(bào)書
- 和單位購銷采購合同范本
- 品牌門窗店銷售合同范本
- 2025年湖南環(huán)境生物職業(yè)技術(shù)學(xué)院單招職業(yè)技能測試題庫一套
- 新版統(tǒng)編版一年級道德與法治下冊全冊教案(完整版)教學(xué)設(shè)計(jì)含教學(xué)反思
- 電子書 -品牌設(shè)計(jì)法則
- CT報(bào)告單模板
- 足球比賽計(jì)分表(共6頁)
- 軟件概要設(shè)計(jì)說明書范例(共21頁)
- 干式變壓器和低壓配電柜日常巡檢書
- 研究性學(xué)習(xí)成果一覽表
- 生產(chǎn)一致性控制計(jì)劃
- 鐵路勞動(dòng)安全培訓(xùn)鐵路安全培訓(xùn)知識專題PPT課件(帶內(nèi)容)
- 境外公共安全管理.ppt
評論
0/150
提交評論