Presentation is loading. Please wait.

Presentation is loading. Please wait.

SAS ‘interface’ editor, log, output menus/tabs “Solutions” tab (look it over to see what SAS can do) “Help” tab - for any of R, SAS, WinBUGS the internet.

Similar presentations


Presentation on theme: "SAS ‘interface’ editor, log, output menus/tabs “Solutions” tab (look it over to see what SAS can do) “Help” tab - for any of R, SAS, WinBUGS the internet."— Presentation transcript:

1 SAS ‘interface’ editor, log, output menus/tabs “Solutions” tab (look it over to see what SAS can do) “Help” tab - for any of R, SAS, WinBUGS the internet has some very useful info but exercise a bit of caution when ‘unofficial’ help –

2 Reading in Data Interactively (demonstration) SAS data sets with libnames libname in 'C:\Documents and Settings\WHALEN\Desktop' access=readonly; options nofmterr; Look at log

3 Writing out Data Interactively (demonstration) Exporting SAS dataset in a portable format libname outto xport 'C:\Documents and Settings\WHALEN\Desktop\neweff.xpt' ; proc copy in=work out=outto; select eff; run; Look at log

4 Data Steps Subsetting some variable and observations data a; set in.eff; keep subjid rxgp age status week slpchg sleep0; if itt=1 and week=99; run; Look at log

5 Data Steps Creating new variables data b; set in.eff; keep subjid rxgp age status slpchg sleep0 slpchg2 slpchg3; if itt=1 and week=99; if status='Completed' then slpchg2=slpchg; else slpchg2=0.1; slpchg3=slpchg*(status='Completed') + 0.1*(status ne 'Completed'); run; Look at log

6 Viewing and Checking Data
View data interactively (demonstration) proc print data=b; where slpchg2=0.1; run; proc print data=b; where slpchg2 ne slpchg3; run; Look at log

7 Data Step Functions Similar functions as in R or others data c; set in.eff; keep subjid rxgp age status sleep0 logslp0 log10sp0 expslp0; where itt=1 and week=99; logslp0=log(sleep0); log10sp0=log10(sleep0); * longer names in later SAS ver.; expslp0=exp(sleep0); run;

8 Data Steps Creating new observations data d; set in.eff; keep subjid rxgp age status slpchg slpchg2 sleep0; if itt=1 and week=99 then do obnew=1 to 3; slpchg2=round(slpchg+ 0.5*normal(0),0.01); output; end; run; Look at log


Download ppt "SAS ‘interface’ editor, log, output menus/tabs “Solutions” tab (look it over to see what SAS can do) “Help” tab - for any of R, SAS, WinBUGS the internet."

Similar presentations


Ads by Google