California State Univ. Long Beach

Dept. of Mathematics and Statistics

 

 

 

Example 1: Regression of Final on Midterm grade

 

/* Example SAS for a Simple Regression */

/* put all the comments you want in between these brackets */

 

Option linesize=80 pagesize=60;

Title 'Regression on Midterm Grade';     

Data Grade;

  input midterm final;

  cards;

  68 75

  49 63

  60 57

  68 88

  97 88

  82 79

  59 82

  50 73

  73 90

  39 62

  71 70

  95 96

  61 76

  72 75

  87 85

  40 40

  66 74

  58 70

  58 75

  77 72

  ;

 

Proc REG Simple;

  Model final=midterm / P;

  Output out=Grade P=Pred R=resid;

Proc Plot;

  Plot final*midterm='*' pred*midterm='p' /overlay;

  Plot resid*pred='R' / vref=0;

Run;