A previous article showed how to use SAS to compute finite-difference derivatives of smooth vector-valued multivariate functions. The article uses the NLPFDD subroutine in SAS/IML to compute the finite-difference derivatives. The article states that the third output argument of the NLPFDD subroutine "contains the matrix product J`*J, where J is
Search Results: sgplot (964)
On this Pi Day, let's explore the "πth roots of unity." (Pi Day is celebrated in the US on 3/14 to celebrate π ≈ 3.14159....) It's okay if you've never heard of the πth roots of unity. This article starts by reviewing the better-known nth roots of unity. It then
Did you know that you can use π to partition the positive integers into two disjoint groups? It's not hard. One group is generated by the integer portions of multiples of π. The FLOOR function gives the integer portion of a positive number, so you can write integer that are
A SAS programmer asked an interesting question: If data in a time series has missing values, can you plot a dashed line to indicate that the response is missing at some times? A simple way to achieve this is by overlaying two lines. The first line (the "bottom" line in
This article implements Passing-Bablok regression in SAS. Passing-Bablok regression is a one-variable regression technique that is used to compare measurements from different instruments or medical devices. The measurements of the two variables (X and Y) are both measured with errors. Consequently, you cannot use ordinary linear regression, which assumes that
Recently, a SAS programmer commented about one of my blog posts. He said that he had found an alternative answer on another website. Whereas my answer was formulated in terms of the normal cumulative distribution function (CDF), the other answer used the ERF function. This article shows the relationship between
2021年11月、国が一時停止している子宮頸がんを防ぐHPV(ヒトパピローマウイルス)ワクチンの積極的な接種の勧奨の再開が厚生労働省の専門家による検討部会によって正式に承認されました。このHPVワクチンは世界保健機関(WHO)がその接種を推進しており、日本をはじめとして多くの先進国では公的接種とされています。この記事はData for Good活動の一環として、パブリックデータを用いて問題を可視化することで、子宮頸がんに対する認知や関心をより持っていただき、今後のHPVワクチンの普及につなげることを目的としています。 子宮頸がん 子宮頸がんのほとんどはヒトパピローマウイルス(HPV)というウイルスの感染が原因となり子宮の頸部に発生するがんの一種です。感染の経路は主に性的接触によるものであり、成人女性の大部分はHPVに感染するとされています。HPVに感染してもその多くは自然に消失しますが、一部は頸部の細胞が異常な変化を起こした子宮頸部異形成というがんの前段階(前がん病変)になります。そしてさらにその一部が数年から10年ほどで悪性腫瘍へと進展し、子宮頸がんを発症します。この子宮頸部異形成(前がん病変)の早期段階では自覚症状はほぼなく、病変を発見するためには子宮頸がん検診を受けることが必要ですが、自覚症状があまりないために検診を受けた段階で既に進行がかなり進んでしまっているケースもあります。 国立がん研究センターがん情報サービスは国立がん研究センターが運営している公式サイトであり、日本国内のがんに関する統計情報ががん種別に公開されています。今回はその統計情報の中から、子宮頸がんに該当するデータ(がん種:子宮頸部)を抜き出し、無料で利用可能なSAS OnDemand for Academicsを利用して可視化を行いました。日本での死亡者数は2019年度時点で年間約3,000名、罹患者数は2018年時点で約11,000名ほどとなっており、下図のように増加の一途をたどっています。 出典:国立がん研究センターがん情報サービス「がん統計」(人口動態統計) より作成 ま子宮頸がんの罹患者数は2009年~2018年(最新)まで10年連続で1万人を超えており、罹患者数は30歳頃から増え始め現在は45-49歳が最も罹患が多い年代層となっています。また罹患する年齢層が若年化していることも危険視されています。子宮頸がんに対して我々ができることは以下の二つです。 子宮頸がん検診を受けること(発見) HPVワクチンを接種すること(予防) 私たちにとって重要なことは、2年に1度の受診が推奨されている子宮頸がん検診によって異形成(前がん病変)を早期に発見すること。そして検診と同様に重要ことが、HPVワクチンを接種し対応するHPVの感染を防ぎ、子宮頸がんとなるリスクを下げることです。 HPVワクチン 子宮頸がんの原因となるHPV(ヒトパピローマウイルス)は現在100種類以上の存在が知られており、そのうちのいくつかは子宮頸がんを引き起こしやすいハイリスク型に分類されます。HPVワクチンにも様々なタイプがありますが、日本では定期接種の対象となっているのは2価(サーバリックス)と4価(ガーダシル)のワクチンで、接種することでおおよそ50~70%程の感染を防ぎ子宮頸がんになるリスクを減らすことが可能です。また2021年2月24日からは9価ワクチンも日本での取り扱いが開始されましたが定期接種の対象ではないため自費での接種となっています。 「接種の積極的な勧奨」について HPVワクチンは下図のようにいくつかの事業、法案の後押しもあり、その対象となる年齢の女性へ接種の積極的な勧奨が行われていました。しかし公費での定期接種開始後に副反応の報告が相次ぎ、副反応と接種との因果関係や、その頻度、海外での詳しい実態調査が必要とされ、厚生労働省は約半年間をめどに「接種の積極的な勧奨」の一時中止という決定を2013年6月に下しました。当初は半年間がめどとされていたものの、一時停止はその後も続き、ワクチンの有効性が様々な研究により示され2021年11月に接種の積極的な勧奨の再開が正式に決定されるまで約8年の月日がかかりました。 専門家らの研究結果によると、接種の積極的な勧奨が一時停止されるまではおおよそ70%であった定期接種の対象年齢での接種率もこの一時停止により現在は1%未満にまで落ち込んでしまっています。論文のデータをもとに出生年ごとのワクチン接種率を可視化したものが下図です。 Nakagawa S, Ueda Y, Yagi A, Ikeda S, Hiramatsu K, Kimura T. Corrected human papillomavirus vaccination rates for each birth fiscal year in Japan. Cancer Sci. 2020;111(6):2156-2162. doi:10.1111/cas.14406 より作成
In a previous article, I visualized seven Christmas-themed palettes of colors, as shown to the right. You can see that the palettes include many red, green, and golden colors. Clearly, the colors in the Christmas palettes are not a random sample from the space of RGB colors. Rather, they represent
In data visualization, colors can represent the values of a variable in a choropleth map, a heatmap, or a scatter plot. But how do you visualize a palette of colors from the RGB or hexadecimal values of the colors? One way is to use the HEATMAPDISC subroutine in SAS/IML, which
While discussing how to compute convex hulls in SAS with a colleague, we wondered how the size of the convex hull compares to the size of the sample. For most distributions of points, I claimed that the size of the convex hull is much less than the size of the
Did you know that the loess regression algorithm is not well-defined when you have repeated values among the explanatory variables, and you request a very small smoothing parameter? This is because loess regression at the point x0 is based on using the k nearest neighbors to x0. If x0 has
A scatter plot is my go-to graph! It's what I often start with to get a feel for the data ... and I often end up using just a scatter plot. But some scatter plots are better than others ... In this blog post, I create a scatter plot of
Given a cloud of points in the plane, it can be useful to identify the convex hull of the points. The convex hull is the smallest convex set that contains the observations. For a finite set of points, it is a convex polygon that has some of the points as
I was recently asked how to create a frequency polygon in SAS. A frequency polygon is an alternative to a histogram that shows similar information about the distribution of univariate data. It is the piecewise linear curve formed by connecting the midpoints of the tops of the bins. The graph
Recall that the binomial distribution is the distribution of the number of successes in a set of independent Bernoulli trials, each having the same probability of success. Most introductory statistics textbooks discuss the approximation of the binomial distribution by the normal distribution. The graph to the right shows that the
A SAS programmer asked whether it is possible to add reference lines to the categorical axis of a bar chart. The answer is yes. You can use the VBAR statement, but I prefer to use the VBARBASIC (or VBARPARM) statement, which enables you to overlay a wide variety of graphs
A previous article discusses how to use SAS regression procedures to fit a two-parameter Weibull distribution in SAS. The article shows how to convert the regression output into the more familiar scale and shape parameters for the Weibull probability distribution, which are fit by using PROC UNIVARIATE. Although PROC UNIVARIATE
These days, many countries are moving away from coal, and towards natural gas, hydro, wind, and solar as ways to meet their electricity needs. I had heard that some countries still use a lot of coal (especially those countries with large coal deposits), and I was curious which countries use
Recently, the news has been all abuzz about William Shatner traveling into space. This was a cool event because he's the oldest person who has traveled into space (at 90 years old) ... and he was also the iconic Captain Kirk from the original Star Trek television series. This got
A reader asked whether it is possible to find a bootstrap sample that has some desirable properties. I am using the term "bootstrap sample" to refer to the result of randomly resampling with replacement from a data set. Specifically, he wanted to find a bootstrap sample that has a specific
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
The field of probability and statistics is full of asymptotic results. The Law of Large Numbers and the Central Limit Theorem are two famous examples. An asymptotic result can be both a blessing and a curse. For example, consider a result that says that the distribution of some statistic converges
Welcome back to my SAS Users blog series CAS Action! - a series on fundamentals. I've broken the series into logical, consumable parts. If you'd like to start by learning a little more about what CAS Actions are, please see CAS Actions and Action Sets - a brief intro. Or
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
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.)
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.)
You can use the bootstrap method to estimate confidence intervals. Unlike formulas, which assume that the data are drawn from a specified distribution (usually the normal distribution), the bootstrap method does not assume a distribution for the data. There are many articles about how to use SAS to bootstrap statistics
Many cities have Open Data pages. But once you download the data, what can you do with it? This is my fourth in a series of blog posts where I download public data about Cary, NC, and demonstrate how you might analyze that type of data (for Cary, or any
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
In Part 1 of my series fetch CAS, fetch!, I executed the fetch CAS action to return rows from a CAS table. That was great, but what can you do with the results? Maybe you want to create a visualization that includes the top five cars by MSRP for all