sas線性回歸分析案例CasestudyofSASlinearregressionanalysis.doc_第1頁
sas線性回歸分析案例CasestudyofSASlinearregressionanalysis.doc_第2頁
sas線性回歸分析案例CasestudyofSASlinearregressionanalysis.doc_第3頁
sas線性回歸分析案例CasestudyofSASlinearregressionanalysis.doc_第4頁
sas線性回歸分析案例CasestudyofSASlinearregressionanalysis.doc_第5頁
已閱讀5頁,還剩44頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、sas線性回歸分析案例(case study of sas linear regression analysis)linear regression20094788 chen lei calculates 2southwest jiao tong universitysouthwest jiaotong university-linear regression is divided into single linear regression and multiple linear regression.the model of unary linear regression isy=.0+.1

2、x+ epsilon,herexindependent variable,ydependent variable,epsilon is a random error term.it is usually assumed that the mean of the random error iszerothe variance is(.2.2>0),.2 andxvalue independent. if further assumptionsrandom errorthe difference follows a normal distribution, which is called a

3、 normal linear model. in general, withkan independent variable and a dependent variable, dependent variablethe value can be broken down into two parts: part is due to the influence of the independent variable, that is to sayfunction as an argumentamong them, the function form is alreadyknow, but con

4、tain some unknown parameters; another part is due to other un considered factors and random effects, that is, random errors.when a function is a linear function of unknown parameters, it is called a linear regression analysis model.if there are multiple dependent variables, the regression model is:y

5、=.0+.1x1+.2x2+.+.ixi+.due to the linear diethe model contains random errors, so the regressionthe straight line reflected by the model is uncertain. the main purpose of regression analysis is to derive from thesein the uncertain straight line, find a line which can best fit the original data informa

6、tion and describe it as a regression modelrelationship between independent variables,the straight line is called the regression equation.throughoften in regression analysis, yesepsilon has the most commonly used classical assumptions.1. the expected value of epsilon iszero2, epsilon for allxfor exam

7、ple, it has the same variance.3, epsilon obeys normal distribution and is independent of each othervariable.explanation of linear regression,this paperbased on examples.in the following example, there is a one element regression analysis, and another twometa regression analysis.examples(data analysi

8、s method_exercises2.4_page79)a company manager who knows about the monthly sales of a cosmetics in a cityy(unit: box) with the middle of the citythe number of people who use the cosmetics.1 (unit: thousand persons) and their per capita monthly income.2 (unit: yuan) betweenin a certain monthfifteenth

9、ree cities were surveyed to obtain the above viewsmeasured values, such as tabletwo point one twoas shown.surfacetwo point one twocosmetics sales datacitysales volume (y)number of people (x1)income (x2)citysales volume (y)number of people (x1)income (x2)oneone hundred and sixty-twotwo hundred and se

10、venty-fourtwo thousand four hundred and fiftynineone hundred and sixteenone hundred and ninety-fivetwo thousand one hundred and thirty-seventwoone hundred and twentyone hundred and eightythree thousand two hundred and fifty-fourtenfifty-fivefifty-threetwo thousand five hundred and sixtythreetwo hund

11、red and twenty-threethree hundred and seventy-fivethree thousand eight hundred and twoeleventwo hundred and fifty-twofour hundred and thirtyfour thousand and twentyfourone hundred and thirty-onetwo hundred and fivetwo thousand eight hundred and thirty-eighttwelvetwo hundred and thirty-twothree hundr

12、ed and seventy-twofour thousand four hundred and twenty-sevenfivesixty-seveneighty-sixtwo thousand three hundred and forty-seventhirteenone hundred and forty-fourtwo hundred and thirty-sixtwo thousand six hundred and sixtysixone hundred and sixty-ninetwo hundred and sixty-fivethree thousand seven hu

13、ndred and eighty-twofourteenone hundred and threeone hundred and fifty-seventwo thousand and eighty-eightseveneighty-oneninety-eightthree thousand and eightfifteentwo hundred and twelvethree hundred and seventytwo thousand six hundred and fiveeightone hundred and ninety-twothree hundred and thirtytw

14、o thousand four hundred and fiftyhypothesisyand.1,linear regression relation is found between.2.=.0+.1.1+.2.2+.,.=1,2,. 15.amongindependent and identically distributed. (0,.2)(one)coefficient of linear regression.0,.1,least squares estimation and error variance of.2.2 estimates, writes regression eq

15、uations, and.regression coefficientinterpret;(two)the anova table was used to explain the significance of linear regression test. square of the coefficient of the complex correlation.2valueand explain its meaning;(three)separately seek.1 andthe confidence of.2 is95%confidence interval;(four)yesthe n

16、umber of people tested by alpha =0.05.1 and income.2sales volumeyis the effect significant?regression coefficienttest of general hypothesis test method.1 andthe interaction of.2 (i.e.1.2) yesyis the effect significant?;data importedit window inputthis questionthedata import code:titledata analysis m

17、ethod_exercises2.4_page79" / *title, omission does not affect analysis results* /datamylib.ch2_2_4;*first, a new logical library,logical librariesmylibcreate data setch2_2_4*/input y x1 x2 /*;represents a continuous input,ydependent variable,x1,x2independent variable* /cards; / *start input dat

