SlideShare a Scribd company logo
REG procedure:
Multiple linear regression
          2013.03.21
Outline
• Regression with more than one variables
• Model selection
Syntax
PROC REG <options> ;
     MODEL dependents=<regressors> < / options > ;
RUN;


        Y= X1 X2 X3 / selection=forward (backward, stepwise)
Example
data example;
do i=1 to 500;                     proc reg corr;
  x1=100+20*rannor(20130321);      model y=x1 x2 x3 x4/pcorr1
  x2=50+20*rannor(20130321);       pcorr2;
  x3=(x1+x2)+5*rannor(20130321);   plot residual.*predicted.;
  x4=exp(3*rannor(20130321));      run;
  e=20*rannor(20130321);
  y=x1+3*x2+2*x3+e;
  output;
end
;
Output
Output: figures
Example
proc reg corr;
model y=x1 x2 x3 x4/pcorr1 pcorr2 selection=forward;
plot residual.*predicted.;
run;
Forward selection
Summary
Stepwise & backward selection
Example 2
Data;
…
X5=x1*x2;
…
;
proc reg corr;
model y=x1 x2 x3 x4 x5/pcorr1 pcorr2 selection=forward;
plot residual.*predicted.;
run;
Selection result

More Related Content

What's hot

Pre-Cal 40S Slides February 29, 2008
Pre-Cal 40S Slides February 29, 2008Pre-Cal 40S Slides February 29, 2008
Pre-Cal 40S Slides February 29, 2008
Darren Kuropatwa
 
Presentttttttss
PresentttttttssPresentttttttss
Presentttttttss
View ' Wharittha
 
Day 5 u8f13
Day 5 u8f13Day 5 u8f13
Day 5 u8f13
jchartiersjsd
 
Parent Functions
Parent FunctionsParent Functions
Parent Functions
VLB10525
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
Rumman Ansari
 
Las tripas de un sistema solr
Las tripas de un sistema solrLas tripas de un sistema solr
Las tripas de un sistema solr
Samuel Solís Fuentes
 
Intro to matlab
Intro to matlabIntro to matlab
Intro to matlab
Norhan Mohamed
 
S1 3 derivadas_resueltas
S1 3 derivadas_resueltasS1 3 derivadas_resueltas
S1 3 derivadas_resueltas
jesquerrev1
 
1
11
Exception Example in Python
Exception Example in PythonException Example in Python
Exception Example in Python
koushikakkinapalli
 
Introduction to matlab lecture 4 of 4
Introduction to matlab lecture 4 of 4Introduction to matlab lecture 4 of 4
Introduction to matlab lecture 4 of 4
Randa Elanwar
 
C++ ARRAY WITH EXAMPLES
C++ ARRAY WITH EXAMPLESC++ ARRAY WITH EXAMPLES
C++ ARRAY WITH EXAMPLES
Farhan Ab Rahman
 
Mbd2
Mbd2Mbd2
python- Variables and data types
python- Variables and data typespython- Variables and data types
python- Variables and data types
SreejaRamesh2
 
Jan. 6 Inverse Functions
Jan. 6 Inverse FunctionsJan. 6 Inverse Functions
Jan. 6 Inverse Functions
RyanWatt
 
graphs plotting in MATLAB
graphs plotting in MATLABgraphs plotting in MATLAB
graphs plotting in MATLAB
Apurva Patil
 
Gr10 piecewise functions
Gr10 piecewise functionsGr10 piecewise functions
Gr10 piecewise functions
Chadwick International School
 
Matlab file
Matlab file Matlab file
Matlab file
rampal singh
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
pramodkumar1804
 

What's hot (19)

Pre-Cal 40S Slides February 29, 2008
Pre-Cal 40S Slides February 29, 2008Pre-Cal 40S Slides February 29, 2008
Pre-Cal 40S Slides February 29, 2008
 
Presentttttttss
PresentttttttssPresentttttttss
Presentttttttss
 
Day 5 u8f13
Day 5 u8f13Day 5 u8f13
Day 5 u8f13
 
Parent Functions
Parent FunctionsParent Functions
Parent Functions
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
 
