>100 Views
April 06, 26
スライド概要
SAS言語を中心として,解析業務担当者・プログラマなのコミュニティを活性化したいです
1 はじめてのQuarto R with Pharma Lab 茅根健 (Takeru Chinone) イーピーエス株式会社 2026-04-08
2 発表の目的 • はじめて Quarto に触れる方、あまり触れたことがない方を対象に Quarto を知って いただくこと 注意事項 • Quarto は内容が多岐にわたるため、すべてをカバーする内容となっておりません • 詳細や不明点は公式サイトをご確認ください ▪ quarto
3 1. Quarto とは 2. Quarto の事例紹介 3. Quarto に触れてみよう 4. まとめ
5 1. Quarto とは 2. Quarto の事例紹介 3. Quarto に触れてみよう 4. まとめ
6 quarto とは • Posit 社が開発したオープンソースの科学技術文書作成システム ▪ quarto • コード/実行結果/数式/文章を1つのソースから文書として生成 • R/Python/Julia など複数の言語を同じ文書内で使用可能 • HTML/PDF/Word/PowerPoint など様々な形式で文書やスライドを生成可能 • ファイルの拡張子は .qmd Allison Horst
7 具体例 1/2 1 library(tidyverse) 2 3 ggplot(mpg, aes(x = hwy, y = cty, color = cyl)) + 4 geom_point(alpha = 0.5, size = 2) + 5 scale_color_viridis_c() + 6 theme_minimal() cyl 8 7 6 5 4 35 30 25 20 15 10 20 30 40 hwy
8 具体例 2/2 A Quarto Page Layout Example Inspired by Tufte Handout, Using Quarto PUBLISHED April 30, 2023 Other Formats PDF Introduction This document demonstrates the use of a number of advanced page layout features to produce an attractive and usable document inspired by the Tufte handout style and the use of Tufte's styles in RMarkdown documents (Xie, Allaire, and Grolemund 2018). The Tufte handout style is a style that Edward Tufte uses in his books and handouts. Tufte's style is known for its extensive use of sidenotes, tight integration of graphics with text, and well-set typography. Quarto¹ supports most of the layout techniques that are used in the Tufte handout style for both HTML and LaTeX/PDF output. --- title: "An Example Using the Tufte Style" author: "John Smith" format: html: grid: margin-width: 350px pdf: default reference-location: margin citation-location: margin --- 1 Increases the width of the margin to make more room for sidenotes and margin figures (HTML only). 2 Places footnotes and cited sources in the margin. Other layout options (for example placing a figure in the margin) will be set per element in examples below. 1 To learn more, you can read more about Quarto or visit Quarto's Github repository. Xie, Yihui, J. J. Allaire, and Garrett Grolemund. 2018. "Tufte Handouts." In R Markdown: The Definitive Guide, 137-46. Chapman: Hall/CRC. https://doi.org/10.1201/9781138359444-6. Quarto Gallery
9 Quarto の強み • コード/実行結果/数式/文章を1つのソースから文書として生成 • 基となるデータが変更された際に再生成可能な再現性のあるドキュメントの作成が可能 • R/Python/Julia など複数の言語を同じ文書内で使用可能 • HTML/PDF/Word/PowerPoint など様々な形式で文書やスライドを生成可能 • 公式サイトなど情報が豊富 ▪ quarto
11 1. Quarto とは 2. Quarto の事例紹介 3. Quarto に触れてみよう 4. まとめ
12 CAMIS • PHUSE、PSI、ASA、IASCT の各団体メンバーと共同で運営されている、業界横断的 な PHUSE DVOST WG ▪ CAMIS (Comparing Analysis Method Implementations in Software) • 本プロジェクトの目的は、主に SAS、R、Python といったプログラミング言語間にお ける統計解析手法や解析結果の差異を解明するため、それらの類似点と相違点について 比較と包括的な説明を行うこと Repository The repository below provides examples of statistical methodology in different software and languages, along with a comparison of the results obtained and description of any discrepancies. Statistical Methodology R SAS Python Comparison Summary Statistics Rounding R SAS Python R vs SAS Summary statistics R SAS Python R vs SAS Skewness/Kurtosis R SAS Python R vs SAS General Linear Models One-sample t-test R SAS Python R vs SAS Paired t-test R SAS Python R vs SAS Two-sample t-test R SAS Python R vs SAS ANOVA R SAS Python R vs SAS ANCOVA R SAS Python R vs SAS MANOVA R SAS Python R vs SAS Linear regression R SAS Python R vs SAS Generalized Linear Models Logistic regression R SAS Python R vs SAS On this page Introduction to CAMIS Motivation Repository
13 そのほかの事例 • Documents ▪ R for Data Science (2e) ▪ Causal Inference in R ▪ Time Series Analysis • Dashboard ▪ Palmer Penguins Cobblepot Analytics • Quarto Live Documentation ▪ Interactive Code Blocks
14 R Submission Pilot • R を使用した FDA submission の実証実験 • R で作成したデータセット、解析結果、R のパッケージや実行環境で FDA 申請でき、 レビュー側が再現、評価できるか、何が課題かを検証することが目的 ▪ R Submissions Working Group ▪ R Submissions Working Group: 2026 Plans and 2025 Success • Pilot 5 では ADRG (Analysis Data Reviewer’s Guide) が Quarto で作成された ▪ ADRG ▪ adrg.qmd
16 1. Quarto とは 2. Quarto の事例紹介 3. Quarto に触れてみよう 4. まとめ
17 Quarto に触れてみよう 1/3
18 Quarto に触れてみよう 2/3 4. qmd ファイルを保存し、Render をクリック • YAMLヘッダー ▪ タイトル、サブタイトル、著者、日 付などのメタデータや、テーマや目 次などを設定する ▪ 使用可能なYAMLフィールドは文書 形式によって異なる
19 Quarto に触れてみよう 3/3 5. html ファイルが作成できた!! Untitled Quarto Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org. Running Code When you click the Render button a document will be generated that includes both content the output of embedded code. You can embed code this: 1 + 1 [1] 2 You can add options to executable code this [1] 4 The echo: false option disables the printing of code (only output is displayed).
20 ここまで Quarto に触れてみて… • 実装することは難しいのではないか? • コードを見ると複雑そう… • Quarto の事例や情報は豊富
21 Quarto の事例や情報は豊富 1/5 • Guide|quarto
22 Quarto の事例や情報は豊富 2/5 • Gallery|quarto
23 Quarto の事例や情報は豊富 3/5 • Gallery|quarto • ソースコード (.qmd) をダウンロード可能
24 Quarto の事例や情報は豊富 4/5 • ダウンロードしたファイルを RStudio で開き「Render」をクリック • RStudio 以外で実行する場合は公式サイトから Quarto のインストールが必要 ▪ Get Started|quarto
25 Quarto の事例や情報は豊富 5/5 • 結果が再現できた!!
26 シミュレーションや例数設計にも活用可能 • cache を設定すれば不要な再実行なく、レンダリング可能 BOINデザイン シミュレーション AUTHOR Your Name 目的 本資料では、BOINデザインを用いたがん第1相試験のシミュレーション結果をまとめる。 各シナリオにおける以下の operating characteristics を比較する。 • MTD 選択確率 • 各用量への割付割合 • 平均サンプルサイズ • 早期中止割合 • 各シナリオの詳細結果 試験デザイン設定 項目 設定値 目標DLT確率 0.3 コホートサイズ 3.0 最大患者数 18.0 最大コホート数 6.0 早期中止判定患者数 9.0 シミュレーション回数 10000.0 シナリオ設定
28 1. Quarto とは 2. Quarto の事例紹介 3. Quarto に触れてみよう 4. まとめ
29 Quarto • コード/実行結果/数式/文章を1つのソースから文書として生成 • データやコードを変更すると文書を作り直すだけで結果を更新可能 • HTML/PDF/Word/PowerPoint など様々な形式で文書やスライドを生成可能 • オープンソースであるため情報が豊富 • 使用事例も豊富で、活用範囲も広い
30 Quarto 関連リンク • quarto • 私たちのR • R for Data Science (2e)