## Learn SAS

Learn about the latest tips, tutorials, upcoming events and certifications

0
8 free resources to start your SAS journey

Data and AI literacy are no longer optional but essential for success in both academic and professional settings. Educators are tasked with equipping students with the skills necessary to analyze and interpret information effectively. However, students and businesses can also learn these essential skills through available resources. SAS education resources

0
The location of ticks in statistical graphics

Modern software for statistical graphics automatically handles many details and graph defaults, such as the range of the axes and the placement of tick marks. In the days of yore, these details required tedious manual calculations. Think about what is required to place ticks on a scatter plot. On the

0
Is a value in a vector? Use the ELEMENT function

In SAS, DATA step programmers use the IN operator to determine whether a value is contained in a set of target values. Did you know that there is a similar functionality in the SAS IML language? The ELEMENT function in the SAS IML language is similar to the IN operator

0
Efficient recursion: Store values that will be be reused

A previous article shows how to implement recursive formulas in SAS. The article points out that you can often avoid recursion by using an iterative algorithm, which is more efficient. An example is the Fibonacci sequence, which is usually defined recursively as      F(n) = F(n-1) + F(n-2) for n

0
An exact formula for the probability distribution for the sum of n dice

Many well-known distributions become more and more "normal looking" for large values of a parameter. Famously, the binomial distribution, Binom(p, N), can be approximated by a normal distribution when N (the sample size) is large. Similarly, the Poisson(λ) distribution is well approximated by the normal distribution when λ is large.

0
How to define a SAS IML function that has no arguments

The SAS IML Language has a quirk with regards to functions that take no arguments. As discussed in the documentation, "modules with arguments are given a local symbol table." This is the usual behavior that programmers expect. However, the documentation goes on to state that "a module that has no

0
Implement five sampling methods in the SAS DATA step

In SAS, the easiest way to draw random sampling from data is to use PROC SURVEYSELECT or the SAMPLE function in SAS IML software. I have previously written about how to implement four common sampling schemes by using PROC SURVEYSELECT and the SAMPLE function. The DATA step in SAS is

0
Simulate data from a Poisson regression model

This article shows how to simulate data from a Poisson regression model, including how to account for an offset variable. If you are not familiar with how to run a Poisson regression in SAS, see the article "Poisson regression in SAS." A Poisson regression model is a specific type of

0
Poisson regression in SAS

This article demonstrates how to use PROC GENMOD to perform a Poisson regression in SAS. There are different examples in the SAS documentation and in conference papers, but I chose this example because it uses two categorical explanatory variables. Therefore, the Poisson regression can be visualized by using a contingency

0
QPSOLVE: A new SAS IML function for quadratic optimization

Since the pandemic began in 2020, the SAS IML developers have added about 50 new functions and enhancements to the SAS IML language in SAS Viya. Among these functions are new modern methods for optimization that have a simplified syntax as compared to the older 'NLP' functions that are available

0
Isotonic regression: An application of quadratic optimization

Isotonic regression (also called monotonic regression) is a type of regression model that assumes that the response variable is a monotonic function of the explanatory variable(s). The model can be nondecreasing or nonincreasing. Certain physical and biological processes can be analyzed by using an isotonic regression model. For example, a

0
Display the largest values for each group

A previous article discusses the fact that there are often multiple ways in SAS to obtain the same result. This fact results in many vigorous discussions on online programming forums as people propose different (but equivalent) methods for solving someone's problem then argue why their preferred method is better than

0
On the reproducibility of responses by AI assistants

As announced and demonstrated at SAS Innovate 2024, SAS plans to include a generative AI assistant called SAS Viya Copilot in the forthcoming SAS Viya Workbench. You can submit a text prompt (by putting it in a comment string) and the Copilot will generate SAS code for you. My colleagues

0
Create an interpolating polynomial in SAS

While reviewing a book on numerical analysis, I was reminded of a classic interpolation problem. Suppose you have n pairs of points in the plane: (x1,y1), (x2,y2), ..., (xn,yn), where the first coordinates are distinct. Then you can construct a unique polynomial of degree (at most) n-1 that passes through

0
Teaching an AI assistant to read and write SAS IML vectors

One of the most exciting features of SAS Viya Workbench is that the code editor includes a generative AI component called SAS Viya Copilot. This feature was announced and demonstrated at SAS Innovate 2024. With the Copilot, you can specify a text prompt that generates SAS code. For example, you

0
SAS Hackathon Boot Camp/ 7月18日 SAS Innovate Tokyo にて開催