Las tripas de un sistema solr
Las tripas de un sistema solrLas tripas de un sistema solr
Las tripas de un sistema solr
 
Intro to matlab
Intro to matlabIntro to matlab
Intro to matlab
 
S1 3 derivadas_resueltas
S1 3 derivadas_resueltasS1 3 derivadas_resueltas
S1 3 derivadas_resueltas
 
1
11
1
 
Exception Example in Python
Exception Example in PythonException Example in Python
Exception Example in Python
 
Introduction to matlab lecture 4 of 4
Introduction to matlab lecture 4 of 4Introduction to matlab lecture 4 of 4
Introduction to matlab lecture 4 of 4
 
C++ ARRAY WITH EXAMPLES
C++ ARRAY WITH EXAMPLESC++ ARRAY WITH EXAMPLES
C++ ARRAY WITH EXAMPLES
 
Mbd2
Mbd2Mbd2
Mbd2
 
python- Variables and data types
python- Variables and data typespython- Variables and data types
python- Variables and data types
 
Jan. 6 Inverse Functions
Jan. 6 Inverse FunctionsJan. 6 Inverse Functions
Jan. 6 Inverse Functions
 
graphs plotting in MATLAB
graphs plotting in MATLABgraphs plotting in MATLAB
graphs plotting in MATLAB
 
Gr10 piecewise functions
Gr10 piecewise functionsGr10 piecewise functions
Gr10 piecewise functions
 
Matlab file
Matlab file Matlab file
Matlab file
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 

Viewers also liked

20120329實習課
20120329實習課20120329實習課
20120329實習課弋鈞 林
 
Sas corr
Sas corrSas corr
Sas corr
WenSheng Chang
 
0530 sas實習課
0530 sas實習課0530 sas實習課
0530 sas實習課
Juchi Yu
 
SAS 0412
SAS 0412SAS 0412
SAS 0412
WenSheng Chang
 
Sas tutorial 0308
Sas tutorial 0308Sas tutorial 0308
Sas tutorial 0308
WenSheng Chang
 
20120322實習課
20120322實習課20120322實習課
20120322實習課弋鈞 林
 
Harvard Forest GLMM talk
Harvard Forest GLMM talkHarvard Forest GLMM talk
Harvard Forest GLMM talk
Ben Bolker
 
Sas tutorial glm1
Sas tutorial glm1Sas tutorial glm1
Sas tutorial glm1
WenSheng Chang
 
Predictive Analysis with SAS
Predictive Analysis with SAS Predictive Analysis with SAS
Predictive Analysis with SAS
ewcho
 
To predict the academic performance of an elementary school using Linear Regr...
To predict the academic performance of an elementary school using Linear Regr...To predict the academic performance of an elementary school using Linear Regr...
To predict the academic performance of an elementary school using Linear Regr...
Kamalika Some
 
SAS Project
SAS ProjectSAS Project
SAS Project
shankarpsm
 
Logistic Regression/Markov Chain presentation
Logistic Regression/Markov Chain presentationLogistic Regression/Markov Chain presentation
Logistic Regression/Markov Chain presentation
Michael Hankin
 
Stepwise Logistic Regression - Lecture for Students /Faculty of Mathematics a...
Stepwise Logistic Regression - Lecture for Students /Faculty of Mathematics a...Stepwise Logistic Regression - Lecture for Students /Faculty of Mathematics a...
Stepwise Logistic Regression - Lecture for Students /Faculty of Mathematics a...
Alexander Efremov
 
Logistic regression (blyth 2006) (simplified)
Logistic regression (blyth 2006) (simplified)Logistic regression (blyth 2006) (simplified)
Logistic regression (blyth 2006) (simplified)
MikeBlyth
 
Logistic Regression Analysis
Logistic Regression AnalysisLogistic Regression Analysis
Logistic Regression Analysis
COSTARCH Analytical Consulting (P) Ltd.
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
Venkata Reddy Konasani
 
Machine learning overview (with SAS software)
Machine learning overview (with SAS software)Machine learning overview (with SAS software)
Machine learning overview (with SAS software)
Longhow Lam
 
