Search Results: ellipse (50)

Rick Wicklin 0
Add a prediction ellipse to a scatter plot in SAS

It is common in statistical graphics to overlay a prediction ellipse on a scatter plot. This article describes two easy ways to overlay prediction ellipses on a scatter plot by using SAS software. It also describes how to overlay multiple prediction ellipses for subpopulations. What is a prediction ellipse? A

Learn SAS
Rick Wicklin 0
The elliptical heart

Some hearts are famous. For example, there is the "Heart of Gold" (Neil Young), the "Heart of Glass" (Blondie), and the Heart of Darkness (Joseph Conrad). But have you heard of the "Heart of Ellipses"? No? Well, in 2023, Ted Conway published an amusingly titled article, "Total Ellipse of the

Analytics | Learn SAS
Rick Wicklin 0
Why use rank correlation?

A previous article discusses rank correlation and lists some advantages of using rank correlation. However, the article does not show examples where an analyst might prefer to report the rank correlation instead of the traditional Pearson product-moment correlation. This article provides three examples where the rank correlation is a better

Analytics
自然言語処理とSAS (3)

こんにちは!SAS Institute Japanの堀内です。今回も自然言語処理について紹介いたします。 前回の投稿では、実際にSASを使って日本語の文章を扱う自然言語処理の例を解説しました。 最終回の本投稿ではその応用編として、自然言語処理の代表的なタスクとSASによる実装方法を紹介します。なお、ここでいうタスクとは「定式化され一般に共有された課題」といった意味になります。自然言語処理には複数のタスクがあり、タスクごとに、共通する部分はあるとはいえ、問題解決のアプローチ方法は基本的に大きく異なります。SASには各タスクごとに専用のアクションセット1が容易されています。 要約タスク その名の通り文章を要約するタスクです。SASではtextSummarizeアクションセットで対応可能です。 ここでは、NHKのニュース解説記事「気になる頭痛・めまい 天気が影響?対処法は?」(https://www.nhk.or.jp/kaisetsu-blog/700/471220.html) の本文を5センテンスで要約してみましょう。 import swat conn = swat.CAS('mycashost.com', 5570, 'username', 'password') conn.builtins.loadActionSet(actionSet='textSummarization') conn.textSummarization.textSummarize(addEllipses=False, corpusSummaries=dict(name='corpusSummaries', compress=False, replace=True), documentSummaries=dict(name='documentSummaries', compress=False, replace=True), id='Id', numberOfSentences=5, table={'name':CFG.in_cas_table_name}, text='text', useTerms=True, language='JAPANESE') conn.table.fetch(table={'name': 'corpusSummaries'}) numberOfSentencesで要約文のセンテンス数を指定しています。結果は以下の通りです。 'まず体調の変化や天気、気温・湿度・気圧などの日記をつけ、本当に天気が影響しているのか、どういうときに不調になるのかパターンを把握すると役立ちます。 気温・湿度以外にも、気圧が、体調の悪化や、ときに病気の引き金になることもあります。 私たちの体は、いつも耳の奥にある内耳にあると言われている気圧センサーで、気圧の変化を調整しています。 ただ、天気の体への影響を研究している愛知医科大学佐藤客員教授にお話ししを伺ったところ、「台風最接近の前、つまり、気圧が大きく低下する前に、頭が痛いなど体調が悪くなる人は多い」ということです。 内耳が敏感な人は、わずかな気圧の変化で過剰に反応し、脳にその情報を伝えるので、脳がストレスを感じ、体のバランスを整える自律神経が乱れ、血管が収縮したり、筋肉が緊張するなどして、その結果、頭痛・めまいなどの体に様々な不調につながっているのです。' 重要なセンテンスが抽出されていることが分かります。   テキスト分類タスク 文章をいくつかのカテゴリに分類するタスクです。その内、文章の印象がポジティブなのかネガティブなのか分類するものをセンチメント分析と呼びます。ここでは日本語の有価証券報告書の文章をポジティブかネガティブか判定してみます。使用するデータセットは以下になります。 https://github.com/chakki-works/chABSA-dataset (なお、こちらのデータセットには文章ごとにポジティブかネガティブかを示す教師ラベルは元々付与されておりませんが、文章内の特定のフレーズごとに付与されているスコアを合算することで教師ラベルを合成しております。その結果、ポジティブ文章は1670文章、ネガティブ文章は1143文章、合計2813文章になりました。教師ラベルの合成方法詳細はこちらのブログをご覧ください。) pandasデータフレームにデータを格納した状態を確認してみましょう。 df = pd.read_csv(CFG.local_input_file_path) display(df)

Analytics | Data Visualization | Learn SAS
Rick Wicklin 0
Influential observations in a linear regression model: The DFFITS and Cook's D statistics

A previous article describes the DFBETAS statistics for detecting influential observations, where "influential" means that if you delete the observation and refit the model, the estimates for the regression coefficients change substantially. Of course, there are other statistics that you could use to measure influence. Two popular ones are the

Rick Wicklin 0
Append data to add markers to SAS graphs

Do you want to create customized SAS graphs by using PROC SGPLOT and the other ODS graphics procedures? An essential skill that you need to learn is how to merge, join, append, and concatenate SAS data sets that come from different sources. The SAS statistical graphics procedures (SG procedures) enable

Rick Wicklin 0
Compute highest density regions in SAS

In a scatter plot, the regions where observations are packed tightly are areas of high density. A contour plot or heat map of a bivariate kernel density estimate (KDE) is one way to visualize regions of high density. A SAS customer asked whether it is possible to use SAS to

1 2