1 / 55

Partial Regression Plots

Partial Regression Plots. Life Insurance Example: (nknw364.sas). Y = the amount of life insurance for the 18 managers (in $1000) X 1 = average annual income (in $1000) X 2 = risk aversion score (0 – 10). Life Insurance: Input, diagnostics. title1 h = 3 'Insurance' ; data insurance;

koko
Download Presentation

Partial Regression Plots

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Partial Regression Plots

  2. Life Insurance Example: (nknw364.sas) Y = the amount of life insurance for the 18 managers (in $1000) X1 = average annual income (in $1000) X2 = risk aversion score (0 – 10)

  3. Life Insurance: Input, diagnostics title1h=3'Insurance'; data insurance; infile'I:\My Documents\Stat 512\CH10TA01.DAT'; input income risk amount; run; procprintdata=insurance; run; *diagnostics; title2h=2'residual plots'; symbol1v=circle c=black; procregdata=insurance; model amount = income risk/rp; plotr.*(p. income risk); run;

  4. Life Insurance: output, diagnostics

  5. Life Insurance: Initial Regression

  6. Life Insurance: Scatter plot title2h=2'Scatterplot'; procsgscatterdata=insurance; matrix income risk amount; run;

  7. Life Insurance – Residual Plots

  8. Life Insurance – Residual Plots (cont)

  9. Life Insurance: Partial Regression Plots (1) procregdata=insurance; model amount=income risk/partial; run;

  10. Life Insurance: Partial Regression Plots (1)

  11. Life Insurance: Partial Regression Plots (2)risk title1h=3'Partial residual plot'; title2h=2'for risk'; symbol1v=circle i=rl; axis1label=(h=2'Risk Aversion Score'); axis2label=(h=2angle=90'Amount of Insurance'); procregdata=insurance; model amount risk = income; outputout=partialriskr=resamtresrisk; procgplotdata=partialrisk; plotresamt*resrisk / haxis=axis1 vaxis=axis2 vref = 0; run;

  12. Life Insurance: Partial Regression Plots (2)risk (cont)

  13. Life Insurance: Partial Regression Plots (2)income axis3label=(h=2'Income'); title2h=2'for income'; procregdata=insurance; model amount income = risk; outputout=partialincomer=resamtresinc; procgplotdata=partialincome; plotresamt*resinc / haxis=axis3 vaxis=axis2 vref = 0; run;

  14. Life Insurance: Partial Regression Plots (2)income (cont)

  15. Life Insurance: Quadratic title1'Quadratic model'; title2''; data quad; set insurance; sinc = income; procstandarddata=quad out=quad mean=0; varsinc; data quad; set quad; incomesq = sinc*sinc; proccorrdata=quad; var amount risk income incomesq; run; procregdata=quad; model amount = income risk incomesq; run;

  16. Life Insurance: Quadratic (regression)

  17. Life Insurance: Quadratic (residual plots)

  18. Life Insurance: normality Original Model With Quadratic Term

  19. Types of Outliers

  20. Life Insurance: Studentized Residuals (nknw364.sas) procregdata=quad; model amount=income risk incomesq/r; outputout = diagr=residstudent=student; run; procprintdata=diag; run;

  21. Life Insurance: Studentized Residuals (cont)

  22. Life Insurance: Studentized Residuals (cont)

  23. Life Insurance: Studentized Deleted Residuals procregdata=quad; model amount=income risk incomesq/rinfluence; outputout = diag1 r=residrstudent=rstudent; run; procprintdata=diag1; run;

  24. Studentized Deleted Residuals (cont)

  25. Studentized Deleted Residuals (cont)

  26. Studentized Deleted Residuals (cont)

  27. Studentized Deleted Residuals: w/o square

  28. /r vs. /influence • /r keyword • /influence keyword

  29. Hat Matrix Diagnosis, DFFITS

  30. Cook’s Distance, DFBetas, Cov Ratio

  31. Life Insurance: Multicollinearity procregdata=quad; model amount=income risk incomesq/tolvif; run;

  32. Body Fat: Multicollinearity (nknw260b.sas) databodyfat; infile'I:\My Documents\Stat 512\CH07TA01.DAT'; inputskinfold thigh midarm fat; procprintdata=bodyfat; run; procregdata=bodyfat; model fat=skinfold thigh midarm/viftol; run;

  33. Blood Pressure Example: Background (nknw406.sas) Researching the relationship between blood pressure in healthy women ages 20 – 60. Y = diastolic blood pressure (diast) X = age n = 54

  34. Blood Pressure: input data pressure; infile‘H:\My Documents\Stat 512\CH11TA01.DAT'; input age diast; procprintdata=pressure; run; title1h=3'Blood Pressure'; title2h=2'Scatter plot'; symbol1v=circle i=sm70 c=purple; axis1label=(h=2); axis2label=(h=2angle=90); procsortdata=pressure; by age; procgplotdata=pressure; plotdiast*age; run;

  35. Blood Pressure: Scatterplot

  36. Blood Pressure: regression (unweighted) procregdata=pressure; modeldiast=age / clb; outputout=diagr=resid; run;

  37. Blood Pressure: Residual Plots datadiag; setdiag; absr=abs(resid); sqrr=resid*resid; title2h=2'residual abs(resid) squared residual plots vs. age'; procgplotdata=diag; plot (residabsrsqrr)*age/haxis=axis1 vaxis=axis2; run;

  38. Blood Pressure: Residual Plots (cont)

  39. Blood Pressure: computing weights procregdata=diag; modelabsr=age; outputout=findweightsp=shat; datafindweights; setfindweights; wt=1/(shat*shat);

  40. Blood Pressure: computing weights if using resid2 proc reg data=diag; model sqrr=age; output out=findweights p=shat2; data findweights; set findweights; wt=1/shat2;

  41. Blood Pressure: weighted regression procregdata=findweights; modeldiast=age / clbp; weight wt; outputout = weighted r = residp = predict; run;

  42. Blood pressure: Comparison • Normal Regression • Weighted Regression

  43. Blood Pressure: new residuals datagraphtest; set weighted; resid1 = sqrt(wt)*resid; title2h=2'Weighted data - residual plot'; symbol1v=circle i=nonecolor=red; procgplotdata=graphtest; plot resid1*predict/vref=0haxis=axis1 vaxis=axis2; run;

  44. Blood Pressure: new residuals

  45. Biased vs. Unbiased Estimators

  46. Body Fat Example (ridge.sas) n = 20 healthy female subjects ages of 25 – 34 Y = body fat (fat) X1 = triceps skinfoldthickness (skinfold) X2 = thigh circumference (thigh) X3 = midarmcircumference (midarm) Previous Conclusion: Problem with multicollinearity Good model with a) thigh only or with b) midarm and skinfold only

  47. Body Fat Example: Regression (input) databodyfat; infile'I:\My Documents\Stat 512\CH07TA01.DAT'; inputskinfold thigh midarm fat; procprintdata=bodyfat; run; procregdata=bodyfat; model fat=skinfold thigh midarm; run;

  48. Body Fat Example: Regression (output)

  49. Body Fat Example: Scatter plot

  50. Body Fat Example: Correlation proccorrdata=bodyfatnoprob;run;

More Related