資源描述:
《the r book regression》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、10RegressionRegressionanalysisisthestatisticalmethodyouusewhenboththeresponsevariableandtheexplanatoryvariablearecontinuousvariables(i.e.realnumberswithdecimalplaces–thingslikeheights,weights,volumes,ortemperatures).Perhapstheeasiestwayofknowingwhenregressionistheappropriateanalysisistoseeth
2、atascatterplotistheappropriategraphic(incontrasttoanalysisofvariance,say,whereitwouldhavebeenabox-and-whiskerplotorabarchart).Wecoversevenimportantkindsofregressionanalysisinthisbook:linearregression(thesimplest,andmuchthemostfrequentlyused);polynomialregression(oftenusedtotestfornon-linea
3、rityinarelationship);piecewiseregression(twoormoreadjacentstraightlines);robustregression(modelsthatarelesssensitivetooutliers);multipleregression(wheretherearenumerousexplanatoryvariables);non-linearregression(to?taspeci?ednon-linearmodeltodata);non-parametricregression(usedwhenthereis
4、noobviousfunctionalform).The?rst?vecasesarecoveredhere,non-linearregressioninChapter20andnon-parametricregressioninChapter18(wherewedealwithgeneralizedadditivemodelsandnon-parametricsmoothing).Theessenceofregressionanalysisisusingsampledatatoestimateparametervaluesandtheirstandarderrors.Firs
5、t,however,weneedtoselectamodelwhichdescribestherelationshipbetweentheresponsevariableandtheexplanatoryvariable(s).Thesimplestofallisthelinearmodely=a+bx.Therearetwovariablesandtwoparameters.Theresponsevariableisy,andxisasinglecontinuousexplanatoryvariable.Theparametersareaandb:theinterceptis
6、a(thevalueofywhenx=0);andtheslopeisb(thechangeinydividedbythechangeinxwhichbroughtitabout).TheRBook,SecondEdition.MichaelJ.Crawley.?2013JohnWiley&Sons,Ltd.Published2013byJohnWiley&Sons,Ltd.450THERBOOK10.1LinearregressionLetusstartwithanexamplewhichshowsthegrowthofcaterpillarsfedonexperimenta
7、ldietsdifferingintheirtannincontent:reg.data<-read.table("c:\temp\regression.txt",header=T)attach(reg.data)names(reg.data)[1]"growth""tannin"plot(tannin,growth,pch=21,col="blue",bg="red")12102468growth02468tanninThehigherthepercentageoftannininth