SAS Hackathon Boot Camp が SAS Innovate Tokyo に登場 2024年7月18日からSAS Innovate Tokyoが東京丸の内で開催されます。参加される皆さんは、SAS Hackathon Boot Campにもぜひご参加ください。参加は無料です。この Boot Campは、提供されるダイナミックなAI環境の中で、"経験豊富な問題解決者" である皆さんが一丸となって課題に取り組むことができるプログラムとなっています。多様な専門的バッグラウンドを持つ皆さんのご参加をお待ちしてます。このプログラムは、与えられた課題に取り組む中で、融資業務の評価を実際に体験することができるものとなっています。金融業界でのバックグラウンドの有無にかかわらず参加いただけます。 プログラム Boot Campのプログラムは、信用審査モデルにおいて、特に性別、年齢、人種、場所、その他の潜在的な要因に関連する、"隠れたバイアスの蔓延"という問題に対して取り組む内容となっています。参加者には、そのようなバイアスが存在する可能性のある現実世界のシナリオをシミュレートするデータセットが提供されます。ゴールは、そのような既存のバイアスを持ち続けず、これ以上増やさないためにも、フェアな信用審査モデルを新たに作成することにあります。利害関係者とのコミュニケーションを可能にするための、データセット内の潜在的な問題の評価を支援するダッシュボードの作成ももう一つのゴールです。 オプション 参加者はローコード、ノーコード開発のどちらかを選択することができます。また、プログラムの課題を通して、SAS Viya 上での、AI、アナリティクス、オープンソースツールの組み合わせを体験していただけます。 ユースケースオプション: 信用審査モデリングデータのバイアスの検出 (ローコード) 一度に 1 つのダッシュボードで信頼性の確認ができる: 倫理的なデータ可視化の課題 (ノーコード) 必要な準備 インターネット環境に接続可能なご自身のPCをご持参ください。 サポート SASから提供されるものは以下です。 Azure上で実行され、Intelによって高速化されたSAS CloudでのSAS Viyaへのアクセス 問題の説明とデータ SASのメンターによる課題取組み中のコーチング 会場でのWi-Fi チーム チームは2〜4人で編成されます。歓迎されるスキルは以下です。 公平性を判断するための批判的思考 データに存在するさまざまなタイプのバイアスに関する認識 データインサイトを解釈して伝達する能力 複雑なコンセプトを伝えるための強力なコミュニケーションスキル

0
A bootstrap confidence interval for an R-square statistic

A previous article discusses a formula for a confidence interval for R-square in a linear regression model (Olkin and Finn (1995) "Correlations redux", Psychological Bulletin) The formula is useful for large data sets, but should be used with caution for small samples. At the end of the previous article, I

0
Visualize a multivariate regression model when using spline effects

A SAS analyst read my previous article about visualizing the predicted values for a regression model that uses spline effects. Because the original explanatory variable does not appear in the model, the analyst had several questions: How do you score the model on new data? The previous example has only

0
Find the label of a variable in SAS

Sometimes labels for variables get "dropped" during data preparation and cleaning. One example is when data are transposed from "wide form" to "long form." For example, suppose a data set has three variables, X, Y, and Z, each with labels. If you transpose the data to long form, the new

0
On the correctness of a discrete simulation

After writing a program that simulates data, it is important to check that the statistical properties of the simulated (synthetic) data match the properties of the model. As a first step, you can generate a large random sample from the model distribution and compare the sample statistics to the expected

0
Rank, order, and sorting

A SAS programmer was trying to implement an algorithm in PROC IML in SAS based on some R code he had seen on the internet. The R code used the rank() and order() functions. This led the programmer to ask, "What is the different between the rank and the order?

0
Dice and the correctness of a simulation

At a recent conference in Las Vegas, a presenter simulated the sum of two dice and used it to simulate the game of craps. I write a lot of simulations, so I'd like to discuss two related topics: How to simulate the sum of two dice in SAS. This is

0
Visualize patterns of missing values

Years ago, I wrote an article that showed how to visualize patterns of missing data. During a recent data visualization talk, I discussed the program, which used a small number of SAS IML statements. An audience member asked whether it is possible to construct the same visualization by using only

0
Estimate a proportion and a confidence interval in SAS

A SAS programmer wanted to estimate a proportion and a confidence interval (CI), but didn't know which SAS procedure to call. He knows a formula for the CI from an elementary statistics textbook. If x is the observed count of events in a random sample of size n, then the

0
Distributions with specified skewness and kurtosis

A SAS programmer wanted to simulate samples from a family of Beta(a,b) distributions for a simulation study. (Recall that a Beta random variable is bounded with values in the range [0,1].) She wanted to choose the parameters such that the skewness and kurtosis of the distributions varied over range of

0
Improve the Federal Reserve's dot plot

A dot plot is a standard statistical graphic that displays a statistic (often a mean) and the uncertainty of the statistic for one or more groups. Statisticians and data scientists use it in the analysis of group data. In late 2023, I started noticing headlines about "dot plots" in the

1 2 3 40