Appendix A: Special SAS Data Sets


Introduction to Special SAS Data Sets

All SAS/STAT procedures create SAS data sets. Any table generated by a procedure can be saved to a data set by using the Output Delivery System (ODS), and many procedures also have syntax to enable you to save other statistics to data sets. Some of these data sets are organized according to certain conventions that allow them to be read by a SAS/STAT procedure for further analysis. Such specially organized data sets are recognized by the TYPE= attribute of the data set.

For example, the CORR procedure (refer to the SAS Procedures Guide ) can create a data set with the attribute TYPE=CORR containing a correlation matrix. This TYPE=CORR data set can be read by the REG or FACTOR procedure, among others. If the original data set is large, using a special SAS data set in this way can save a great deal of computer time by avoiding the recomputation of the correlation matrix in each of several analyses.

As another example, the REG procedure can create a TYPE=EST data set containing estimated regression coefficients. If you need to make predictions for new observations, you can have the SCORE procedure read both the TYPE=EST data set and a data set containing the new observations. PROC SCORE can then compute predicted values or residuals without repeating the entire regression analysis. See Chapter 64, 'The SCORE Procedure,' for an example.

A special SAS data set may contain different kinds of statistics. A special variable called _TYPE_ is used to distinguish the various statistics. For example, in a TYPE=CORR data set, an observation in which _TYPE_ ='MEAN' contains the means of the variables in the analysis, and an observation in which _TYPE_ ='STD' contains the standard deviations. Correlations appear in observations with _TYPE_ ='CORR'. Another special variable, _NAME_ , is needed to identify the row of the correlation matrix. Thus, the correlation between variables X and Y would be given by the value of the variable X in the observation for which _TYPE_ ='CORR' and _NAME_ ='Y', or by the value of the variable Y in the observation for which _TYPE_ ='CORR' and _NAME_ ='X'.

You can create special SAS data steps directly in a DATA step by specifying the TYPE= option in parentheses after the data set name in the DATA statement. See Example A.2 on page 4896 for an example.

The special data sets created by SAS/STAT procedures can generally be used directly by other procedures without modification. However, if you create an output data set with PROC CORR and use the NOCORR option to omit the correlation matrix from the OUT= data set, you need to set the TYPE= option either in parentheses following the OUT= data set name in the PROC CORR statement or in parentheses following the DATA= option in any other procedure that recognizes the special TYPE= attribute. In either case, the TYPE= option should be set to COV, CSSCP, or SSCP according to what type of matrix is stored in the data set and what data set types are accepted as input by the other procedures you plan to use. If you do not follow these steps and you use the TYPE=CORR data set with no correlation matrix as input to another procedure, the procedure may issue an error message indicating that the correlation matrix is missing from the data set.

If you use a DATA step with a SET statement to modify a special SAS data set, you must specify the TYPE= option in the DATA statement. The TYPE= attribute of the data set in the SET statement is not automatically copied to the data set being created. You can determine the TYPE= attribute of a data set by using the CONTENTS procedure (see Example A.1 on page 4895 and refer to the SAS Procedures Guide for details).

Table A.1 summarizes the TYPE= data sets that can be used as input to SAS/STAT procedures and the TYPE= data sets that are created by SAS/STAT procedures. The essential parts of the statements each procedure uses to create its output data set or data sets are shown.

Table A.1: SAS/STAT Procedures and Types of Data Sets

Procedure

Input Data Sets TYPE= as shown [*]

Output Data Sets (TYPE=null or as shown)

Created by Statement and Specification

ACECLUS

INITIAL= INPUT= data set may be of type:

ACE, CORR,

COV, SSCP,

UCORR, UCOV

ACE

PROC ACECLUS OUTSTAT=

PROC ACECLUS OUT=

ANOVA

   

PROC ANOVA OUTSTAT=

CALIS

CORR, COV,

FACTOR, RAM,

SSCP,

UCORR, UCOV,

WEIGHT

CORR

COV

EST

UCORR

UCOV

RAM

WEIGHT

PROC CALIS OUTSTAT=

PROC CALIS COV OUTSTAT=

PROC CALIS OUTEST=

PROC CALIS NOINT OUTSTAT=

PROC CALIS NOINT COV OUTSTAT=

PROC CALIS OUTRAM=

PROC CALIS OUTWGT=

CANCORR

CORR, COV,

FACTOR, SSCP,

UCORR, UCOV

CORR

UCORR

PROC CANCORR OUTSTAT=

PROC CANCORR NOINT OUTSTAT=

PROC CANCORR OUT=

CANDISC

CORR, COV,

SSCP, CSSCP

CORR

PROC CANDISC OUTSTAT=

PROC CANDISC OUT=

CATMOD

EST

EST

RESPONSE / OUTEST=

RESPONSE /OUT=

CLUSTER

DISTANCE

TREE

PROC CLUSTER OUTTREE=

CORRESP

   

PROC CORRESP OUTC=

PROC CORRESP OUTF=

DISCRIM

CORR, COV,

SSCP, CSSCP,

LINEAR, QUAD,

MIXED

LINEAR

QUAD

MIXED

CORR

PROC DISCRIM POOL=YES OUTSTAT=