18、a* /1622742450120180, 32542233753802131205283867862347, 1692653782819830081923302450, 1161952137fifty-five532560252430402023, 37244271442362660103157, 20882123702605;*missing data"."otherwise, the corresponding set of data will be automatically deleted* /run/*runstatement is used to illust

19、rate all rows before the statement in the current procedure step* /pressf8after run,open logical librarymylibyou can see the new data setch2_2_4.sasa variety of imports are providedaccording to the manner, for example:one,read data from file,infile"f:mylibch2_2_4.txt"twoand the use of esta

20、blished data sets,proc reg data=mylib.ch2_2_4;you can also import directly from outsideexcelother ways. the program above is entered directly in the edit cedure callthe procedure to call in this questionyesproc regprocess.proc regprocess issassystemmany regression analysis process of the syst

21、em in theexcept that it can fit the general linear regression model,a variety of optimal model selection methods and model checking methods are also provided.among themone)two)threethe results of multivariate linear regression analysis are mainly used. (four) will use a linear regression analysisres

22、ults.(i)yand.,linear regression analysisprocreg;*transferregprocess use* /model y=x1 x2;*dependent variableythe independent variable isx1,x2*/run;modelstatement: used to define the model's dependent variables, arguments, model options, and output options.common options areselection=,specifies th

23、e variable selection method:forward(forward input method),backwardxiang houshandivision),stepwise(stepwise regression),adjrsq(modified multiple correlation coefficient criterion),cp(cp criterionetc.nointsaid, is often included in the modelnumber item;stbthe regression coefficient, output standard;cl

24、ithe output of single predictive value, confidence interval;rresidual scores are performedanalysis of results of the analysis and output;ioutput(xtx).1matrix.format:modeldependent variable name=argument rankingtheseoptioncases:model y=x1 / x2 selection=stepwise / *;stepwise regression* /after runnin

25、g the program, get the resultsparameter estimation table(one)least squares estimation:= = (0,. 1,. 2) = (3.45261,0.49600,0.00920)regression equation:y=3.45261+0.49600.1+0.00920.2anova table(twoerror variance estimate:. 2=mse=4.74040multiple correlation coefficientsquares:.2=0.9989(r-square)significa

26、nce: from the value of the complex correlation coefficient, it can be seen that it is highly significantyand.1,.2)multiple correlation coefficientsquarescan also passby calculation:.2=ssr/sst=53845/53902=0.9989(three)confidence interval:k+.t1.2 (n.p) s.).0.975 (12) =2.17881 (via check)t distribution

27、 table obtained)you can also pass the functiony=tinv(p,dfobtain.1=0.496+/-2.179*0.00605draw (zero point four eight two eight,zero point five zero nine two).2=0.0092+/-2.179*0.00096811,drawzero point zero zero seven one,zero point zero one one three)(two)yandlinear regression analysisprocregdata=myli

28、b.ch2_2_4; / *direct reference data set* /model y=x1;run;(fourthe coefficient of multiple correlation is:zero point nine nine one zero,x1yesysignificant influence(three)yandlinear regression analysisprocregdata=mylib.ch2_2_4; / *direct reference data set* /model y=x2;run;(four)the coefficient of qua

29、dratic correlation is square:zero point four zero eight seven,x2yesythe effect is not significant(four)yandlinear regression analysis of.data mylib.ch2_2_4;set mylib.ch2_2_4;*read data set* /z=x1*x2;*new argumentz*/run;proc reg;model y=z;*argument isz*/run;(four)the square of the complex correlation

30、 coefficient is:zero point nine zero three zero,x1x2yesysignificant impactlinear regression analysis using modules(i)linear regression analysisstart-upsassystem, and click "solution" in turn"->"analysis"->"analysts"and then click "file""->op

31、en, open the data set"ch2_2_4.sas7bdat",figurevariable listindependent variabledependent variablethe value of confidence aclick "statistics" in turn"->"regression"->"simple" pop-up dialog box(one)variable settingson the left hand side of the variabl

32、eslistcentral electionyclick"dependentthe button is set as dependent variable;selectedx2click"explanatory"button, set it as an argument."modelin the settings bar, select by default"linear"" means linear regression.(two)testsset upclick"testsbutton to eject the

33、 dialog boxconfidence defaults tozero point zero fivemay change.click"ok".(three)plotsset upclick"plots"button" pops up the plotting options dialog boxchoice"residultab."studentized"represents a student residual,"normal quantile-quantile plot"stands

34、for normality."qqgraph check.settings as shownresidual columnnormal inspectiontest barvariable columnvariance analysisparameter estimationclick"ok"and click on the main settings dialog box"ok",thereforeand get resultsregression equationclick"analysis (new, project)"

35、;dialog box""plot of rstudentvsx2"" pops up the residual graphdialog boxclick again"plot of rstudentvsnqq"pop upqqchartthe normal state of the residual by the studentqqit can be seen that the model error term is approximately normal distribution.independent variable selection(two) manylinear regression analysisstart-upsassystem, click "solu

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論