## Tag: Statistical Graphics

0
Why you should visualize distributions instead of report means

Graphing data is almost always more informative than displaying a table of summary statistics. In a recent article about "dynamite plots," I briefly mentioned that graphs such as box plots and strip plots are better at showing data than graphs that merely show the mean and standard deviation. This article

0
Simulate proportions for groups

A statistical programmer asked how to simulate event-trials data for groups. The subjects in each group have a different probability of experiencing the event. This article describes one way to simulate this scenario. The simulation is similar to simulating from a mixture distribution. This article also shows three different ways

Data Visualization
0
Remaking a panel of dynamite plots

A colleague spent a lot of time creating a panel of graphs to summarize some data. She did not use SAS software to create the graph, but I used SAS to create a simplified version of her graph, which is shown to the right. (The colors are from her graph.)

Data Visualization
0
Remaking a panel of dynamite plots

A colleague spent a lot of time creating a panel of graphs to summarize some data. She did not use SAS software to create the graph, but I used SAS to create a simplified version of her graph, which is shown to the right. (The colors are from her graph.)

0
Sliced survival graphs in SAS

This article shows how to create a "sliced survival plot" for proportional-hazards models that are created by using PROC PHREG in SAS. Graphing the result of a statistical regression model is a valuable way to communicate the predictions of the model. Many SAS procedures use ODS graphics to produce graphs

0
Use SAS to create mathematical art

In a previous article, I discussed a beautiful painting called "Phantom’s Shadow, 2018" by the Nigerian-born artist, Odili Donald Odita. I noted that if you overlay a 4 x 4 grid on the painting, then each cell contains a four-bladed pinwheel shape. The cells display rotations and reflections of the pinwheel. The

0
Estimate a bivariate CDF in SAS

This article shows how to estimate and visualize a two-dimensional cumulative distribution function (CDF) in SAS. SAS has built-in support for this computation. Although the bivariate CDF is not used as much as the univariate CDF, the bivariate version is still a useful tool in understanding the probable values of

0
Overlay other graphs on a bar chart with PROC SGPLOT

It can be frustrating to receive an error message from statistical software. In the early days of the SAS statistical graphics (SG) procedures, an error message that I dreaded was ERROR: Attempting to overlay incompatible plot or chart types. This error message appears when you attempt to use PROC SGPLOT

0
3 reasons to prefer a horizontal bar chart

Most introductory statistics courses introduce the bar chart as a way to visualize the frequency (counts) for a categorical variable. A vertical bar chart places the categories along the horizontal (X) axis and shows the counts (or percentages) on the vertical (Y) axis. The vertical bar chart is a precursor

0
Identify influential observations in regression models

A previous article discusses how to interpret regression diagnostic plots that are produced by SAS regression procedures such as PROC REG. In that article, two of the plots indicate influential observations and outliers. Intuitively, an observation is influential if its presence changes the parameter estimates for the regression by "more

0
An overview of regression diagnostic plots in SAS

When you fit a regression model, it is useful to check diagnostic plots to assess the quality of the fit. SAS, like most statistical software, makes it easy to generate regression diagnostics plots. Most SAS regression procedures support the PLOTS= option, which you can use to generate a panel of

0
Control the fill and outline colors of scatter plot markers in SAS

