1 / 8

SAS ‘interface’

SAS ‘interface’.

jalia
Download Presentation

SAS ‘interface’

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 – www.sas.com, www.r-project.org, www.mrc-bsu.cam.ac.uk/bugs/, www.ats.ucla.edu/stat

  2. Reading in Data Interactively (demonstration)SAS data sets with libnameslibname 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' ;proccopyin=work out=outto;select eff;run;Look at log

  4. Data Steps Subsetting some variable and observationsdata 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 variablesdata 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)procprintdata=b; where slpchg2=0.1;run; procprintdata=b; where slpchg2 ne slpchg3;run;Look at log

  7. Data Step Functions Similar functions as in R or othersdata 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 observationsdata d; set in.eff;keep subjid rxgp age status slpchg slpchg2 sleep0;if itt=1 and week=99thendo obnew=1to3; slpchg2=round(slpchg+ 0.5*normal(0),0.01);output;end;run;Look at log

More Related