Resources
Products & Solutions
System Requirements
Samples
Install Center
Third-Party Software Reference
Documentation
What's New in SAS
Product Index A-Z
SAS Viya
SAS 9.4
SAS 9.3 and Earlier
Papers
Focus Areas
SAS/ETS 13.1 User's Guide
Example Programs (Sample Library)
Select an example
Date Intervals, Formats, and Functions
PROC ARIMA
PROC AUTOREG
PROC COMPUTAB
PROC COPULA
PROC COUNTREG
PROC DATASOURCE
PROC ENTROPY
PROC ESM
PROC EXPAND
PROC FORECAST
PROC HPCDM
PROC HPCOPULA
PROC HPCOUNTREG
PROC HPPANEL
PROC HPQLIM
PROC HPSEVERITY
PROC LOAN
PROC MDC
PROC MODEL
PROC PANEL
PROC PDLREG
PROC QLIM
PROC SEVERITY
PROC SIMLIN
PROC SIMILARITY
PROC SPECTRA
PROC SSM
PROC STATESPACE
PROC SYSLIN
PROC TIMEDATA
PROC TIMEID
PROC TIMESERIES
PROC TSCSREG
PROC UCM
PROC VARMAX
PROC X11
PROC X12
SASECRSP Interface Engine
SASEFAME Interface Engine
SASEFRED Interface Engine
SASEXCCM Interface Engine
SASEXFSD Interface Engine
SASEHAVR Interface Engine
Working with Time Series Data
For tips about extracting data, see
Reading Sample Data from a URL
.
Working with Time Series Data
Example for Working with Time Series Data
Date Intervals, Formats, and Functions
Store Hours Example
Fiscal Month Example
Banking Days Example
ARIMA Procedure
Getting Started Example for PROC ARIMA
Airline Series: Illustration of ODS Graphics
Simulated IMA Model
Seasonal Model for the Airline Series
Model for Series J Data from Box and Jenkins
An Intervention Model for Ozone Data
Using Diagnostics to Identify ARIMA Models
Detection of Level Changes in the Nile River Data
Iterative Outlier Detection
AUTOREG Procedure
Getting Started Example for PROC AUTOREG
Analysis of Real Output Series
Comparing Estimates and Models
Lack-of-Fit Study
Missing Values
Money Demand Model
Estimation of ARCH(2) Process
Estimation of GARCH-Type Models
Illustration of ODS Graphics
COMPUTAB Procedure
Getting Started Example for PROC COMPUTAB
Program Flow Example for PROC COMPUTAB
Column Selection Example for PROC COMPUTAB
Using Programming Statements
Enhancing a Report
Comparison of Actual and Budget
Consolidations
Creating an Output Data Set
A What-If Market Analysis
Cash Flows
COPULA Procedure
Getting Started Example for PROC COPULA
VaR Estimation
Simulating Default Times
COUNTREG Procedure
Getting Started Example for PROC COUNTREG
Basic Models
ZIP and ZINB Models for Data Exhibiting Extra Zeros
Variable Selection
DATASOURCE Procedure
Selecting Time Series Variables - The KEEP and DROP Statements
Controlling the Time Range of Data - The RANGE Statement
Obtaining Descriptive Information on Cross Sections with OUTBY
Obtaining Descriptive Information on Cross Sections with OUTALL
Subsetting a Data File Containing Cross Sections
Renaming Time Series Variables
Changing the Lengths of Numeric Variables
BEA National Income and Product Accounts
BLS Consumer Price Index Surveys
BLS State and Area Employment, Hours, and Earnings Surveys
GLOBAL INSIGHT:DRI/McGraw-Hill Format CITIBASE Files, OUTALL Data Set
GLOBAL INSIGHT:DRI/McGraw-Hill Format CITIBASE Files, OUTSELECT=OFF
GLOBAL INSIGHT:DRI/McGraw-Hill Format CITIBASE Files, OUTSELECT=ON
GLOBAL INSIGHT:DRI/McGraw-Hill Format CITIBASE Files with RANGE Option
GLOBAL INSIGHT:DRI Data Delivery Service Database
GLOBAL INSIGHT: PC Format CITIBASE Database
Quarterly COMPUSTAT Data Files
Annual COMPUSTAT Data Files, Filetype CSAUCY3
CRSP Daily NYSE/AMEX Combined Stocks
ENTROPY Procedure
Getting Started Example for PROC ENTROPY
Nonnormal Error Estimation
Unreplicated Factorial Experiments
Censored Data Models in Proc ENTROPY
Use of the PDATA= Option
Illustration of ODS Graphics
ESM Procedure
Forecasting of Time Series Data
Forecasting of Transactional Data
Specifying the Forecasting Model
Extending the Independent Variables for Multivariate Forecasts
Illustration of ODS Graphics
EXPAND Procedure
Combining Monthly and Quarterly Data
Illustration of ODS Graphics
Interpolating Irregular Observations
Using Transformations
FORECAST Procedure
Getting Started Example for PROC FORECAST
Forecasting Auto Sales
Forecasting Retail Sales
Forecasting Petroleum Sales
LOAN Procedure
Getting Started Example for PROC LOAN
Discount Points for Lower Interest Rates
Refinancing a Loan
Prepayments on a Loan
Output Data Sets
Piggyback Loans
MDC Procedure
Getting Started Example for PROC MDC
Binary Data Modeling
Conditional Logit
Correlated Choice Modeling
Testing for Homoscedasticity of the Utility Function
Nested Logit Analysis
Hausman's Specification and Likelihood Ratio Tests
Likelihood Ratio Test
MODEL Procedure
Getting Started Example for PROC MODEL
Syntax Example for PROC MODEL
Estimation Details Example for PROC MODEL
Programming Language Example for PROC MODEL
ANALYZEDEP= Example for PROC MODEL
SOLVE / OPTIMIZE Example for PROC MODEL
OLS Single Nonlinear Equation
A Consumer Demand Model
Vector AR(1) Estimation
MA(1) Estimation
Polynomial Distributed Lags Using %PDL
General-Form Equations
Spring and Damper Continuous System
Nonlinear FIML Estimation
Circuit Estimation
Systems of Differential Equations
Monte Carlo Simulation
Cauchy Distribution Estimation
Switching Regression Example
Simulating from a Mixture of Distributions
Simulated Method of Moments -- Simple Linear Regression
Simulated Method of Moments -- AR(1) Process
Simulated Method of Moments -- Stochastic Volatility Model
Duration Data Model with Unobserved Heterogeneity
EMM Estimation of a Stochastic Volatility Model
Illustration of ODS Graphics
PANEL Procedure
Getting Started Example for PROC PANEL
Analyzing Demand for Liquid Assets
The Airline Cost Data: Fixtwo Model
The Airline Cost Data: Further Analysis
The Airline Cost Data: Random Effects Models
Using the FLATDATA Statement
Dynamic Panel Estimation with GMM
PDLREG Procedure
Getting Started Example for PROC PDLREG
Industrial Conference Board Data
Money Demand Model
QLIM Procedure
Getting Started Example for PROC QLIM
Ordered Data Modeling
Tobit Analysis
Bivariate Probit Analysis
Sample Selection Model
Sample Selection Model
Types of Tobit Model
Stochastic Frontier Models
Bayesian Censored Model
SEVERITY Procedure
SEVERITY Utility Functions
Model Definition for Burr Distribution
Model Definition for Exponential Distribution
Model Definition for Gamma Distribution
Model Definition for Generalized Pareto Distribution
Model Definition for Inverse Gaussian Distribution
Model Definition for Lognormal Distribution
Model Definition for Pareto Distribution
Model Definition for Tweedie Distribution with Mean Parameter
Model Definition for Tweedie Distribution with Scale Parameter
Model Definition for Weibull Distribution
Getting Started with PROC SEVERITY
Defining and Fitting the Normal Distribution
Defining the Normal Distribution with a Scale Parameter
Defining a Mixed-Tail Distribution
Estimating Parameters Using the Cramer-von Mises Estimator
Fitting a Scaled Tweedie Model with Regressors
Fitting Distributions to Interval-Censored Data
Scale Regression with a Finite Mixture Model
Predicting Mean and Value-at-risk for a Scale Regression Model
SIMILARITY Procedure
Similarity Analysis
Sliding Similarity Analysis
Searching for Historical Analogies
Clustering Time Series
SIMLIN Procedure
Simulating Klein's Model I
Multipliers for a Third-Order System
SPECTRA Procedure
Spectral Analysis of Sunspot Activity
Cross-Spectral Analysis
SSM Procedure
Getting Started Example for PROC SSM
Bivariate Basic Structural Model
Panel Data: Two-Way Random-Effects and Autoregressive Models
Backcasting, Forecasting, and Interpolation
Longitudinal Data: Smoothing of Repeated Measures
A User-Defined Trend Model
Model with Multiple ARIMA Components
Dynamic Factor Modeling
Diagnostic Plots and Structural Break Analysis
Longitudinal Data: Variable Bandwidth Smoothing
A Transfer Function Model for the Gas Furnace Data
Panel Data: Dynamic Panel Model for the Cigar Data
Multivariate Modeling: Analysis of Long-Term Temperature Trends
STATESPACE Procedure
Getting Started Example for PROC STATESPACE
Series J from Box and Jenkins
SYSLIN Procedure
Getting Started Example for PROC SYSLIN
Klein's Model I Estimated with LIML and 3SLS
Grunfeld's Model Estimated with SUR
Illustration of ODS Graphics
TIMEDATA Procedure
Accumulation of Transactional Data
Timestamped Transactional Analysis
Using User-Defined Functions and Subroutines
TIMEID Procedure
Span in Weekday Series
Examining a Weekly Time ID Variable
Inferring a Time Interval
Examining Multiple BY Groups
TIMESERIES Procedure
Accumulation of Transactional Data
Timestamped Transactional Analysis
Trend and Seasonal Analysis
Illustration of ODS Graphics
Spectral Analysis of SUNSPOT Data
Singular Spectral Analysis of AIR Data
TSCSREG Procedure
Getting Started Example for PROC TSCSREG
UCM Procedure
Getting Started Example for PROC UCM
Analysis of Sunspot Data: Illustration of ODS Graphics
The Airline Series Revisited
Variable Star Data
Modeling Long Seasonal Patterns
Modeling Time-Varying Regression Effects
Trend Removal Using the Hodrick-Prescott Filter
Using Splines to Incorporate Nonlinear Effects
Detection of Level Shift
ARIMA Modeling
VARMAX Procedure
Getting Started Example for PROC VARMAX
Details Example for PROC VARMAX
Analysis of U.S. Economic Variables
Analysis of German Economic Variables
Numerous Examples
Illustration of ODS Graphics
X11 Procedure
Getting Started Example for PROC X11
Component Estimation - Monthly Data
Components Estimation - Quarterly Data
Outlier Detection and Removal
X12 Procedure
Getting Started Example for PROC X12
Model Identification
Model Estimation
Seasonal Adjustment
RegARIMA Automatic Model Selection
Automatic Outlier Detection
User-defined Regressors
MDLINFOIN= and MDLINFOOUT= Data Sets
Setting Regression Parameters
Creating Default MLDINFO= Data Sets for Use with the PICKMDL statement
Illustration of ODS Graphics
AUXDATA= Data Set
HPCDM Procedure
Getting Started with PROC HPCDM
Estimating the Probability Distribution of Insurance Payments
Using Externally Simulated Count Data
HPCOPULA Procedure
Simulating Default Times
HPCOUNTREG Procedure
Basic Models
Getting Started Example for PROC HPCOUNTREG
HPPANEL Procedure
Basic Models
HPQLIM Procedure
Basic Models
Basic Models
HPSEVERITY Procedure
Defining and Fitting the Normal Distribution
Defining the Normal Distribution with a Scale Parameter
Defining a Mixed-Tail Distribution
Fitting a Scaled Tweedie Model with Regressors
Fitting Distributions to Interval-Censored Data
Benefits of Distributed and Multithreaded Computing
Estimating Parameters Using the Cramer-von Mises Estimator
Scale Regression with a Finite Mixture Model
Predicting Mean and Value-at-risk for a Scale Regression Model
SASECRSP Interface Engine
Specifying PERMNOs and RANGE on the LIBNAME Statement
Using the LIBNAME Statement to Access All Keys
Accessing One PERMNO Using No RANGE
Specifying INDNO Keys Using the INSET= Option
Specifying PERMCO Keys Using the INSET= Option
Specifying TICKER Keys Using the INSET= Option
Specifying Ranges for Individual Keys with the INSET= Option
Converting Dates By Using the CRSP Date Functions
Comparing Different Ways of Accessing CCM Data
Comparing PERMNO and GVKEY Access of CRSP Stock Data
Using Fiscal Date Range Restriction
Using Different Types of Range Restriction in the INSET
Using INSET Ranges with the LIBNAME RANGE Option
SASEFAME Interface Engine
Converting an Entire FAME Database
Reading Time Series from the FAME Database
Drop Using N-literals-Writing Time Series to the SAS Data Set
Rename Using N-literals-Writing Time Series to the SAS Data Set
The RANGE= Option - Limiting the Time Range of Data
WHERE Statement - Limiting the Time Range of Data
Creating a View of OECD Data Using the SQL Procedure and SASEFAME
Creating a View of DRI Basic Economic Data Using the SQL Procedure
Creating a View of DB77 Data Using the SQL Procedure and SASEFAME
Creating a View of DRIECON Data Using the SQL Procedure
Reading Other FAME Data Objects with the FAMEOUT= Option
Remote FAME Access Using FAME CHLI
Selecting Time Series Using CROSSLIST=Option and KEEP Statement
Selecting Time Series Using CROSSLIST=Option and Fame Namelist
Selecting Time Series Using CROSSLIST=Option and WHERE=TICK
Selecting Boolean Case Series with the FAMEOUT= Option
Selecting Numeric Case Series with the FAMEOUT= Option
Selecting Date Case Series with the FAMEOUT= Option
Selecting String Case Series with the FAMEOUT= Option
Extracting Source for Formulas
Reading Time Series by Defining Fame Expression Groups in INSET
Optimizing Cache Sizes with TUNEFAME and TUNECHLI Options
SASEHAVR Interface Engine
Examining the Contents of a Haver Database
Viewing Quarterly Time Series from a Haver Database
Viewing Monthly Time Series from a Haver Database
Viewing Weekly Time Series from a Haver Database
Viewing Daily Time Series from a Haver Database
Limiting the Range of Time Series from a Haver Database
Using the WHERE Statement to Subset Time Series
Using the KEEP Option to Subset Time Series from a Haver Database
Using the SOURCE Option to Subset Time Series from Haver Data
Using the GROUP Option to Subset Time Series
Using the OUTSELECT=ON Option to View Key Selection Variables
Selecting Variables Based on Short Source Key Codes
Selecting Variables Based on Geography Key Codes
SASEXCCM Interface Engine
Retrieving SALE Data for One GVKEY
Retrieving SALE Data for Multiple GVKEYs
Retrieving Data in Different Keysets
Retrieving Items with Global Options
Retrieving All GVKEYs and Company Names
Retrieving Stock Time Series by PERMNO
Retrieving Stock and Indices Monthly Time Series by INDNO
Retrieving Stock and Indices Daily Time Series by INDNO
Retrieving Information for Availability of Group INDNOs
Retrieving Daily Group Time Series by INDNO= Option
Retrieving Monthly Group Time Series by INDNO= Option
Retrieving Monthly US Treasury Time Series by TREASNO= Option
SASEXFSD Interface Engine
Retrieving Price Data for One Company
Retrieving Price and Sales Data for Multiple Companies
Retrieving Book Value (FF_BPS) Data for One Company
Retrieving Multiple Screen Items for Multiple Companies
Retrieving Standardized Economic Items for Multiple Countries
Retrieving Multiple Items/Companies Belonging to a Single OFDB File
Retrieving a List of Securities Belonging to a Single OFDB File
Retrieving a List of CUSIPs Belonging to a Screen File
Retrieving Price-to-Earnings Data by Using ISON/ISONParams
Retrieving Price-to-Earnings Data For IBM and GM
Retrieving Benchmark Data
Retrieving Benchmark Data
Retrieving Items Using SPEC_ID
Retrieving Items Using SPEC_ID
Retrieving Items Using Economic Function RETURNS
Retrieving Items Using Economic Function ZSCORE
SASEFRED Interface Engine
Retrieving Balance of Payment Basis Data For Exports and
Retrieving Data for Exports of Goods and Services (BOPXGSA)
Selecting Time Series When Native Frequency Is Less Than
Selecting Time Series When Native Frequency Is Greater Than
Specifying One Time Series ID with Multiple Vintage Dates
Specifying Two Series Ids with Multiple Vintage Dates