This article shows how to use PROC SGPLOT in SAS to create the scatter plot shown to the right. The scatter plot has the following features: The colors of markers are determined by the value of a third variable. The outline of each marker is the same color (such as

0
The conditional distribution of a response variable

I recently learned about a new feature in PROC QUANTREG that was added in SAS/STAT 15.1 (part of SAS 9.4M6). Recall that PROC QUANTREG enables you to perform quantile regression in SAS. (If you are not familiar with quantile regression, see an earlier article that describes quantile regression and provides

0
Create a wind chill chart in SAS

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

Programming Tips
0
The wind chill chart

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

0
How to use the #BYVAR and #BYVAL keywords to customize graph titles in SAS

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

0
Data-driven titles for graphs

Many characteristics of a graph are determined by the underlying data at run time. A familiar example is when you use colors to indicate different groups in the data. If the data have three groups, you see three colors. If the data have four groups, you see four colors. The

0
The DOLIST syntax: Specify a list of numerical values in SAS

Have you ever heard of the DOLIST syntax? You might know the syntax even if you are not familiar with the name. The DOLIST syntax is a way to specify a list of numerical values to an option in a SAS procedure. Applications include: Specify the end points for bins

0
Top posts from The DO Loop in 2020

Last year, I wrote more than 100 posts for The DO Loop blog. In previous years, the most popular articles were about SAS programming tips, statistical analysis, and data visualization. But not in 2020. In 2020, when the world was ravaged by the coronavirus pandemic, the most-read articles were related

0
Decile plots in SAS

I previously showed how to create a decile calibration plot for a logistic regression model in SAS. A decile calibration plot (or "decile plot," for short) is used in some fields to visualize agreement between the data and a regression model. It can be used to diagnose an incorrectly specified

0
Three tips for plotting discontinuous functions in SAS

I have previously written about how to plot a discontinuous function in SAS. That article shows how to use the GROUP= option on the SERIES statement to graph a discontinuous function. An alternative approach is to place a missing value for the Y variable at the locations at which the

0
Automate the placement of reference lines in PROC SGPLOT

The REFLINE statement in PROC SGPLOT is one of my favorite ways to augment statistical graphics such as scatter plots, series plots, and histograms. The REFLINE statement overlays a vertical or horizontal reference line on a graph. You can specify the location of the reference lines on the REFLINE statement.

0
Generate random points in a polygon

The triangulation theorem for polygons says that every simple polygon can be triangulated. In fact, if the polygon has V vertices, you can decompose it into V-2 non-overlapping triangles. In this article, a "polygon" always means a simple polygon. Also, a "random point" means one that is drawn at random

0
A continuous band plot for visualizing uncertainty in regression predictions

A previous article discusses the confidence band for the mean predicted value in a regression model. The article shows a "graded confidence band plot," which I saw in Claus O. Wilke's online book, Fundamentals of Data Visualization (Section 16.3). It communicates uncertainty in the predictions. A graded band plot is

0
Visualize uncertainty in regression predictions

You've probably seen many graphs that are similar to the one at the right. This plot shows a regression line overlaid on a scatter plot of some data. Given a value for the independent variable (x), the regression line gives the best prediction for the mean of the response variable

Programming Tips
0
The HighLow plot: When a stacked bar chart is not enough

The HighLow plot often enables you to create many custom plots without resorting to annotation. Although it is designed to create a candlestick chart for stocks, it is incredibly versatile. Recently, a SAS programmer wanted to create a patient-profile graph that looked like a stacked bar chart but had repeated

0
Visualize the structure of a sparse matrix

Sometimes in matrix computations, it is important to display the nonzero elements of a matrix. This can be useful for visualizing the structure of a sparse matrix (one that has many zeros) and it is also useful when describing a matrix algorithm (such as Gaussian elimination) that introduces zeros at

Programming Tips
0
Bilinear interpolation in SAS

This article shows how to perform two-dimensional bilinear interpolation in SAS by using a SAS/IML function. It is assumed that you have observed the values of a response variable on a regular grid of locations. A previous article showed how to interpolate inside one rectangular cell. When you have a

Programming Tips
0
What is bilinear interpolation?

I've previously written about linear interpolation in one dimension. Bilinear interpolation is a method for two-dimensional interpolation on a rectangle. If the value of a function is known at the four corners of a rectangle, an interpolation scheme gives you a way to estimate the function at any point in

0

この記事はSAS Institute Japanが翻訳および編集したもので、もともとはRick Wicklinによって執筆されました。元記事はこちらです（英語）。 2020年における新型コロナウイルスの世界的流行のようなエピデミック状況下では、各国の感染確認者の累計数を示すグラフがメディアによって頻繁に示されます。多くの場合、これらのグラフは縦軸に対数スケール（対数目盛）を使います。このタイプのグラフにおける直線は、新たなケースが指数関数的ペースで急増していることを示します。直線の勾配はケースがどれほど急速に倍加するかの程度を示し、急勾配の直線ほど倍加時間が短いことを示します。ここでの「倍加時間」とは、「関連状況が何も変わらないと仮定した場合に、累計の感染確認者数が倍増するまでに要する時間の長さ」のことです。 本稿では、直近のデータを用いて倍加時間を推計する一つの方法を紹介します。この手法は、線形回帰を用いて曲線の勾配（m）を推計し、その後、倍加時間を log(2) / m として推計します。 本稿で使用しているデータは、2020年3月3日～3月27日の間の、4つの国（イタリア、米国、カナダ、韓国）における新型コロナウイルス感染症（以下、COVID-19）の感染確認者の累計数です。読者の皆さんは、本稿で使用しているデータとSASプログラムをダウンロードすることができます。 累計感染者数の対数スケール・ビジュアライゼーション このデータセットには4つの変数が含まれています。 変数Region： 国を示します。 変数Day： 2020年3月3日からの経過日数を示します。 変数Cumul： COVID-19の感染確認者の累計数を示します。 変数Log10Cumul： 感染確認累計数の「10を底とする対数」（＝常用対数）を示します。SASでは、LOG10関数を用いて常用対数を計算することができます。 これらのデータをビジュアル化する目的には、PROC SGPLOTを使用できます。下図のグラフは感染確認者の総数をプロットしていますが、総数の縦軸に常用対数を指定するために「type=LOG」と「logbase=10」というオプションを使用しています。 title "Cumulative Counts (log scale)"; proc sgplot data=Virus; where Cumul > 0; series x=Day y=Cumul / group=Region curvelabel; xaxis grid; yaxis type=LOG logbase=10 grid values=(100 500 1000

1 2 3 8