STATA - Time Series Analysis
STATA - Time Series AnalysisSTATA - Time Series Analysis
STATA - Time Series Analysis
stata_org_uk
 
Analysis of variance (ANOVA)
Analysis of variance (ANOVA)Analysis of variance (ANOVA)
Analysis of variance (ANOVA)
Sneh Kumari
 

Viewers also liked (19)

20120329實習課
20120329實習課20120329實習課
20120329實習課
 
Sas corr
Sas corrSas corr
Sas corr
 
0530 sas實習課
0530 sas實習課0530 sas實習課
0530 sas實習課
 
SAS 0412
SAS 0412SAS 0412
SAS 0412
 
Sas tutorial 0308
Sas tutorial 0308Sas tutorial 0308
Sas tutorial 0308
 
20120322實習課
20120322實習課20120322實習課
20120322實習課
 
Harvard Forest GLMM talk
Harvard Forest GLMM talkHarvard Forest GLMM talk
Harvard Forest GLMM talk
 
Sas tutorial glm1
Sas tutorial glm1Sas tutorial glm1
Sas tutorial glm1
 
Predictive Analysis with SAS
Predictive Analysis with SAS Predictive Analysis with SAS
Predictive Analysis with SAS
 
To predict the academic performance of an elementary school using Linear Regr...
To predict the academic performance of an elementary school using Linear Regr...To predict the academic performance of an elementary school using Linear Regr...
To predict the academic performance of an elementary school using Linear Regr...
 
SAS Project
SAS ProjectSAS Project
SAS Project
 
Logistic Regression/Markov Chain presentation
Logistic Regression/Markov Chain presentationLogistic Regression/Markov Chain presentation
Logistic Regression/Markov Chain presentation
 
Stepwise Logistic Regression - Lecture for Students /Faculty of Mathematics a...
Stepwise Logistic Regression - Lecture for Students /Faculty of Mathematics a...Stepwise Logistic Regression - Lecture for Students /Faculty of Mathematics a...
Stepwise Logistic Regression - Lecture for Students /Faculty of Mathematics a...
 
Logistic regression (blyth 2006) (simplified)
Logistic regression (blyth 2006) (simplified)Logistic regression (blyth 2006) (simplified)
Logistic regression (blyth 2006) (simplified)
 
Logistic Regression Analysis
Logistic Regression AnalysisLogistic Regression Analysis
Logistic Regression Analysis
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Machine learning overview (with SAS software)
Machine learning overview (with SAS software)Machine learning overview (with SAS software)
Machine learning overview (with SAS software)
 
STATA - Time Series Analysis
STATA - Time Series AnalysisSTATA - Time Series Analysis
STATA - Time Series Analysis
 
Analysis of variance (ANOVA)
Analysis of variance (ANOVA)Analysis of variance (ANOVA)
Analysis of variance (ANOVA)
 

Similar to Sas reg multi

Sas reg simple
Sas reg simpleSas reg simple
Sas reg simple
WenSheng Chang
 
Sas plot
Sas plotSas plot
Sas plot
WenSheng Chang
 
Unit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithmsUnit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithms
Amol Gaikwad
 
Lline Drawing Algorithm
Lline Drawing AlgorithmLline Drawing Algorithm
Lline Drawing Algorithm
nehrurevathy
 
DDA algorithm
DDA algorithmDDA algorithm
DDA algorithm
Yash Patel
 
Solucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdfSolucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdf
JeancarlosPatalasanc
 
MATLAB ARRAYS
MATLAB ARRAYSMATLAB ARRAYS
MATLAB ARRAYS
Aditya Choudhury
 
Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - Notes
Omprakash Chauhan
 
cgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdfcgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdf
meenasp
 
introduction to c programming and C History.pptx
introduction to c programming and C History.pptxintroduction to c programming and C History.pptx
introduction to c programming and C History.pptx
ManojKhadilkar1
 
20190907 Julia the language for future
20190907 Julia the language for future20190907 Julia the language for future
20190907 Julia the language for future
岳華 杜
 