PROC DISCRIM POOL=NO OUTSTAT=

PROC DISCRIM POOL=TEST OUTSTAT=

PROC DISCRIM METHOD=NPAR OUTSTAT=

PROC DISCRIM OUT=

PROC DISCRIM OUTCROSS=

PROC DISCRIM OUTD=

PROC DISCRIM TESTOUT=

PROC DISCRIM TESTOUTD=

DISTANCE

 

DISTANCE

PROC DISTANCE OUT=

PROC DISTANCE OUTSDZ=

FACTOR

ACE, CORR,

COV, FACTOR,

SSCP, UCORR,

UCOV

FACTOR

PROC FACTOR OUTSTAT=

PROC FACTOR OUT=

FASTCLUS

   

PROC FASTCLUS OUT=

PROC FASTCLUS OUTSEED=

PROC FASTCLUS OUTSTAT=

PROC FASTCLUS MEAN=

FREQ

   

TABLES OUT=

OUTPUT OUT=

GENMOD

   

OUTPUT OUT=

GLM

   

PROC GLM OUTSTAT=

LSMEANS / OUT=

OUTPUT OUT=

GLMMOD

   

PROC GLMMOD OUTDESIGN=

PROC GLMMOD OUTPARM=

INBREED

   

PROC INBREED OUTCOV=

KRIGE2D

   

PROC KRIGE2D OUTEST=

PROC KRIGE2D OUTNBHD=

LATTICE

     

LIFEREG

 

EST

PROC LIFEREG OUTEST=

OUTPUT OUT=

LIFETEST

   

PROC LIFETEST OUTSURV=

PROC LIFETEST OUTTEST=

LOGISTIC

 

EST

PROC LOGISTIC OUTEST=

OUTPUT OUT=

MODEL / OUTROC=

MDS

   

PROC MDS OUT=

PROC MDS OUTFIT=

PROC MDS OUTRES=

MIXED

   

MODEL OUTPRED=

MODEL OUTPREDM=

PRIOR OUT=

PRIOR OUTG=

PRIOR OUTGT=

MODECLUS

DISTANCE

 

PROC MODECLUS OUT=

PROC MODECLUS OUTCLUS=

PROC MODECLUS OUTSUM=

MULTTEST

   

PROC MULTTEST OUT=

PROC MULTTEST OUTPERM=

PROC MULTTEST OUTSAMP=

NESTED

     

NLIN

 

EST

PROC NLIN OUTEST=

OUTPUT OUT=

NPAR1WAY

   

OUTPUT OUT=

ORTHOREG

 

EST

PROC ORTHOREG OUTEST=

PHREG

 

EST

PROC PHREG OUTEST=

BASELINE OUT=

OUTPUT OUT=

PLAN

   

OUTPUT OUT=

PLS

   

OUTPUT OUT=

PRINCOMP

ACE, CORR,

COV, EST,

FACTOR, SSCP,

UCORR, UCOV

CORR

COV

UCORR

UCOV

PROC PRINCOMP OUTSTAT=

PROC PRINCOMP COV OUTSTAT=

PROC PRINCOMP NOINT OUTSTAT=

PROC PRINCOMP NOINT COV OUTSTAT=

PROC PRINCOMP OUT=

PRINQUAL

   

PROC PRINQUAL OUT=

PROBIT

 

EST

PROC PROBIT OUTEST=

OUTPUT OUT=

REG

CORR, COV,

SSCP, UCORR,

UCOV

EST

SSCP

PROC REG OUTEST=

PROC REG OUTSSCP=

OUTPUT OUT=

RSREG

   

PROC RSREG OUT=

RIDGE OUTR=

SCORE

SCORE= data set can be of any type

 

PROC SCORE OUT=

SIM2D

   

PROC SIM2D OUTSIM=

SURVEYSELECT

   

PROC SURVEYSELECT OUT=

PROC SURVEYSELECT OUTSORT=

STDIZE

   

PROC STDIZE OUT=

PROC STDIZE OUTSTAT=

STEPDISC

CORR, COV,

SSCP, CSSCP

   

TRANSREG

   

PROC TRANSREG OUTTEST=

OUTPUT OUT=

TREE

TREE

 

PROC TREE OUT=

TTEST

     

VARCLUS

CORR, COV,

FACTOR, SSCP,

UCORR, UCOV

CORR

UCORR

TREE

PROC VARCLUS OUTSTAT=

PROC VARCLUS NOINT OUTSTAT=

PROC VARCLUS OUTTREE=

VARCOMP

     

VARIOGRAM

   

PROC VARIOGRAM OUTDISTANCE=

PROC VARIOGRAM OUTPAIR=

PROC VARIOGRAM OUTVAR=

[*] If no TYPE= is shown, the procedure does not recognize any special data set types except possibly to issue an error message for inappropriate values of TYPE=.

Formulas useful for illustrating differences between corrected and uncorrected matrices in some special SAS data sets are shown in the 'Definitional Formulas' section on page 4902.




SAS.STAT 9.1 Users Guide (Vol. 7)
SAS/STAT 9.1 Users Guide, Volumes 1-7
ISBN: 1590472438
EAN: 2147483647
Year: 2004
Pages: 132

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net