SlideShare una empresa de Scribd logo
1 de 8
data nasrlab.sales;
input id 1-4 name $ 5-8 date mmddyy10. sale 19-23 expense 24-28;
datalines;
001 abc 02012016 5000 2000
002 ahd 02042016 4000 1000
003 abc 03022016 6000 2500
004 ahd 02122016 4200 1100
;
run;
proc print data=nasrlab.sales;
format date mmddyy10. sale dollar. expense dollar.;
run;
data labedsales;
set nasrlab.sales;
label name="saleman"
sale="reveue"
;
run;
proc means data=nasrlab.sales;
var sale expense;
output out=maximas
max =maxsales maxexp
maxid (sale (name) expense(name))=effecient inefficient;
run;
_________________________
proc univariate data=sashelp.heart;
var Weight;
run;
proc univariate data=sashelp.heart;
var Weight;
qqplot/ normal(mu=est sigma=est color=green);
run;
proc univariate data=nasrlab.sales trimmed=0.1 0.01
winsorized=0.1
robustscale;
var sale;
run;
proc univariate data=height;
var hight weight;
pctlpre= w h
pctlpts= 12 15 89 45;
run;
___________________________
proc freq data=sashelp.heart;
table ageatdeath status;
run;
proc freq data=sashelp.heart;
table ageatdeath*status/missing;
run;
proc freq data=sashelp.heart;
table Smoking_Status*DeathCause/chisq;
run;
proc freq data=sashelp.heart;
by sex;
table Smoking_Status*DeathCause;
run;
proc freq data=nasrlab.grade;
table gender*section;
table gender*section/plot=freqplot(type=dot);
weight score;
run;
__________________________________________
proc corr data=nasrlab.sales proc corr data=nasrlab.sales;
run;
proc corr data=nasrlab.sales kendall pearson spearman fisher;
run;
proc corr data=nasrlab.sales alpha;
run;
proc corr data=nasrlab.sales csscp cov;
run;
proc corr data=nasrlab.sales plots=matrix(histogram);
run;
____________________________________________
PROC PRINT DATA=nasrlab.toy; RUN;
proc sort data=nasrlab.toy;
by country;
run;
proc transpose data=nasrlab.toy out=toytrans;
by country;
run;
data paneltoy (rename=(col1=ptl col2=pgrt col3=srfa));
set toytrans;
run;
proc panel data=toytrans;
id country _name_;
lag col1(1)/out=lagpanel;
run;
data lgdif;
set toytrans;
by country;
lgc1=lag(col1);
lgc2=lag (col2);
lgc3= lag(col3);
dfc1=dif (col1);
dfc2=dif (col2);
dfc3=dif(col3);
run;
____________________________________________
data baseball2;
set sashelp.baseball;
format Division DOLLAR8.;
label salary ='salary in 1000';
run;
data base1 (keep=name--yrmajor);
set sashelp.baseball;
run;
data base3;
set base2;
if name='Griffin, Alfredo' then natbat=.;
run;
data base2;
set base3;
obs+1;
run;
proc means data=base2;
run;
proc print data=base2;
where natbat=.;
run;
proc means data=base2 mean;
var natbat;
where nruns=74;
run;
proc means data=base2 mean;
where yrmajor=11 ;
where nbb=34;
var natbat;
run;
data base3;
set base2;
if name='Griffin, Alfredo' then natbat=510;
run;
proc means data=base3;
var nruns;
output out=maxee
max=runnnsss
min=rn
maxid(nruns(name))=maxrun
minid (nruns(name))=minrun;
run;
______________________________________
data dummy;
set sashelp.iris;
if species='Setosa' then dsetosa=1;
else dsetosa=0;
if species='Versicolor' then dver=1;
else dver=0;
run;
data asn;
set nasrlab.tours;
totcost=aircost+20;
run;
data asn;
set nasrlab.tours;
totcost=sum(aircost,20);
run;
data asn;
set nasrlab.tours;
if vendors='hispania' then nobonus = 'yes';
else if vendors='major' then bonus= 'yes';
else bonus='dontknw';
run;
data asn;
set nasrlab.tours;
if vendors='hispania' then bonus = 'null';
else if vendors='major' then bonus= 'allpeoples';
else bonus='for5plus';
run;
data asn;
set nasrlab.tours;
if vendors='hispania' then delete;
run;
data asn;
set nasrlab.tours;
mult=aircost*landcost;
add=aircost+landcost;
sub=aircost-landcost;
run;
data asn;
set nasrlab.tours;
nigtsr=round(nights,5);
landcr=round(landcost,50);
run;
data asn;
set nasrlab.tours;
totcostrnd=round(sum(aircost,landcost),5);
run;
data asn;
set nasrlab.tours;
totcostrnd=round(sum(aircost,landcost),5);
run;
data asn;
set nasrlab.airtour;
if tourguide=backupguide then remark='problem';
else if tourguide='' or backupguide ='' then remark='check';
else remark='ok';
run;
data asn;
set nasrlab.airtour;
part1=scan(eventdescription,2,',');
run;
data asn;
set nasrlab.airtour;
part1=scan(eventdescription,2,',');
part1left=left(scan(eventdescription,2,','));
partc1right=right(scan(eventdescription,2,','));
run;
data asn;
set nasrlab.airtour;
allguide=tourguide||backupguide;
run;
data asn;
set nasrlab.airtour;
allguide=trim(tourguide||backupguide);
run;
data asn;
set nasrlab.airtour;
allguide=tourguide||'/'||backupguide;
run;
data nn;
set abd;
if status='Dead' then remarks=deathcause||'
';
else remarks =('bp='|| Bp_Status||'wgtstus=' ||
Weight_Status||'smkgstatus='||Smoking_Status||'chlstatus='||
cholesterol_Status);
run;
data asn;
set nasrlab.airtour;
if landcost=. then tour ='pata nae';
else if landcost<500 then tour='sasta';
else if landcost<1000 then tour ='guzara';
else tour='mehnga';
run;
data sng;
set nasrlab.airtour;
if 500<=landcost<=1000 then type='medium';
else if 1000<landcost then type='high';
else type='low';
run;
data sng;
set nasrlab.airtour;
if (nights>3 or numberofevents>5) and (tourguide='Lucas' or city='Paris')
then type='mixture';
else type='olamba';
run;
data sng;
set nasrlab.airtour;
if landcost then rmarks='nonmissing';
run;
data sng;
set nasrlab.airtour;
if tourguide='lucas' then group='a';
else group='b';
run;
data sng;
set nasrlab.airtour;
if upcase(tourguide)='LUCAS' then group='a';
else group='b';
run;
data sng;
set nasrlab.airtour;
if tourguide= : 'L' then choosen='yes';
else choosen='no';
run;
data sng;
set nasrlab.airtour;
if index(eventdescription, 'other') then doubt='yes';
else doubt='no';
run;
data abc;
set nasrlab.airtour;
if index(eventdescription, 'other')then rewiev='yes';
else rewiev='no';
event=index(eventdescription, 'M');
eventm=substr(eventdescription,1,3);
run;
data sng;
set nasrlab.airtour;
if nights>=6;
run;
data sng abc;
set nasrlab.airtour;
if nights>=6 then output sng;
else output abc;
run;
data sng abc;
set nasrlab.airtour;
if tourguide='Lucas' then output sng;
else output abc;
ngghts=nights+1;
run;
proc print data=sng;
run;
data sng abc;
set nasrlab.airtour;
ngghts=nights+1;
if tourguide='Lucas' then output sng;
else output abc;
run;
data ab bc de fg;
set nasrlab.airtour;
if tourguide='Lucas' then output ab;
else output bc;
if nights > 6 then output de;
else output=fg;
run;
proc sort data=nasrlab.airtour out=abcd;
by city;
run;
data cars;
set sashelp.cars;
run;
proc sort data=cars;
by type;
run;
proc means data=cars;
by origin type;
run;
data crr;
set cars;
by type;
abc=first.Type;
def=last.Type;
run;
proc sort data=nasrlab.airtour out=nodps noduprecs;
by city;
data abc;
set nasrlab.data6 nasrlab.data7;
run;
data abc2;
set nasrlab.data6 nasrlab.data7;
by year;
run;
data abc3;
merge nasrlab.data6 nasrlab.data7;
run;
data abc4;
set nasrlab.data6;
if year=1997 then delete;
run;
data abc3;
merge abc4 nasrlab.data7;
run;
data abc3;
merge abc4 nasrlab.data7;
by year;
run;
data abc5;
merge nasrlab.class(drop= year major)
nasrlab.class2(drop=year major rename=(name=name2));
run;
data abc6;
merge nasrlab.class
nasrlab.class2(rename=(name=name2 year=year2 major=major2));
run;
data abc7;
merge nasrlab.company nasrlab.finance;
by name;
run;
proc sort data=nasrlab.shoes;
by type;
run;
proc sort data=nasrlab.discount;
by type;
run;
data nasrlab.shoes2;
set nasrlab.shoes2;
if type='C-Trian' then type='C-Train';
run;
data abc8;
merge nasrlab.shoes2 nasrlab.discount;
by type;
run;
data abc8;
merge nasrlab.shoes2 nasrlab.discount;
by type;
discountamont=regularprice*adjustment;
newprce=regularprice-discountamont;
run;
proc means data=abc8;
var newprce;
by type;
output out=summary sum(newprce)=total;
run;
data abc;
MERGE abc8 summary (drop= _TYPE_ _FREQ_);
by type;
run;
data abc8;
merge nasrlab.shoes2 nasrlab.discount;
by type;
discountamont=regularprice*adjustment;
newprce=regularprice-discountamont;
run;
proc means data=abc8;
var newprce;
by type;
output out=summary sum(newprce)=total;
run;
data abc;
MERGE abc8 summary (drop= _TYPE_ _FREQ_);
by type;
run;
data pca3(keep= item13--item26);
set nasrlab.pca3;
run;
proc factor data=pca3
simple
method=prin
priors=one
scree
rotate=varimax
round
flag=0.4;
var item13--item26;
run;
proc factor data=pca3 out=pcaresults (rename=(factor1=intrustchr
factor2=intrvw))
simple
method=prin
priors=one
nfactors=2
scree
rotate=varimax
round
flag=0.4;
var item13--item26;
data base12 (keep=name--yrmajor);
set sashelp.baseball;
run;
proc corr data=base12 PLOTS=matrix(histogram)plots(MAXPOINTS=none);
var natbat nhits nhome nrbi nbb;
run;
proc reg data=base12;
model nhits= nhome nrbi nbb yrmajor;
run;
proc reg data=base12;
model nhits= nhome nrbi nbb yrmajor;
output out=influe (keep=nhits nhome nrbi nbb yrmajor rsd lev ck dff)
rstudent=rsd h=lev cookd=ck dffits=dff;
run;
PROC PRINT DATA=INFLUE;
WHERE abs(rsd)>2;
RUN;
proc print data=influe;
where lev>(2*4+2)/322;
run;
proc print data=influe;
where abs(rsd)>2 AND lev>(2*4+2)/322;
run;
PROC PRINT DATA=INFLUE;
WHERE ck>4/322;
run;
proc print data=influe;
where dffit>2*srt(k)/n
data influe2;
set influe;
sn+1;
run;
proc reg data=influe2;
model nhits= nhome nrbi nbb yrmajor;
where sn NE 141;
run;
data basement;
set sashelp.baseball;
sn+1;
run;
proc reg data=basement;
model nhits= nhome nrbi nbb yrmajor/influence;
id sn;
run;
data base16;
set sashelp.baseball;
run;
data base17;
set base16;
if league='American' then dusa=1;
else dusa=0;
if league='National' then dnat=1;
else dnat=0;
run;
proc reg data=base17;
model nhits=dusa nhome nrbi nbb yrmajor;
run;
proc reg data=base17;
model nhits=dnat dusa nhome nrbi nbb yrmajor/noint;
run;
data base18;
set base17;
interusanbri=dusa*nRBI;
run;
proc reg data=base18;
model nhits=interusa nhome nrbi nbb yrmajor;
run;
proc reg data=abc;
model loginvice=MPG_CITY Weight dasia deurope;
output out=pred (keep=predctdinv)
predicted=predctdinv;
run;
proc reg data=abc;
model loginvice=MPG_CITY Weight dasia deurope/influence;
ods output outputstatistics=lps;
run;

