Only print 10 rows, but no observation line numbers
PROC PRINT DATA=auto(obs=10) noobs;
RUN;
We can get descriptive statistics separately for foreign and domestic cars (i.e., broken down by foreign) as shown below.
PROC MEANS DATA=auto;
CLASS foreign;
RUN;
We can get detailed descriptive statistics for price using proc univariate as shown below.
PROC UNIVARIATE DATA=auto;
VAR PRICE;
RUN;
When you use the noduplicates option, the SAS Log displays a note telling you how many duplicates were removed. As you see below, SAS informs us that 1 duplicate observation was deleted.
PROC SORT DATA=auto OUT=auto5 NODUPLICATES ;
BY DESCENDING foreign ;
RUN ;
It is common for duplicate observations to be next to each other in the same file, but if the duplicate observations are not next to each other, there is another strategy you can use to remove the duplicates. You can sort the data file by all of the variables (which can be indicated with the special keyword _ALL_), which would force the duplicate observations to be next to each other. This is illustrated below.
PROC SORT DATA=auto OUT=auto6 NODUPLICATES ;
BY _all_ ;
RUN ;
Thursday, February 28, 2008
Reference Links
http://www.pt.ntu.edu.tw/hmchai/SAS/SAShome.htm
http://www.pt.ntu.edu.tw/hmchai/SAS/SASintroduction/Ex3heelpad.htm
http://www.csulb.edu/~msaintg/ppa696/696uni.htm
http://www.appstat.org.tw/
http://www.statedu.ntu.edu.tw/lecture/SAS_Bio_10/SAS_Bio_10.htm
http://www.uwsp.edu/psych/cw/statmanual/
http://www.ats.ucla.edu/stat/sas/default.htm
http://www.stat.unc.edu/students/owzar/stat101.html
http://its.unm.edu/introductions/Sas_tutorial/
SAS Language Reference: Dictionary
http://www.d.umn.edu/math/docs/saspdf/lgref/pdfidx.htm
http://gears.aset.psu.edu/hpc/education/tutorials/sas/sasstart/
http://www.theamericanprogrammer.com/programming/manuals.sas.shtml
http://www.asu.edu/sas/sasdoc/sashtml/proc/index.htm
http://www.asu.edu/sas/sasdoc/sashtml/proc/z0146802.htm
http://www.cpc.unc.edu/services/computer/presentations/sasclass99
http://learn.sdstate.edu/Dwight_Galster/510docs/Tutorial%20Programs/sas_tutorial_contents.htm
http://instruct.uwo.ca/sociology/300a/SASintro.htm
http://www.psych.yorku.ca/lab/sas/
http://www.pt.ntu.edu.tw/hmchai/SAS/SASintroduction/Ex3heelpad.htm
http://www.csulb.edu/~msaintg/ppa696/696uni.htm
http://www.appstat.org.tw/
http://www.statedu.ntu.edu.tw/lecture/SAS_Bio_10/SAS_Bio_10.htm
http://www.uwsp.edu/psych/cw/statmanual/
http://www.ats.ucla.edu/stat/sas/default.htm
http://www.stat.unc.edu/students/owzar/stat101.html
http://its.unm.edu/introductions/Sas_tutorial/
SAS Language Reference: Dictionary
http://www.d.umn.edu/math/docs/saspdf/lgref/pdfidx.htm
http://gears.aset.psu.edu/hpc/education/tutorials/sas/sasstart/
http://www.theamericanprogrammer.com/programming/manuals.sas.shtml
http://www.asu.edu/sas/sasdoc/sashtml/proc/index.htm
http://www.asu.edu/sas/sasdoc/sashtml/proc/z0146802.htm
http://www.cpc.unc.edu/services/computer/presentations/sasclass99
http://learn.sdstate.edu/Dwight_Galster/510docs/Tutorial%20Programs/sas_tutorial_contents.htm
http://instruct.uwo.ca/sociology/300a/SASintro.htm
http://www.psych.yorku.ca/lab/sas/
USER Data Library
You can use one-level names for permanent SAS data sets by specifying a USER data library. You can assign a USER data library with a LIBNAME statement or with the SAS system option USER=. After you specify a USER data library, the procedure assumes that data sets with one-level names are in the USER data library instead of the WORK data library.
For example, the following PROC PRINT step assumes that DEBATE is in the USER data library:
options user='SAS-data-library';
proc print data=debate;
run;
For example, the following PROC PRINT step assumes that DEBATE is in the USER data library:
options user='SAS-data-library';
proc print data=debate;
run;
Subscribe to:
Posts (Atom)