Strengthen your programming skills with tips and techniques from the experts
![](https://blogs.sas.com/content/sgf/files/2021/03/managing-global-statements.jpg)
SAS' Leonid Batkhan reveals coding techniques that give you control of when and whether global statements are executed.
Strengthen your programming skills with tips and techniques from the experts
SAS' Leonid Batkhan reveals coding techniques that give you control of when and whether global statements are executed.
This is another in my series of blog posts where I take a deep dive into converting customized R graphs into SAS graphs. Today we'll be working on bar charts ... And to give you a hint about what data I'll be using this time, here's a picture from a SAS
A SAS customer wanted to compute the cumulative distribution function (CDF) of the generalized gamma distribution. For any continuous distribution, the CDF is the integral of the probability density function (PDF), which usually has an explicit formula. Accordingly, he wanted to compute the CDF by using the QUAD function in
Date and time values are handled differently when programming in DS2. It can process databases and has access to ANSI data types, which have greater precision.
This is my Pi Day post for 2021. Every year on March 14th (written 3/14 in the US), geeky mathematicians and their friends celebrate "all things pi-related" because 3.14 is the three-decimal approximation to pi. Most years I write about lower-case pi (π), which is the ratio of a circle's
This is another in my series of blog posts where I take a deep dive into converting customized R graphs into SAS graphs. Today we'll be working on shapefile maps ... And what data will we be using this time? Here's a hint - the picture below is the Aurora
I have previously shown how you can use the FRACTw. format in SAS to display numbers as fractions. But did you know that you can also use the format to obtain the numerator and denominator of the fraction as numbers in a program? All you need to do is to
The more I use SAS Studio in the cloud via SAS OnDemand for Academics, the more I like it. To demonstrate how useful the Files tab is, I'm going to show you what happens when you drag a text file, a SAS data set, and a SAS program into the
I recently wrote about a simple statistical formula that approximates the wind chill temperature, which is the cumulative effect of air temperature and wind on the human body. The formula uses two independent variables (air temperature and wind speed) to predict the wind chill temperature. This article describes how to
This is another in my series of blog posts where I take a deep dive into converting customized R graphs into SAS graphs. Today we'll be working on bubble maps - specifically, plotting earthquake data as bubbles on a map. R bubble map, created using geom_polygon() and geom_point() SAS bubble
In cold and blustery conditions, the weather forecast often includes two temperatures: the actual air temperature and the wind chill temperature. The wind chill temperature conveys the cumulative effect of air temperature and wind on the human body. The goal of the wind-chill scale is to communicate the effect of
This is another in my series of blogs where I take a deep dive into converting customized R graphs into SAS graphs. Today I show how to combine several graphs with shared axes, which we'll call paneled graphs. This time I'll be plotting the Job Openings Rate by Industry, similar
SAS' Leonid Batkhan shows you how to delete a substring from a character string - one of the common character data manipulation tasks.
A previous article describes how to use the SGPANEL procedure to visualize subgroups of data. It focuses on using headers to display information about each graph. In the example, the data are time series for the price of several stocks, and the headers include information about whether the stock price
Amber Elam of SAS Technical Support reveals common challenges and solutions when you convert external files into SAS data sets.
SAS' Leonid Batkhan demonstrates a common character data manipulation task of inserting a substring into a character string.
This is another in my series of blogs where I take a deep dive into converting a customized R graph into a SAS graph. Today I'm focusing on a diverging bar chart (where one bar segment is above the zero line, and the other is below). What type of data
I've previously written about how to generate all pairwise interactions for a regression model in SAS. For a model that contains continuous effects, the easiest way is to use the EFFECT statement in PROC GLMSELECT to generate second-degree "polynomial effects." However, a SAS programmer was running a simulation study and
One of the first things I learned in SAS was how to use PROC PRINT to display parts of a data set. I usually do not need to see all the data, so my favorite way to use PROC PRINT is to use the OBS= data set option to display
This is another in my series of blogs where I take a deep dive into converting a customized R graph into a SAS ODS Graphics graph. Can you guess what data I'll be using this time? Here's a photo with a hint. This is Keeler, California (just west of Death
This is another in my series of blogs where I take a deep dive into converting a customized R graph into a SAS ODS Graphics graph. This time the example is a needle plot (that's essentially like a bar plot, with lots of tiny bars, plotted along a continuous xaxis).
In a previous article, I showed how to generate random points uniformly inside a d-dimensional sphere. In that article, I stated the following fact: If Y is drawn from the uncorrelated multivariate normal distribution, then S = Y / ||Y|| has the uniform distribution on the unit sphere. I was
SAS Press author Kim Chantala shows you how to to spend less time preparing data so you can lavish time on analysis.
Imagine an animal that is searching for food in a vast environment where food is scarce. If no prey is nearby, the animal's senses (such as smell and sight) are useless. In that case, a reasonable search strategy is a random walk. The animal can choose a random direction, walk/swim/fly
In the past, Sanjay showed how to create several basic graphs using both R and SAS ODS Graphics code. I'm going to take a bit of a "deeper dive" and focus a series of blog posts on highly customized graphs. Hopefully the code for these customizations will provide you with
SAS' Leonid Batkhan encourages you to join him at SASensei, an independent, third-party online SAS learning resource (game).
The inverse gamma distribution is a continuous probability distribution that is used in Bayesian analysis and in some statistical models. The inverse gamma distribution is closely related to the gamma distribution. For any probability distribution, it is essential to know how to compute four functions: the PDF function, which returns
Years ago, I wrote about how to compute the incomplete beta function in SAS. Recently, a SAS programmer asked about a similar function, called the incomplete gamma function. The incomplete gamma function is a "special function" that arises in applied math, physics, and statistics. You should not confuse the gamma
1. はじめに 前回投稿しました「SAS/ACCESSのご紹介とSnowflakeとの連携デモ」はご覧になったでしょうか。SASと外部のデータストレージサービスを連携する「SAS/ACCESS」のご紹介と、実際に「Snowflake」というサービスに連携してみました。今回は、その続きとして、10年以上前からビッグデータ・アナリティクスの基本アーキテクチャである、In-Database機能の代表的な機能である、SQLパススルーという機能をご説明し、デモを準備しました。 2. SQLパススルーについて SAS/ACCESS がインストールされている場合、SQLパススルーを使用してデータストレージサービスにクエリできます。接続方法に応じてSQLパススルーは、「暗黙的パススルー」と「明示的パススルー」に分けることができます。 暗黙的パススルーの価値は、作成したSASコードが自動的にデータストレージサービスが処理できるSQLに変換され、そのSQLをデータストレージサービス側に与えることにあります。ですので、SASで実行されたSQLやSASプロシジャに指定されたWHERE句など、可能な限りデータストレージサービス側で処理を行い、結果だけをSAS側に転送することが可能です。一方、明示的パススルーの場合には、DB依存のSQLを明示的に記述することできます。暗黙的パススルーと明示的パススルーについてまとめた表を下に記載していますので、ご覧ください。今回は、暗黙的パススルーについて詳しくご紹介したいと思います。 ▲SAS CommunityでSQL Pass throughについて質問するユーザー 暗黙的パススルーを使用する方が良いか、明示的パススルーを使用するのが良いのか気になるかと思います。実はこのトピックは、SAS Communityでもよく見られ、SAS/ ACCESSを使用している全世界のユーザーにとっても気になる質問です。どちらを使用するかは、どこに基準を置くか、また、SASとデータストレージサービスの環境のスペックによって異なると思います。ですので、皆さんもこのような疑問が生じた場合は、SASに相談してみてはいかがでしょうか。 3. 暗黙的パススルーのデモ 3-1. データの紹介とデモの概要 今回のデモのために、「pets」と「owners」という名前で2つのテーブルをデータストレージサービス(今回は、Snowflake)側に事前に保存しておきました。 「pets」テーブルには、3つのカラムがあります。 Id: ペット固有のid Name: ペットの名前 Type: ペットの種類(犬、猫、その他) Id Name Type 1 オオビ 犬 2 ローザ 猫 3 ワンチャン その他 … … … もう1つのテーブル「owners」にも3つのカラムがあります。 Id: オーナー固有のid Name: オーナーの名前
I recently had a discussion with a friend, and we were wondering about Apple's market share. This led me to look into the actual data ... finding the online charts lacking, and then designing my own charts. Follow along if you're curious about the process of improving the charts, or