Más contenido relacionado

La actualidad más candente

R (Shiny Package) - UI Side Script for Decision Support System
R (Shiny Package) - UI Side Script for Decision Support SystemR (Shiny Package) - UI Side Script for Decision Support System
R (Shiny Package) - UI Side Script for Decision Support SystemMaithreya Chakravarthula
 
R (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support SystemR (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support SystemMaithreya Chakravarthula
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Michael Schwern
 
C++ adt c++ implementations
C++   adt c++ implementationsC++   adt c++ implementations
C++ adt c++ implementationsRex Mwamba
 
Congfigure python as_ide
Congfigure python as_ideCongfigure python as_ide
Congfigure python as_ideLingfei Kong
 
11 Things About 11gr2
11 Things About 11gr211 Things About 11gr2
11 Things About 11gr2afa reg
 
Nouveau document texte
Nouveau document texteNouveau document texte
Nouveau document texteSai Ef
 
Yy
YyYy
Yyyygh
 
SAS CODES AND TRICKS
SAS CODES AND TRICKSSAS CODES AND TRICKS
SAS CODES AND TRICKSrizrazariz
 
SfCon: Test Driven Development
SfCon: Test Driven DevelopmentSfCon: Test Driven Development
SfCon: Test Driven DevelopmentAugusto Pascutti
 
c++ program for Canteen management
c++ program for Canteen managementc++ program for Canteen management
c++ program for Canteen managementSwarup Kumar Boro
 
Password protected personal diary report
Password protected personal diary reportPassword protected personal diary report
Password protected personal diary reportMoueed Ahmed
 
Fine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFELFine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFELThomas Zimmermann
 
Dynamically Evolving Systems: Cluster Analysis Using Time
Dynamically Evolving Systems: Cluster Analysis Using TimeDynamically Evolving Systems: Cluster Analysis Using Time
Dynamically Evolving Systems: Cluster Analysis Using TimeMagnify Analytic Solutions
 
Railway reservation system
Railway reservation systemRailway reservation system
Railway reservation systemPrashant Sharma
 

La actualidad más candente (19)

R (Shiny Package) - UI Side Script for Decision Support System
R (Shiny Package) - UI Side Script for Decision Support SystemR (Shiny Package) - UI Side Script for Decision Support System
R (Shiny Package) - UI Side Script for Decision Support System
 
R (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support SystemR (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support System
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
 
Shell.php
Shell.phpShell.php
Shell.php
 
C++ adt c++ implementations
C++   adt c++ implementationsC++   adt c++ implementations
C++ adt c++ implementations
 
Congfigure python as_ide
Congfigure python as_ideCongfigure python as_ide
Congfigure python as_ide
 
11 Things About 11gr2
11 Things About 11gr211 Things About 11gr2
11 Things About 11gr2
 
Nouveau document texte
Nouveau document texteNouveau document texte
Nouveau document texte
 
Yy
YyYy
Yy
 
SAS CODES AND TRICKS
SAS CODES AND TRICKSSAS CODES AND TRICKS
SAS CODES AND TRICKS
 
Groovy kind of test
Groovy kind of testGroovy kind of test
Groovy kind of test
 
C99.php
C99.phpC99.php
C99.php
 
SfCon: Test Driven Development
SfCon: Test Driven DevelopmentSfCon: Test Driven Development
SfCon: Test Driven Development
 
c++ program for Canteen management
c++ program for Canteen managementc++ program for Canteen management
c++ program for Canteen management
 
Password protected personal diary report
Password protected personal diary reportPassword protected personal diary report
Password protected personal diary report
 
C99
C99C99
C99
 
Fine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFELFine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFEL
 
Dynamically Evolving Systems: Cluster Analysis Using Time
Dynamically Evolving Systems: Cluster Analysis Using TimeDynamically Evolving Systems: Cluster Analysis Using Time
Dynamically Evolving Systems: Cluster Analysis Using Time
 
Railway reservation system
Railway reservation systemRailway reservation system
Railway reservation system
 

Similar a My All Codes of SAS

How to sas (informative codes) COMSATS
How to sas (informative codes) COMSATSHow to sas (informative codes) COMSATS
How to sas (informative codes) COMSATSعاطف رضا
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScriptniklal
 
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 OverlordsI, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlordsheumann
 
(Appendix_Codes) Game Programming Portfolio - Soobum Lee
(Appendix_Codes) Game Programming Portfolio - Soobum Lee(Appendix_Codes) Game Programming Portfolio - Soobum Lee
(Appendix_Codes) Game Programming Portfolio - Soobum LeeSOOBUM LEE
 
php global $bsize,$playerToken,$myToken,$gameOver,$winArr,$rowAr.pdf
php global $bsize,$playerToken,$myToken,$gameOver,$winArr,$rowAr.pdfphp global $bsize,$playerToken,$myToken,$gameOver,$winArr,$rowAr.pdf
php global $bsize,$playerToken,$myToken,$gameOver,$winArr,$rowAr.pdfanjalitimecenter11
 
Oneal perl-code-to-extract-from-voyager
Oneal perl-code-to-extract-from-voyagerOneal perl-code-to-extract-from-voyager
Oneal perl-code-to-extract-from-voyagerENUG
 
How to write code you won't hate tomorrow
How to write code you won't hate tomorrowHow to write code you won't hate tomorrow
How to write code you won't hate tomorrowPete McFarlane
 
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB jhchabran
 
calc3build# calc3bison -y -d calc3.yflex calc3.lgcc -c .docx
calc3build# calc3bison -y -d calc3.yflex calc3.lgcc -c .docxcalc3build# calc3bison -y -d calc3.yflex calc3.lgcc -c .docx
calc3build# calc3bison -y -d calc3.yflex calc3.lgcc -c .docxRAHUL126667
 
There's more than one way to empty it
There's more than one way to empty itThere's more than one way to empty it
There's more than one way to empty itAndrew Shitov
 
SAS cheat sheet
SAS cheat sheetSAS cheat sheet
SAS cheat sheetAli Ajouz
 
Perl使いの国のRubyist
Perl使いの国のRubyistPerl使いの国のRubyist
Perl使いの国のRubyistTakafumi ONAKA
 
Bouncingballs sh
Bouncingballs shBouncingballs sh
Bouncingballs shBen Pope
 
Extbase and Beyond
Extbase and BeyondExtbase and Beyond
Extbase and BeyondJochen Rau
 
Javascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introductionJavascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introductionIban Martinez
 

Similar a My All Codes of SAS (20)

How to sas (informative codes) COMSATS
How to sas (informative codes) COMSATSHow to sas (informative codes) COMSATS
How to sas (informative codes) COMSATS
 
Sas Samples
Sas SamplesSas Samples
Sas Samples
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScript
 
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 OverlordsI, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlords
 
(Appendix_Codes) Game Programming Portfolio - Soobum Lee
(Appendix_Codes) Game Programming Portfolio - Soobum Lee(Appendix_Codes) Game Programming Portfolio - Soobum Lee
(Appendix_Codes) Game Programming Portfolio - Soobum Lee
 
php global $bsize,$playerToken,$myToken,$gameOver,$winArr,$rowAr.pdf
php global $bsize,$playerToken,$myToken,$gameOver,$winArr,$rowAr.pdfphp global $bsize,$playerToken,$myToken,$gameOver,$winArr,$rowAr.pdf
php global $bsize,$playerToken,$myToken,$gameOver,$winArr,$rowAr.pdf
 
sas aeroplan sample
sas aeroplan samplesas aeroplan sample
sas aeroplan sample
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
Oneal perl-code-to-extract-from-voyager
Oneal perl-code-to-extract-from-voyagerOneal perl-code-to-extract-from-voyager
Oneal perl-code-to-extract-from-voyager
 
Signal Stacktrace
Signal StacktraceSignal Stacktrace
Signal Stacktrace
 
How to write code you won't hate tomorrow
How to write code you won't hate tomorrowHow to write code you won't hate tomorrow
How to write code you won't hate tomorrow
 
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
 
calc3build# calc3bison -y -d calc3.yflex calc3.lgcc -c .docx
calc3build# calc3bison -y -d calc3.yflex calc3.lgcc -c .docxcalc3build# calc3bison -y -d calc3.yflex calc3.lgcc -c .docx
calc3build# calc3bison -y -d calc3.yflex calc3.lgcc -c .docx
 
There's more than one way to empty it
There's more than one way to empty itThere's more than one way to empty it
There's more than one way to empty it
 
SAS cheat sheet
SAS cheat sheetSAS cheat sheet
SAS cheat sheet
 
Perl使いの国のRubyist
Perl使いの国のRubyistPerl使いの国のRubyist
Perl使いの国のRubyist
 
Bouncingballs sh
Bouncingballs shBouncingballs sh
Bouncingballs sh
 
Bag of tricks
Bag of tricksBag of tricks
Bag of tricks
 
Extbase and Beyond
Extbase and BeyondExtbase and Beyond
Extbase and Beyond
 
Javascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introductionJavascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introduction
 

Más de rizrazariz

Chapter 1 - Research Methods for Business By Authors Uma Sekaran and Roger Bo...
Chapter 1 - Research Methods for Business By Authors Uma Sekaran and Roger Bo...Chapter 1 - Research Methods for Business By Authors Uma Sekaran and Roger Bo...
Chapter 1 - Research Methods for Business By Authors Uma Sekaran and Roger Bo...rizrazariz
 
Chapter 1 Ten Principles 1.pptx
Chapter 1 Ten Principles 1.pptxChapter 1 Ten Principles 1.pptx
Chapter 1 Ten Principles 1.pptxrizrazariz
 
Dessler_HRM_PPT_05.ppt
Dessler_HRM_PPT_05.pptDessler_HRM_PPT_05.ppt
Dessler_HRM_PPT_05.pptrizrazariz
 
daniels12_01.ppt
daniels12_01.pptdaniels12_01.ppt
daniels12_01.pptrizrazariz
 

Más de rizrazariz (7)

Chapter 1 - Research Methods for Business By Authors Uma Sekaran and Roger Bo...
Chapter 1 - Research Methods for Business By Authors Uma Sekaran and Roger Bo...Chapter 1 - Research Methods for Business By Authors Uma Sekaran and Roger Bo...
Chapter 1 - Research Methods for Business By Authors Uma Sekaran and Roger Bo...
 
ch04.ppt
ch04.pptch04.ppt
ch04.ppt
 
Chapter 1 Ten Principles 1.pptx
Chapter 1 Ten Principles 1.pptxChapter 1 Ten Principles 1.pptx
Chapter 1 Ten Principles 1.pptx
 
Dessler_HRM_PPT_05.ppt
Dessler_HRM_PPT_05.pptDessler_HRM_PPT_05.ppt
Dessler_HRM_PPT_05.ppt
 
daniels12_01.ppt
daniels12_01.pptdaniels12_01.ppt
daniels12_01.ppt
 
2
22
2
 
2
22
2
 

Último

VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...Suhani Kapoor
 
A305_A2_file_Batkhuu progress report.pdf
A305_A2_file_Batkhuu progress report.pdfA305_A2_file_Batkhuu progress report.pdf
A305_A2_file_Batkhuu progress report.pdftbatkhuu1
 
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 DelhiCall Girls in Delhi
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...lizamodels9
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxAndy Lambert
 
Event mailer assignment progress report .pdf
Event mailer assignment progress report .pdfEvent mailer assignment progress report .pdf
Event mailer assignment progress report .pdftbatkhuu1
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.Aaiza Hassan
 
Unlocking the Secrets of Affiliate Marketing.pdf
Unlocking the Secrets of Affiliate Marketing.pdfUnlocking the Secrets of Affiliate Marketing.pdf
Unlocking the Secrets of Affiliate Marketing.pdfOnline Income Engine
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...Aggregage
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876dlhescort
 
Understanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key InsightsUnderstanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key Insightsseri bangash
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Serviceritikaroy0888
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Roland Driesen
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfPaul Menig
 
Call Girls In Holiday Inn Express Gurugram➥99902@11544 ( Best price)100% Genu...
Call Girls In Holiday Inn Express Gurugram➥99902@11544 ( Best price)100% Genu...Call Girls In Holiday Inn Express Gurugram➥99902@11544 ( Best price)100% Genu...
Call Girls In Holiday Inn Express Gurugram➥99902@11544 ( Best price)100% Genu...lizamodels9
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsP&CO
 
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetCreating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetDenis Gagné
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 

Último (20)

VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
VIP Call Girls Gandi Maisamma ( Hyderabad ) Phone 8250192130 | ₹5k To 25k Wit...
 
A305_A2_file_Batkhuu progress report.pdf
A305_A2_file_Batkhuu progress report.pdfA305_A2_file_Batkhuu progress report.pdf
A305_A2_file_Batkhuu progress report.pdf
 
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Greater Kailash ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
Monthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptxMonthly Social Media Update April 2024 pptx.pptx
Monthly Social Media Update April 2024 pptx.pptx
 
Event mailer assignment progress report .pdf
Event mailer assignment progress report .pdfEvent mailer assignment progress report .pdf
Event mailer assignment progress report .pdf
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.
 
Unlocking the Secrets of Affiliate Marketing.pdf
Unlocking the Secrets of Affiliate Marketing.pdfUnlocking the Secrets of Affiliate Marketing.pdf
Unlocking the Secrets of Affiliate Marketing.pdf
 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
 
Understanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key InsightsUnderstanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key Insights
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdf
 
Call Girls In Holiday Inn Express Gurugram➥99902@11544 ( Best price)100% Genu...
Call Girls In Holiday Inn Express Gurugram➥99902@11544 ( Best price)100% Genu...Call Girls In Holiday Inn Express Gurugram➥99902@11544 ( Best price)100% Genu...
Call Girls In Holiday Inn Express Gurugram➥99902@11544 ( Best price)100% Genu...
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetCreating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 

My All Codes of SAS

  • 1. data nasrlab.sales; input id 1-4 name $ 5-8 date mmddyy10. sale 19-23 expense 24-28; datalines; 001 abc 02012016 5000 2000 002 ahd 02042016 4000 1000 003 abc 03022016 6000 2500 004 ahd 02122016 4200 1100 ; run; proc print data=nasrlab.sales; format date mmddyy10. sale dollar. expense dollar.; run; data labedsales; set nasrlab.sales; label name="saleman" sale="reveue" ; run; proc means data=nasrlab.sales; var sale expense; output out=maximas max =maxsales maxexp maxid (sale (name) expense(name))=effecient inefficient; run; _________________________ proc univariate data=sashelp.heart; var Weight; run; proc univariate data=sashelp.heart; var Weight; qqplot/ normal(mu=est sigma=est color=green); run; proc univariate data=nasrlab.sales trimmed=0.1 0.01 winsorized=0.1 robustscale; var sale; run; proc univariate data=height; var hight weight; pctlpre= w h pctlpts= 12 15 89 45; run; ___________________________ proc freq data=sashelp.heart; table ageatdeath status; run; proc freq data=sashelp.heart; table ageatdeath*status/missing; run; proc freq data=sashelp.heart; table Smoking_Status*DeathCause/chisq; run; proc freq data=sashelp.heart; by sex; table Smoking_Status*DeathCause; run; proc freq data=nasrlab.grade; table gender*section; table gender*section/plot=freqplot(type=dot);
  • 2. weight score; run; __________________________________________ proc corr data=nasrlab.sales proc corr data=nasrlab.sales; run; proc corr data=nasrlab.sales kendall pearson spearman fisher; run; proc corr data=nasrlab.sales alpha; run; proc corr data=nasrlab.sales csscp cov; run; proc corr data=nasrlab.sales plots=matrix(histogram); run; ____________________________________________ PROC PRINT DATA=nasrlab.toy; RUN; proc sort data=nasrlab.toy; by country; run; proc transpose data=nasrlab.toy out=toytrans; by country; run; data paneltoy (rename=(col1=ptl col2=pgrt col3=srfa)); set toytrans; run; proc panel data=toytrans; id country _name_; lag col1(1)/out=lagpanel; run; data lgdif; set toytrans; by country; lgc1=lag(col1); lgc2=lag (col2); lgc3= lag(col3); dfc1=dif (col1); dfc2=dif (col2); dfc3=dif(col3); run; ____________________________________________ data baseball2; set sashelp.baseball; format Division DOLLAR8.; label salary ='salary in 1000'; run; data base1 (keep=name--yrmajor); set sashelp.baseball; run; data base3; set base2; if name='Griffin, Alfredo' then natbat=.; run; data base2; set base3; obs+1; run; proc means data=base2; run; proc print data=base2; where natbat=.; run; proc means data=base2 mean; var natbat; where nruns=74; run;
  • 3. proc means data=base2 mean; where yrmajor=11 ; where nbb=34; var natbat; run; data base3; set base2; if name='Griffin, Alfredo' then natbat=510; run; proc means data=base3; var nruns; output out=maxee max=runnnsss min=rn maxid(nruns(name))=maxrun minid (nruns(name))=minrun; run; ______________________________________ data dummy; set sashelp.iris; if species='Setosa' then dsetosa=1; else dsetosa=0; if species='Versicolor' then dver=1; else dver=0; run; data asn; set nasrlab.tours; totcost=aircost+20; run; data asn; set nasrlab.tours; totcost=sum(aircost,20); run; data asn; set nasrlab.tours; if vendors='hispania' then nobonus = 'yes'; else if vendors='major' then bonus= 'yes'; else bonus='dontknw'; run; data asn; set nasrlab.tours; if vendors='hispania' then bonus = 'null'; else if vendors='major' then bonus= 'allpeoples'; else bonus='for5plus'; run; data asn; set nasrlab.tours; if vendors='hispania' then delete; run; data asn; set nasrlab.tours; mult=aircost*landcost; add=aircost+landcost; sub=aircost-landcost; run; data asn; set nasrlab.tours; nigtsr=round(nights,5); landcr=round(landcost,50); run; data asn; set nasrlab.tours; totcostrnd=round(sum(aircost,landcost),5);
  • 4. run; data asn; set nasrlab.tours; totcostrnd=round(sum(aircost,landcost),5); run; data asn; set nasrlab.airtour; if tourguide=backupguide then remark='problem'; else if tourguide='' or backupguide ='' then remark='check'; else remark='ok'; run; data asn; set nasrlab.airtour; part1=scan(eventdescription,2,','); run; data asn; set nasrlab.airtour; part1=scan(eventdescription,2,','); part1left=left(scan(eventdescription,2,',')); partc1right=right(scan(eventdescription,2,',')); run; data asn; set nasrlab.airtour; allguide=tourguide||backupguide; run; data asn; set nasrlab.airtour; allguide=trim(tourguide||backupguide); run; data asn; set nasrlab.airtour; allguide=tourguide||'/'||backupguide; run; data nn; set abd; if status='Dead' then remarks=deathcause||' '; else remarks =('bp='|| Bp_Status||'wgtstus=' || Weight_Status||'smkgstatus='||Smoking_Status||'chlstatus='|| cholesterol_Status); run; data asn; set nasrlab.airtour; if landcost=. then tour ='pata nae'; else if landcost<500 then tour='sasta'; else if landcost<1000 then tour ='guzara'; else tour='mehnga'; run; data sng; set nasrlab.airtour; if 500<=landcost<=1000 then type='medium'; else if 1000<landcost then type='high'; else type='low'; run; data sng; set nasrlab.airtour; if (nights>3 or numberofevents>5) and (tourguide='Lucas' or city='Paris') then type='mixture'; else type='olamba'; run; data sng; set nasrlab.airtour; if landcost then rmarks='nonmissing'; run;
  • 5. data sng; set nasrlab.airtour; if tourguide='lucas' then group='a'; else group='b'; run; data sng; set nasrlab.airtour; if upcase(tourguide)='LUCAS' then group='a'; else group='b'; run; data sng; set nasrlab.airtour; if tourguide= : 'L' then choosen='yes'; else choosen='no'; run; data sng; set nasrlab.airtour; if index(eventdescription, 'other') then doubt='yes'; else doubt='no'; run; data abc; set nasrlab.airtour; if index(eventdescription, 'other')then rewiev='yes'; else rewiev='no'; event=index(eventdescription, 'M'); eventm=substr(eventdescription,1,3); run; data sng; set nasrlab.airtour; if nights>=6; run; data sng abc; set nasrlab.airtour; if nights>=6 then output sng; else output abc; run; data sng abc; set nasrlab.airtour; if tourguide='Lucas' then output sng; else output abc; ngghts=nights+1; run; proc print data=sng; run; data sng abc; set nasrlab.airtour; ngghts=nights+1; if tourguide='Lucas' then output sng; else output abc; run; data ab bc de fg; set nasrlab.airtour; if tourguide='Lucas' then output ab; else output bc; if nights > 6 then output de; else output=fg; run; proc sort data=nasrlab.airtour out=abcd; by city; run; data cars; set sashelp.cars; run; proc sort data=cars;
  • 6. by type; run; proc means data=cars; by origin type; run; data crr; set cars; by type; abc=first.Type; def=last.Type; run; proc sort data=nasrlab.airtour out=nodps noduprecs; by city; data abc; set nasrlab.data6 nasrlab.data7; run; data abc2; set nasrlab.data6 nasrlab.data7; by year; run; data abc3; merge nasrlab.data6 nasrlab.data7; run; data abc4; set nasrlab.data6; if year=1997 then delete; run; data abc3; merge abc4 nasrlab.data7; run; data abc3; merge abc4 nasrlab.data7; by year; run; data abc5; merge nasrlab.class(drop= year major) nasrlab.class2(drop=year major rename=(name=name2)); run; data abc6; merge nasrlab.class nasrlab.class2(rename=(name=name2 year=year2 major=major2)); run; data abc7; merge nasrlab.company nasrlab.finance; by name; run; proc sort data=nasrlab.shoes; by type; run; proc sort data=nasrlab.discount; by type; run; data nasrlab.shoes2; set nasrlab.shoes2; if type='C-Trian' then type='C-Train'; run; data abc8; merge nasrlab.shoes2 nasrlab.discount; by type; run; data abc8; merge nasrlab.shoes2 nasrlab.discount; by type;
  • 7. discountamont=regularprice*adjustment; newprce=regularprice-discountamont; run; proc means data=abc8; var newprce; by type; output out=summary sum(newprce)=total; run; data abc; MERGE abc8 summary (drop= _TYPE_ _FREQ_); by type; run; data abc8; merge nasrlab.shoes2 nasrlab.discount; by type; discountamont=regularprice*adjustment; newprce=regularprice-discountamont; run; proc means data=abc8; var newprce; by type; output out=summary sum(newprce)=total; run; data abc; MERGE abc8 summary (drop= _TYPE_ _FREQ_); by type; run; data pca3(keep= item13--item26); set nasrlab.pca3; run; proc factor data=pca3 simple method=prin priors=one scree rotate=varimax round flag=0.4; var item13--item26; run; proc factor data=pca3 out=pcaresults (rename=(factor1=intrustchr factor2=intrvw)) simple method=prin priors=one nfactors=2 scree rotate=varimax round flag=0.4; var item13--item26; data base12 (keep=name--yrmajor); set sashelp.baseball; run; proc corr data=base12 PLOTS=matrix(histogram)plots(MAXPOINTS=none); var natbat nhits nhome nrbi nbb; run; proc reg data=base12; model nhits= nhome nrbi nbb yrmajor; run; proc reg data=base12; model nhits= nhome nrbi nbb yrmajor; output out=influe (keep=nhits nhome nrbi nbb yrmajor rsd lev ck dff)
  • 8. rstudent=rsd h=lev cookd=ck dffits=dff; run; PROC PRINT DATA=INFLUE; WHERE abs(rsd)>2; RUN; proc print data=influe; where lev>(2*4+2)/322; run; proc print data=influe; where abs(rsd)>2 AND lev>(2*4+2)/322; run; PROC PRINT DATA=INFLUE; WHERE ck>4/322; run; proc print data=influe; where dffit>2*srt(k)/n data influe2; set influe; sn+1; run; proc reg data=influe2; model nhits= nhome nrbi nbb yrmajor; where sn NE 141; run; data basement; set sashelp.baseball; sn+1; run; proc reg data=basement; model nhits= nhome nrbi nbb yrmajor/influence; id sn; run; data base16; set sashelp.baseball; run; data base17; set base16; if league='American' then dusa=1; else dusa=0; if league='National' then dnat=1; else dnat=0; run; proc reg data=base17; model nhits=dusa nhome nrbi nbb yrmajor; run; proc reg data=base17; model nhits=dnat dusa nhome nrbi nbb yrmajor/noint; run; data base18; set base17; interusanbri=dusa*nRBI; run; proc reg data=base18; model nhits=interusa nhome nrbi nbb yrmajor; run; proc reg data=abc; model loginvice=MPG_CITY Weight dasia deurope; output out=pred (keep=predctdinv) predicted=predctdinv; run; proc reg data=abc; model loginvice=MPG_CITY Weight dasia deurope/influence; ods output outputstatistics=lps; run;