KB: SAS cheat sheet

Histogram

proc univariate data=passenger;
 histogram N;
 run;

Mean, Frequency

proc means data=passenger;
 var N;
 run;

proc freq data=t1_santa;
weight n;
tables believe*age / chisq;
run;

ROC

proc logistic data=challenger_data descending plots=(EFFECT ROC(id=prob));
   model failure = temp;
run;

Reading tab delimited text file

data t2_crab;
infile "c:\temp\crab.txt" dsd dlm='09'x;
input id t wt w sa;
run;

Reading tab delimited text file, skipping the header row

data t2_crab;
infile "c:\temp\crab.txt" dsd dlm='09'x firstobs=2;
input id t wt w sa;
run;

Reading tab delimited text file, with string longer than 8 chars

data epl;
infile "C:\temp\epl.txt" dsd dlm='09'x ;
input season_team:$40. season:$9. stage team:$30. opp:$30. team_season_pos opp_season_pos team_goal opp_goal net_pos net_goal home_away:$1. result:$1. form:$3.;
run;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s