Vcs16
Vcs16Vcs16
Open GL T0074 56 sm4
Open GL T0074 56 sm4Open GL T0074 56 sm4
Open GL T0074 56 sm4
Roziq Bahtiar
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
Uma mohan
 
3306617
33066173306617
3306617
shwetakks
 
4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx
ssuser255bf1
 
Cs580
Cs580Cs580
CSE240 Pointers
CSE240 PointersCSE240 Pointers
CSE240 Pointers
Garrett Gutierrez
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
Ankit Garg
 
Better performance through Superscalarity
Better performance through SuperscalarityBetter performance through Superscalarity
Better performance through Superscalarity
Mårten Rånge
 

Similar to Sas reg multi (20)

Sas reg simple
Sas reg simpleSas reg simple
Sas reg simple
 
Sas plot
Sas plotSas plot
Sas plot
 
Unit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithmsUnit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithms
 
Lline Drawing Algorithm
Lline Drawing AlgorithmLline Drawing Algorithm
Lline Drawing Algorithm
 
DDA algorithm
DDA algorithmDDA algorithm
DDA algorithm
 
Solucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdfSolucionario_de_Chapra_y_Canale_Quinta_E.pdf
Solucionario_de_Chapra_y_Canale_Quinta_E.pdf
 
MATLAB ARRAYS
MATLAB ARRAYSMATLAB ARRAYS
MATLAB ARRAYS
 
Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - Notes
 
cgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdfcgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdf
 
introduction to c programming and C History.pptx
introduction to c programming and C History.pptxintroduction to c programming and C History.pptx
introduction to c programming and C History.pptx
 
20190907 Julia the language for future
20190907 Julia the language for future20190907 Julia the language for future
20190907 Julia the language for future
 
Vcs16
Vcs16Vcs16
Vcs16
 
Open GL T0074 56 sm4
Open GL T0074 56 sm4Open GL T0074 56 sm4
Open GL T0074 56 sm4
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
3306617
33066173306617
3306617
 
4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx
 
Cs580
Cs580Cs580
Cs580
 
CSE240 Pointers
CSE240 PointersCSE240 Pointers
CSE240 Pointers
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
 
Better performance through Superscalarity
Better performance through SuperscalarityBetter performance through Superscalarity
Better performance through Superscalarity
 

More from WenSheng Chang

futureNo52
futureNo52futureNo52
futureNo52
WenSheng Chang
 
1129 sas實習課
1129 sas實習課1129 sas實習課
1129 sas實習課
WenSheng Chang
 
Sas tutorial 1018
Sas tutorial 1018Sas tutorial 1018
Sas tutorial 1018
WenSheng Chang
 
Sas tutorial 0524
Sas tutorial 0524Sas tutorial 0524
Sas tutorial 0524
WenSheng Chang
 
Sas tutorial glm2
Sas tutorial glm2Sas tutorial glm2
Sas tutorial glm2
WenSheng Chang
 
Sas tutorial 0308
Sas tutorial 0308Sas tutorial 0308
Sas tutorial 0308
WenSheng Chang
 
Science p79 -- polished
Science p79 -- polishedScience p79 -- polished
Science p79 -- polished
WenSheng Chang
 

More from WenSheng Chang (9)

futureNo52
futureNo52futureNo52
futureNo52
 
1129 sas實習課
1129 sas實習課1129 sas實習課
1129 sas實習課
 
Sas tutorial 1018
Sas tutorial 1018Sas tutorial 1018
Sas tutorial 1018
 
Sas tutorial 0524
Sas tutorial 0524Sas tutorial 0524
Sas tutorial 0524
 
Sas tutorial glm2
Sas tutorial glm2Sas tutorial glm2
Sas tutorial glm2
 
Regression ci
Regression ciRegression ci
Regression ci
 
Sas tutorial 0308
Sas tutorial 0308Sas tutorial 0308
Sas tutorial 0308
 
0925 sas實習課
0925 sas實習課0925 sas實習課
0925 sas實習課
 
Science p79 -- polished
Science p79 -- polishedScience p79 -- polished
Science p79 -- polished
 

Sas reg multi