---
title: Proc PSMATCH
tags:  #[第6回大阪sas勉強会]  
author: [森岡裕[SASユーザー総会世話人]](https://www.docswell.com/user/6484025)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/V7NGW5G1E8.jpg?width=480
description: [第6回大阪sas勉強会]　中谷　太一
published: April 03, 24
canonical: https://www.docswell.com/s/6484025/ZW12VD-2024-04-03-102026
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/V7NGW5G1E8.jpg)

Proc PSMATCH
標準化された平均の差(Standardized Mean Difference)について
第6回
大阪SAS勉強会
中谷 太一


# Page. 2

![Page Image](https://bcdn.docswell.com/page/YJ9WXYWYJ3.jpg)

Proc PSMATCH
• 傾向スコア（プロペンシティスコア：PS）を算出し、その値
を用いて2群間のマッチングを行ってくれるありがたいプロ
シージャ。
• マッチング前後で背景情報の群間の差が小さくなったか確かめ
る必要がある→そん時に用いる指標の一つが標準化された平均
の差(Standardized Mean Difference：SMD)
• Proc PSMATCHはマッチングするだけではなく、マッチング
前後のSMDも算出してくれる。また、IPWとかも出してくれる


# Page. 3

![Page Image](https://bcdn.docswell.com/page/GJ8N26NKED.jpg)

標準化された平均の差(Standardized Mean
Difference：SMD)
• 計算式
2群間の差
プールした標準偏差
• 連続データ
• カテゴリデータ


# Page. 4

![Page Image](https://bcdn.docswell.com/page/LJLP29PPER.jpg)

サンプルデータ
• Example 96.1 Propensity Score Weighting
• https://documentation.sas.com/?docsetId=statug&amp;docsetTarget=statug_code
_psmchex1.htm&amp;docsetVersion=14.3&amp;locale=en
• 観察研究のデータセットDrugs (n=486)
• 治療（Drug=‘Drug_X’[治療群], ‘Drug_A’[対照群]）
• 年齢（Age）
• 性別（Gender=‘Male’, ‘Female’）
• BMI（Bmi）


# Page. 5

![Page Image](https://bcdn.docswell.com/page/47M48Z42EW.jpg)

1:1最近傍（Greedy）マッチング
proc psmatch data=drugs region=allobs ;
class Drug Gender ;
psmodel Drug(Treated=&#039;Drug_X&#039;)= Gender Age BMI ;
match method=greedy (k=1 order=descending )
stat=lps caliper(mult=stddev) =0.20 ;
マッチング前と後の群間差を評価してくれる
assess lps var=(Gender Age BMI) / weight=none varinfo plots=(all) ;
output out (obs=match) = psmatch ps=ps lps=lps matchwgt=match
matchid=matchsort ;
run ;


# Page. 6

![Page Image](https://bcdn.docswell.com/page/P7RW56W5E9.jpg)

マッチング後データ
Match前→
小さくなってる！


# Page. 7

![Page Image](https://bcdn.docswell.com/page/PJXPKMPXEX.jpg)

手計算で再現しようとすると
• All：
(36.30973-40.40483)/SQRT((5.534114**2+6.579103**2)/2)= -0.673635442
SASのOUTPUT= -0.67363
• Matced：
(36.30973-35.88496)/SQRT((5.534114**2+5.468664**2)/2)= 0.0772100437
SASのOUTPUT= 0.06988
値が違う！


# Page. 8

![Page Image](https://bcdn.docswell.com/page/3JKD5GD97D.jpg)

SASはMATCH前（All）のSDを使ってる！
• All：
(36.30973-40.40483)/SQRT((5.534114**2+6.579103**2)/2)= -0.673635442
SASのOUTPUT= -0.67363
• Matced：
(36.30973-35.88496)/SQRT((5.534114**2+5.468664**2)/2)= 0.0772100437
SASのOUTPUT= 0.06988
• Matced（AllのSDを使用して計算）：
値が一致！
(36.30973-35.88496)/SQRT((5.534114**2+6.579103**2)/2)= 0.0698737825
• Proc PSMATCHを使用される際はご注意ください！（大勢に影
響はないですが。。。）


