• Contents
  • About
  • What’s New in SAS/IML 12.1 and 12.3
    • Overview
    • Enhancements to the SAS/IML Syntax
    • New Functions, Subroutines, and Modules
      • DIMENSION Function
      • DISTANCE Function
      • FROOT Function
      • ISSKIPPED Function
      • MAHALANOBIS Function
      • NDX2SUB Function
      • NORM Function
      • RANPERK Function
      • SAMPLE Function
      • SUB2NDX Function
  • Introduction to SAS/IML Software
    • Overview of SAS/IML Software
    • Highlights of SAS/IML Software
      • SAS/IML provides a high-level programming language.
      • SAS/IML software operates on matrices.
      • SAS/IML software possesses a powerful vocabulary of operators.
      • SAS/IML software uses operators that apply to entire matrices.
      • SAS/IML software is interactive.
      • SAS/IML software is dynamic.
      • SAS/IML software processes data.
    • An Introductory SAS/IML Program
    • PROC IML Statement
    • Conventions Used in This Book
      • Typographical Conventions
      • Output of Examples
  • Understanding the SAS/IML Language
    • Defining a Matrix
    • Matrix Names and Literals
      • Matrix Names
      • Matrix Literals
    • Creating Matrices from Matrix Literals
      • Scalar Literals
      • Numeric Literals
      • Character Literals
      • Repetition Factors
      • Reassigning Values
      • Assignment Statements
    • Types of Statements
      • Control Statements
      • Functions
      • CALL Statements and Subroutines
      • Command Statements
    • Missing Values
    • Summary
  • Tutorial: A Module for Linear Regression
    • Overview of Linear Regression
    • Example: Solving a System of Linear Equations
    • A Module for Linear Regression
    • Orthogonal Regression
    • Plotting Regression Results
      • Low-Resolution Plots
      • SAS/IML Studio Graphics
  • Working with Matrices
    • Overview of Working with Matrices
    • Entering Data as Matrix Literals
      • Scalars
      • Matrices with Multiple Elements
    • Using Assignment Statements
      • Simple Assignment Statements
      • Functions That Generate Matrices
      • Index Vectors
    • Using Matrix Expressions
      • Operators
      • Compound Expressions
      • Elementwise Binary Operators
      • Subscripts
    • Subscript Reduction Operators
    • Displaying Matrices with Row and Column Headings
      • The AUTONAME Option in the RESET Statement
      • The ROWNAME= and COLNAME= Options in the PRINT Statement
      • The MATTRIB Statement
    • More about Missing Values
  • Programming Statements
    • Overview of Programming Statements
    • Selection Statements
    • Compound Statements
    • Iteration Statements
      • DO DATA Statements
      • Iterative DO Statements
      • DO WHILE Statements
      • DO UNTIL Statements
    • Jump Statements
    • Statements That Define and Execute Modules
      • Defining and Executing a Module
      • Understanding Symbol Tables
      • Modules with No Arguments
      • Modules with Arguments
      • Modules with Optional and Default Arguments
      • Nesting Modules
      • Understanding Argument Passing
      • Storing and Loading Modules
    • Termination Statements
      • PAUSE Statement
      • STOP Statement
      • ABORT Statement
      • QUIT Statement
  • Working with SAS Data Sets
    • Overview
    • Open a SAS Data Set
    • Syntax for Specifying a SAS Data Set
    • Make a SAS Data Set Current
    • Display SAS Data Set Information
    • List Observations
      • Specify a Range of Observations
      • Select a Set of Variables
      • Select a Set of Observations
    • Read Observations from a SAS Data Set
      • Use the READ Statement with the VAR Clause
      • Use the READ Statement with the INTO Clause
      • Use the READ Statement with the WHERE Clause
    • Edit a SAS Data Set
      • Update Observations
      • Delete Observations
    • Create a SAS Data Set from a Matrix
      • Use the CREATE Statement with the FROM Option
      • Use the CREATE Statement with the VAR Clause
    • Understand the End-of-File Condition
    • Produce Summary Statistics
    • Sort a SAS Data Set
    • Index a SAS Data Set
    • Data Set Maintenance Functions
    • Summary of Commands
    • Shared Concepts for Processing Data
      • Process a Range of Observations
      • Select Variables with the VAR Clause
      • Process Data by Using the WHERE Clause
      • Using Data Set Options
    • Comparison with the SAS DATA Step
  • File Access
    • Overview of File Access
    • Referring to an External File
      • Types of External Files
    • Reading from an External File
      • Using the INFILE Statement
      • Using the INPUT Statement
    • Writing to an External File
      • Using the FILE Statement
      • Using the PUT Statement
      • Examples
    • Listing Your External Files
    • Closing an External File
    • Summary
  • General Statistics Examples
    • Overview
    • General Statistics Examples
      • Correlation
      • Newton’s Method for Solving Nonlinear Systems of Equations
      • Regression
      • Alpha Factor Analysis
      • Categorical Linear Models
      • Regression of Subsets of Variables
      • Response Surface Methodology
      • Logistic and Probit Regression for Binary Response Models
      • Linear Programming
      • Quadratic Programming
      • Regression Quantiles
      • Simulations of a Univariate ARMA Process
      • Parameter Estimation for a Regression Model with ARMA Errors
      • Iterative Proportional Fitting
      • Full-Screen Nonlinear Regression
    • References
  • Submitting SAS Statements
    • Introduction to Submitting SAS Statements
    • Calling a Procedure
    • Passing Parameters from SAS/IML Matrices
    • Details of Parameter Substitution
      • Full Substitution
      • Specific Substitution
    • Creating Graphics in a SUBMIT Block
    • Handling Errors in a SUBMIT Block
    • Differences between the SUBMIT Statement in PROC IML and in SAS/IML Studio
  • Calling Functions in the R Language
    • Overview of Calling Functions in the R Language
    • Installing the R Statistical Software
    • The RLANG System Option
    • Submit R Statements
    • Transferring Data between SAS and R Software
      • Transfer from a SAS Source to an R Destination
      • Transfer from an R Source to a SAS Destination
    • Call an R Analysis from PROC IML
      • Using R to Analyze Data in SAS/IML Matrices
      • Using R to Analyze Data in a SAS Data Set
    • Passing Parameters to R
    • Call R Packages from PROC IML
    • Call R Graphics from PROC IML
    • Handling Errors from R
    • Details of Data Transfer
      • Numeric Data Types
      • Logical Data Types
      • Unsupported Data Types
      • Special Numeric Values
      • Date, Time, and Datetime Values
      • Time Series Data
      • Data Structures
    • Differences from SAS/IML Studio
  • Robust Regression Examples
    • Overview
    • Using LMS and LTS
      • LMS and LTS with Substantial Leverage Points: Hertzsprung-Russell Star Data
      • Comparison of LMS, V7 LTS, and FAST-LTS
      • LMS and LTS Univariate (Location) Problem: Barnett and Lewis Data
    • Using MVE and MCD
      • Brainlog Data
      • Stackloss Data
    • Combining Robust Residual and Robust Distance
      • Hawkins-Bradu-Kass Data
      • Stackloss Data
    • References
  • Time Series Analysis and Examples
    • Overview
    • Basic Time Series Subroutines
      • Getting Started
      • Syntax
    • Time Series Analysis and Control Subroutines
      • Getting Started
      • Syntax
      • Details
      • VAR Estimation and Variance Decomposition
    • Kalman Filter Subroutines
      • Getting Started
      • Syntax
      • Kalman Filtering: Likelihood Function Evaluation
      • Kalman Filtering: SSM Estimation With the EM Algorithm
      • Diffuse Kalman Filtering
    • Vector Time Series Analysis Subroutines
      • Getting Started
      • Syntax
    • Fractionally Integrated Time Series Analysis
      • Getting Started
      • Syntax
    • References
  • Nonlinear Optimization Examples
    • Overview
    • Getting Started
      • Unconstrained Rosenbrock Function
      • Constrained Betts Function
      • Rosen-Suzuki Problem
    • Details
      • Global versus Local Optima
      • Kuhn-Tucker Conditions
      • Definition of Return Codes
      • Objective Function and Derivatives
      • Finite-Difference Approximations of Derivatives
      • Parameter Constraints
      • Options Vector
      • Termination Criteria
      • Control Parameters Vector
      • Printing the Optimization History
    • Nonlinear Optimization Examples
      • Chemical Equilibrium
      • Network Flow and Delay
      • Compartmental Analysis
      • MLEs for Two-Parameter Weibull Distribution
      • Profile-Likelihood-Based Confidence Intervals
      • Survival Curve for Interval Censored Data
      • A Two-Equation Maximum Likelihood Problem
      • Time-Optimal Heat Conduction
    • References
  • Graphics Examples
    • Overview
    • An Introductory Graph
    • Details
      • Graphics Segments
      • Segment Attributes
      • Coordinate Systems
      • Windows and Viewports
      • Clipping Your Graphs
      • Common Arguments
    • Graphics Examples
      • Scatter Plot Matrix
      • Train Schedule
      • Fisher’s Iris Data
  • Window and Display Features
    • Overview
    • Creating a Display Window for Data Entry
    • Using the WINDOW Statement
      • Window Options
      • Field Specifications
    • Using the DISPLAY Statement
      • Group Specifications
      • Group Options
    • Details about Windows
      • Number and Position of Windows
      • Windows and the Display Surface
      • Deciding Where to Define Fields
      • Groups of Fields
      • Field Attributes
      • Display Execution
      • Field Formatting and Inputting
      • Display-Only Windows
      • Opening Windows
      • Closing Windows
      • Repeating Fields
      • Example
  • Storage Features
    • Overview
    • Storage Catalogs
    • Catalog Management
      • Restoring Matrices and Modules
      • Removing Matrices and Modules
      • Specifying the Storage Catalog
      • Listing Storage Entries
      • Storing Matrices and Modules
  • Using SAS/IML Software to Generate SAS/IML Statements
    • Overview
    • Generating and Executing Statements
      • Executing a String Immediately
      • Feeding an Interactive Program
      • Calling the Operating System
      • Calling the SAS Windowing Environment
      • Executing Any Command in an EXECUTE Call
      • Making Operands More Flexible
      • Interrupt Control
      • Specific Error Control
      • General Error Control
      • Macro Interface
      • IML Line Pushing Contrasted with Using the Macro Facility
      • Full-Screen Editing
    • Summary
  • Wavelet Analysis
    • Overview
      • Some Brief Mathematical Preliminaries
    • Getting Started
      • Creating the Wavelet Decomposition
      • Wavelet Coefficient Plots
      • Multiresolution Approximation Plots
      • Multiresolution Decomposition Plots
      • Wavelet Scalograms
      • Reconstructing the Signal from the Wavelet Decomposition
    • Details
      • Using Symbolic Names
      • Obtaining Help for the Wavelet Macros and Modules
    • References
  • Genetic Algorithms
    • Overview
    • Formulating a Genetic Algorithm Optimization
      • Choosing the Problem Encoding
      • Setting the Objective Function
      • Controlling the Selection Process
      • Using Crossover and Mutation Operators
    • Executing a Genetic Algorithm
      • Setting Up the IML Program
      • Incorporating Local Optimization
      • Handling Constraints
      • Genetic Algorithm with Local Optimization
      • Real-Valued Objective Optimization with Constant Bounds
      • Integer Programming Knapsack Problem
      • Optimization with Linear Constraints Using Repair Strategy
    • References
  • Sparse Matrix Algorithms
    • Overview
    • Iterative Methods
      • Input Data Description
      • Example: Conjugate Gradient Algorithm
      • Example: Minimum Residual Algorithm
      • Example: Biconjugate Gradient Algorithm
    • Symbolic LDL and Cholesky Factorizations
    • References
  • Further Notes
    • Memory and Workspace
    • Accuracy
    • Error Diagnostics
    • Efficiency
    • Missing Values
    • Principles of Operation
    • Operation-Level Execution
  • Language Reference
    • Overview
    • Statements, Functions, and Subroutines by Category
      • Mathematical Functions
      • Reduction Functions
      • Matrix Inquiry Functions
      • Matrix Sorting and BY-Group Processing Functions
      • Matrix Reshaping Functions
      • Combinatorial Functions
      • Character Manipulation Functions
      • Functions for Generating Random Numbers and Simulations
      • Statistical Functions
      • Time Series Functions
      • Numerical Analysis Functions
      • Linear Algebra functions
      • Optimization Subroutines
      • Set functions
      • Control Statements
      • Data Set and File Functions
      • Graphics and Window functions
      • Wavelet Analysis functions
      • Genetic Algorithm functions
      • Calling External Modules
      • Calling SAS statements or R Functions
    • Operators
      • Addition Operator:   +
      • Comparison Operators: <,   <=,   >,   >=,   =,   ^=
      • Concatenation Operator, Horizontal:   ||
      • Concatenation Operator, Vertical:   //
      • Direct Product Operator:   @
      • Division Operator:   /
      • Element Maximum Operator:   <>
      • Element Minimum Operator:   ><
      • Index Creation Operator:   :
      • Logical Operators:   &,   |,   ^
      • Multiplication Operator, Elementwise:   #
      • Multiplication Operator, Matrix:   *
      • Power Operator, Elementwise:   ##
      • Power Operator, Matrix:   **
      • Sign Reversal Operator:   –
      • Subscripts:   [ ]
      • Subtraction Operator:   –
      • Transpose Operator:  `
    • Statements, Functions, and Subroutines
      • ABORT Statement
      • ABS Function
      • ALL Function
      • ALLCOMB Function
      • ALLPERM Function
      • ANY Function
      • APPCORT Call
      • APPEND Statement
      • APPLY Function
      • ARMACOV Call
      • ARMALIK Call
      • ARMASIM Function
      • BIN Function
      • BLOCK Function
      • BRANKS Function
      • BSPLINE Function
      • BTRAN Function
      • BYTE Function
      • CALL Statement
      • CHANGE Call
      • CHAR Function
      • CHOOSE Function
      • CLOSE Statement
      • CLOSEFILE Statement
      • COMPORT Call
      • CONCAT Function
      • CONTENTS Function
      • CONVEXIT Function
      • CORR Function
      • COUNTMISS Function
      • COUNTN Function
      • COUNTUNIQUE Function
      • COV Function
      • COVLAG Function
      • CREATE Statement
      • CSHAPE Function
      • CUSUM Function
      • CUPROD Function
      • CVEXHULL Function
      • DATASETS Function
      • DELETE Call
      • DELETE Statement
      • DESIGN Function
      • DESIGNF Function
      • DET Function
      • DIAG Function
      • DIF Function
      • DISPLAY Statement
      • DIMENSION Function
      • DISTANCE Function
      • DO Function
      • DO Statement
      • DO Statement, Iterative
      • DO DATA Statement
      • DO Statement with an UNTIL Clause
      • DO Statement with a WHILE Clause
      • DURATION Function
      • ECHELON Function
      • EDIT Statement
      • EIGEN Call
      • EIGVAL Function
      • EIGVEC Function
      • ELEMENT Function
      • END Statement
      • ENDSUBMIT Statement
      • EXECUTE Call
      • EXP Function
      • EXPORTDATASETTOR Call
      • EXPORTMATRIXTOR Call
      • FARMACOV Call
      • FARMAFIT Call
      • FARMALIK Call
      • FARMASIM Call
      • FDIF Call
      • FFT Function
      • FILE Statement
      • FIND Statement
      • FINISH Statement
      • FORCE Statement
      • FORWARD Function
      • FREE Statement
      • FROOT Function
      • FULL Function
      • GAEND Call
      • GAGETMEM Call
      • GAGETVAL Call
      • GAINIT Call
      • GAREEVAL Call
      • GAREGEN Call
      • GASETCRO Call
      • GASETMUT Call
      • GASETOBJ Call
      • GASETSEL Call
      • GASETUP Function
      • GBLKVP Call
      • GBLKVPD Call
      • GCLOSE Call
      • GDELETE Call
      • GDRAW Call
      • GDRAWL Call
      • GENEIG Call
      • GEOMEAN Function
      • GGRID Call
      • GINCLUDE Call
      • GINV Function
      • GOPEN Call
      • GOTO Statement
      • GPIE Call
      • GPIEXY Call
      • GPOINT Call
      • GPOLY Call
      • GPORT Call
      • GPORTPOP Call
      • GPORTSTK Call
      • GSCALE Call
      • GSCRIPT Call
      • GSET Call
      • GSHOW Call
      • GSORTH Call
      • GSTART Call
      • GSTOP Call
      • GSTRLEN Call
      • GTEXT and GVTEXT Calls
      • GWINDOW Call
      • GXAXIS and GYAXIS Calls
      • HADAMARD Function
      • HALF Function
      • HANKEL Function
      • HARMEAN Function
      • HDIR Function
      • HERMITE Function
      • HOMOGEN Function
      • I Function
      • IF-THEN/ELSE Statement
      • IFFT Function
      • IMPORTDATASETFROMR Call
      • IMPORTMATRIXFROMR Call
      • INDEX Statement
      • INFILE Statement
      • INPUT Statement
      • INSERT Function
      • INT Function
      • INV Function
      • INVUPDT Function
      • IPF Call
      • ISSKIPPED Function
      • ITSOLVER Call
      • J Function
      • JROOT Function
      • KALCVF Call
      • KALCVS Call
      • KALDFF Call
      • KALDFS Call
      • LAG Function
      • LAV Call
      • LCP Call
      • LENGTH Function
      • LINK Statement
      • LIST Statement
      • LMS Call
      • LOAD Statement
      • LOC Function
      • LOG Function
      • LP Call
      • LTS Call
      • LUPDT Call
      • MAD Function
      • MARG Call
      • MATTRIB Statement
      • MAX Function
      • MAXQFORM Call
      • MCD Call
      • MEAN Function
      • MIN Function
      • MOD Function
      • MODULEI Call
      • MODULEIC Function
      • MODULEIN Function
      • MVE Call
      • NAME Function
      • NCOL Function
      • NLENG Function
      • Nonlinear Optimization and Related Subroutines
      • NLPCG Call
      • NLPDD Call
      • NLPFDD Call
      • NLPFEA Call
      • NLPHQN Call
      • NLPLM Call
      • NLPNMS Call
      • NLPNRA Call
      • NLPNRR Call
      • NLPQN Call
      • NLPQUA Call
      • NLPTR Call
      • NORM Function
      • NORMAL Function
      • NROW Function
      • NUM Function
      • ODE Call
      • ODSGRAPH Call
      • OPSCAL Function
      • ORPOL Function
      • ORTVEC Call
      • PAUSE Statement
      • PGRAF Call
      • POLYROOT Function
      • PRINT Statement
      • PROD Function
      • PRODUCT Function
      • PURGE Statement
      • PUSH Call
      • PUT Statement
      • PV Function
      • QNTL Call
      • QR Call
      • QUAD Call
      • QUEUE Call
      • QUIT Statement
      • RANCOMB Function
      • RANDGEN Call
      • RANPERK Function
      • RANPERM Function
      • RANDSEED Call
      • RANGE Function
      • RANK Function
      • RANKTIE Function
      • RATES Function
      • RATIO Function
      • RDODT and RUPDT Calls
      • READ Statement
      • REMOVE Function
      • REMOVE Statement
      • RENAME Call
      • REPEAT Function
      • REPLACE Statement
      • RESET Statement
      • RESUME Statement
      • RETURN Statement
      • ROOT Function
      • ROWCAT Function
      • ROWCATC Function
      • RUN Statement
      • RUPDT Call
      • RZLIND Call
      • SAMPLE Function
      • SAVE Statement
      • SEQ, SEQSCALE, and SEQSHIFT Calls
      • SEQSCALE Call
      • SEQSHIFT Call
      • SETDIF Function
      • SETIN Statement
      • SETOUT Statement
      • SHAPE Function
      • SHAPECOL Function
      • SHOW Statement
      • SOLVE Function
      • SOLVELIN Call
      • SORT Call
      • SORT Statement
      • SORTNDX Call
      • SOUND Call
      • SPARSE Function
      • SPLINE and SPLINEC Calls
      • SPLINEV Function
      • SPOT Function
      • SQRSYM Function
      • SQRT Function
      • SQRVECH Function
      • SSQ Function
      • START Statement
      • STD Function
      • STOP Statement
      • STORAGE Function
      • STORE Statement
      • SUBMIT Statement
      • SUBSTR Function
      • SUM Function
      • SUMMARY Statement
      • SVD Call
      • SWEEP Function
      • SYMSQR Function
      • T Function
      • TABULATE Call
      • TOEPLITZ Function
      • TPSPLINE Call
      • TPSPLNEV Call
      • TRACE Function
      • TRISOLV Function
      • TSBAYSEA Call
      • TSDECOMP Call
      • TSMLOCAR Call
      • TSMLOMAR Call
      • TSMULMAR Call
      • TSPEARS Call
      • TSPRED Call
      • TSROOT Call
      • TSTVCAR Call
      • TSUNIMAR Call
      • TYPE Function
      • UNIFORM Function
      • UNION Function
      • UNIQUE Function
      • UNIQUEBY Function
      • USE Statement
      • VALSET Call
      • VALUE Function
      • VAR Function
      • VARMACOV Call
      • VARMALIK Call
      • VARMASIM Call
      • VECDIAG Function
      • VECH Function
      • VNORMAL Call
      • VTSROOT Call
      • WAVFT Call
      • WAVGET Call
      • WAVIFT Call
      • WAVPRINT Call
      • WAVTHRSH Call
      • WINDOW Statement
      • XMULT Function
      • XSECT Function
      • YIELD Function
    • Base SAS Functions Accessible from SAS/IML Software
      • Bitwise Logical Operation Functions
      • Character and Formatting Functions
      • Character String Matching Functions and Subroutines
      • Combinatorial Functions
      • Date and Time Functions
      • Descriptive Statistics Functions and Subroutines
      • Double-Byte Character String Functions
      • External Files Functions
      • File I/O Functions
      • Financial Functions
      • Macro Functions and Subroutines
      • Mathematical Functions and Subroutines
      • Probability Functions
      • Quantile Functions
      • Random Number Functions and Subroutines
      • State and Zip Code Functions
      • Trigonometric and Hyperbolic Functions
      • Truncation Functions
      • Web Tools
    • References
  • Module Library
    • Overview
    • Contents of the IMLMLIB Library
    • IMLMLIB and the STORAGE library
    • Accessing the IMLMLIB Source Code
    • Order of Resolution for Functions and Subroutines
    • Error Diagnostics
    • Modules for Multivariate Random Sampling
    • Modules Reference
      • COLVEC Function
      • EXPMATRIX Function
      • GBXWHSKR Call
      • GPROBCNT Call
      • GXYPLOT Call
      • MAHALANOBIS Function
      • MEDIAN Function
      • NDX2SUB Function
      • QUADREG Call
      • QUARTILE Function
      • RANDDIRICHLET Function
      • RANDMULTINOMIAL Function
      • RANDMVT Function
      • RANDNORMAL Function
      • RANDWISHART Function
      • REGRESS Call
      • ROWVEC Function
      • RSUBSTR Function
      • STANDARD Function
      • SUB2NDX Function
      • TABPRT Call
    • References


ProductRelease
SAS/IML12.3
Type
Usage and Reference
Copyright Date
July 2013
Last Updated
08Jul2013