R CMPRSK パッケージ

CMPRSKパッケージとは

{cmprsk} は、競合リスクイベントのある生存時間分析を実施するためのRパッケージです1。具体的には、次の3つの機能を持っています:

  1. 群間の累積発生関数 (Cumulative Incidence Function; CIF) の同等性の比較検定 (Gray’s test): 異なる群の間でCIFの同等性を比較します。
  2. 推定されたCIFを表として出力する機能: 群ごとに推定されたCIFを表形式で表示します。
  3. 推定されたCIFをグラフとして出力する機能: 群ごとに推定されたCIFをグラフで視覚化します。

このパッケージは、Luca Scrucca氏による{cmprsk}パッケージに基づくラッパー関数であり、詳細な解説は本人のサイトで提供されています1

使用法と主な引数は以下の通りです:

  • ftime: 生存期間 (failure time variable)
  • fstatus: 発生したイベントを示すコード (variable with distinct codes for different causes of failure and also a distinct code for censored observations)
  • group: 比較する群を指定するコード (estimates will be calculated within groups given by distinct values of this variable)
  • t: CIFを評価する時点を指定するベクトル (a vector of time points where the cumulative incidence function should be evaluated)
  • strata: 層別化して検定を実施したい場合に指定する、層を示す変数 (stratification variable)
  • その他のオプション引数: rho, cencode, subset, na.action, level, xlab, ylab, col, lty, lwd, digits など

このパッケージを使って、競合リスクイベントのある生存時間データを効果的に分析できます

スクリプト

 

library(cmprsk)

# Fits the ’proportional subdistribution hazards’ regression model described in Fine and Gray (1999).
# This model directly assesses the effect of covariates on the subdistribution of a particular type of
# failure in a competing risks setting. The method implemented here is described in the paper as the
# weighted estimating equation.
# While the use of model formulas is not supported, the model.matrix function can be used to gener-
#   ate suitable matrices of covariates from factors, eg model.matrix(~factor1+factor2)[,-1] will
# generate the variables for the factor coding of the factors factor1 and factor2. The final [,-1]
# removes the constant term from the output of model.matrix.
# The basic model assumes the subdistribution with covariates z is a constant shift on the complemen-
#   tary log log scale from a baseline subdistribution function. This can be generalized by including
# interactions of z with functions of time to allow the magnitude of the shift to change with follow-up
# time, through the cov2 and tfs arguments. For example, if z is a vector of covariate values, and uft is
# a vector containing the unique failure times for failures of the type of interest (sorted in ascending
#                                                                                    order), then the coefficients a, b and c in the quadratic (in time) model az + bzt + zt2 can be fit by
# specifying cov1=z, cov2=cbind(z,z), tf=function(uft) cbind(uft,uft*uft).
# This function uses an estimate of the survivor function of the censoring distribution to reweight
# contributions to the risk sets for failures from competing causes. In a generalization of the method-
#   ology in the paper, the censoring distribution can be estimated separately within strata defined by
# the cengroup argument. If the censoring distribution is different within groups defined by covari-
#   ates in the model, then validity of the method requires using separate estimates of the censoring
# distribution within those groups.
# The residuals returned are analogous to the Schoenfeld residuals in ordinary survival models. Plot-
#   ting the jth column of res against the vector of unique failure times checks for lack of fit over time
# in the corresponding covariate (column of cov1).
# If variance=FALSE, then some of the functionality in summary.crr and print.crr will be lost.
# This option can be useful in situations where crr is called repeatedly for point estimates, but standard
# errors are not required, such as in some approaches to stepwise model selection.

# simulated data to test
set.seed(10)
ftime <- rexp(200)
fstatus <- sample(0:2,200,replace=TRUE)
cov <- matrix(runif(600),nrow=200)
dimnames(cov)[[2]] <- c('x1','x2','x3')
print(z <- crr(ftime,fstatus,cov))
summary(z)
z.p <- predict(z,rbind(c(.1,.5,.8),c(.1,.5,.2)))
plot(z.p,lty=1,color=2:3)
crr(ftime,fstatus,cov,failcode=2)
# quadratic in time for first cov
crr(ftime,fstatus,cov,cbind(cov[,1],cov[,1]),function(Uft) cbind(Uft,Uft^2))
#additional examples in test.R

 

以下にスクリプトの機能とそれぞれの部分の説明を提供します。

  1. ライブラリの読み込み:
    • library(cmprsk): {cmprsk}パッケージを読み込みます。
  2. シミュレートされたデータの作成:
    • set.seed(10): 乱数生成のシードを設定します。
    • ftime <- rexp(200): 200個の指数分布からなる生存時間データを生成します。
    • fstatus <- sample(0:2,200,replace=TRUE): 200個のランダムなイベントコード(0, 1, 2)を生成します。
    • cov <- matrix(runif(600),nrow=200): 200行3列の乱数行列を生成します。
    • dimnames(cov)[[2]] <- c('x1','x2','x3'): 列名を ‘x1’, ‘x2’, ‘x3’ に設定します。
  3. crr関数を使用して競合リスクイベントのある生存時間データを分析:
    • z <- crr(ftime,fstatus,cov): 群間の累積発生関数(CIF)の同等性を比較し、推定されたCIFを表として出力します。
    • summary(z): 分析結果のサマリーを表示します。
    • z.p <- predict(z,rbind(c(.1,.5,.8),c(.1,.5,.2))): 推定されたCIFを指定した時点で計算し、結果を表示します。
    • plot(z.p,lty=1,color=2:3): 推定されたCIFをグラフで表示します。
    • crr(ftime,fstatus,cov,failcode=2): 特定の失敗コードを持つデータを用いて再度分析を実行します。
    • crr(ftime,fstatus,cov,cbind(cov[,1],cov[,1]),function(Uft) cbind(Uft,Uft^2)): 最初の共変量に対して時間の2次項を考慮した分析を実行します。
  4. 追加の例:
    • test.Rファイルにさらなる例が含まれています。

このスクリプトは、競合リスクイベントのある生存時間データの解析に役立ちます。詳細な使い方やパラメータの調整については、{cmprsk}パッケージのドキュメントや解説を参照してください 123

 

# 実行結果
> print(z <- crr(ftime,fstatus,cov))
convergence:  TRUE 
coefficients:
      x1       x2       x3 
 0.26680 -0.05568  0.28050 
standard errors:
[1] 0.4211 0.3812 0.3810
two-sided p-values:
  x1   x2   x3 
0.53 0.88 0.46 
> summary(z)
Competing Risks Regression

Call:
crr(ftime = ftime, fstatus = fstatus, cov1 = cov)

      coef exp(coef) se(coef)      z p-value
x1  0.2668     1.306    0.421  0.633    0.53
x2 -0.0557     0.946    0.381 -0.146    0.88
x3  0.2805     1.324    0.381  0.736    0.46

   exp(coef) exp(-coef)  2.5% 97.5%
x1     1.306      0.766 0.572  2.98
x2     0.946      1.057 0.448  2.00
x3     1.324      0.755 0.627  2.79

Num. cases = 200
Pseudo Log-likelihood = -320 
Pseudo likelihood ratio test = 1.02  on 3 df,
> z.p <- predict(z,rbind(c(.1,.5,.8),c(.1,.5,.2)))
> plot(z.p,lty=1,color=2:3)
> crr(ftime,fstatus,cov,failcode=2)
convergence:  TRUE 
coefficients:
      x1       x2       x3 
-0.31390 -0.03488 -0.52500 
standard errors:
[1] 0.4517 0.4475 0.4675
two-sided p-values:
  x1   x2   x3 
0.49 0.94 0.26 
> # quadratic in time for first cov
> crr(ftime,fstatus,cov,cbind(cov[,1],cov[,1]),function(Uft) cbind(Uft,Uft^2))
convergence:  TRUE 
coefficients:
                            x1                             x2                             x3 
                       2.16500                       -0.06664                        0.27490 
cbind(cov[, 1], cov[, 1])1*Uft cbind(cov[, 1], cov[, 1])2*tf2 
                      -3.25200                        0.81900 
standard errors:
[1] 0.9464 0.3797 0.3854 1.2590 0.2925
two-sided p-values:
                            x1                             x2                             x3 
                        0.0220                         0.8600                         0.4800 
cbind(cov[, 1], cov[, 1])1*Uft cbind(cov[, 1], cov[, 1])2*tf2 
                        0.0098                         0.0051

次に、Rの cmprsk パッケージを使用して、競合リスク(competing risks)の累積発生率を比較するための解析を行っています。

############################
set.seed(2)
ss <- rexp(100)
gg <- factor(sample(1:3,100,replace=TRUE),1:3,c('a','b','c'))
cc <- sample(0:2,100,replace=TRUE)
strt <- sample(1:2,100,replace=TRUE)
print(xx <- cuminc(ss,cc,gg,strt))
plot(xx,lty=1,color=1:6)
# see also test.R, test.out

具体的には、次の手順を実行しています:

  1. データの生成:
    • set.seed(2) で乱数のシードを設定しています。
    • rexp(100) で指数分布に従うランダムなイベント時間を生成しています。
    • sample(1:3, 100, replace=TRUE) でランダムなイベントの状態(3つのグループ ‘a’, ‘b’, ‘c’)を生成しています。
    • sample(0:2, 100, replace=TRUE) でランダムな検閲状態(0, 1, 2)を生成しています。
    • sample(1:2, 100, replace=TRUE) でランダムな開始時点を生成しています。
  2. cuminc 関数の実行:
    • cuminc(ss, cc, gg, strt) で競合リスクの累積発生率を計算しています。ss はイベント時間、cc はイベントの状態、gg はグループ、strt は開始時点です。
  3. 結果の表示:
    • print(xx) で計算された累積発生率を表示しています。
  4. グラフの描画:
    • plot(xx, lty=1, color=1:6) で累積発生率のグラフを描画しています。

############################
set.seed(2)
ss <- rexp(100)
gg <- factor(sample(1:3,100,replace=TRUE),1:3,c(‘a’,’b’,’c’))
cc <- sample(0:2,100,replace=TRUE)
strt <- sample(1:2,100,replace=TRUE)
print(xx <- cuminc(ss,cc,gg,strt))
plot(xx,lty=1,color=1:6)
# see also test.R, test.out

############################
set.seed(2)
ss <- rexp(100)
gg <- factor(sample(1:3,100,replace=TRUE),1:3,c('a','b','c'))
cc <- sample(0:2,100,replace=TRUE)
strt <- sample(1:2,100,replace=TRUE)
print(xx <- cuminc(ss,cc,gg,strt))
plot(xx,lty=1,color=1:6)
# see also test.R, test.out

このコードは、競合リスクの解析において、各グループの累積発生率を比較するための有用な手法を示しています。12

詳細については、公式ドキュメントをご参照ください:cmprsk パッケージ1

> print(xx <- cuminc(ss,cc,gg,strt))
Tests:
      stat        pv df
1 1.598854 0.4495865  2
2 3.390543 0.1835493  2
Estimates and Variances:
$est
             1         2         3         4
a 1 0.27262599 0.3216446 0.3216446 0.3216446
b 1 0.08877315 0.3423257 0.3423257 0.3423257
c 1 0.23368736 0.4312495 0.4879272 0.4879272
a 2 0.38424403 0.5607109 0.5607109 0.5607109
b 2 0.31463271 0.4786961 0.5234407 0.5234407
c 2 0.20127996 0.3420399 0.3420399 0.3420399

$var
              1           2           3           4
a 1 0.008596053 0.009950848 0.009950848 0.009950848
b 1 0.002491270 0.009675072 0.009675072 0.009675072
c 1 0.006341967 0.011566190 0.012617195 0.012617195
a 2 0.010293273 0.022358101 0.022358101 0.022358101
b 2 0.007220502 0.010014466 0.010588994 0.010588994
c 2 0.005699657 0.010260038 0.010260038 0.010260038

 

 

R excess mortality

超過死亡率の集計

コロナ禍で超過死亡が話題になる事がありましたがどうやって計算しているのかよく知らなかったので少しひも解いてみました。参照した文献はこちら。使用したのはexcessmortパッケージです。

このパッケージにはCDCが公開する、州別で、週ごとの死亡者数の見積もり、に加えて人口の見積もり(Censusという人口統計からの変化を計算した見積もり)の情報がcdc_state_countsというデータフレームで含まれます。これを利用して、新型コロナが流行し始めた2020年以降データと、死亡の多かった2017-18のインフルエンザシーズンを除外したデータを基に、それらの死亡の影響がない場合の期待される死亡のトレンド・季節変化を計算します。そのうえで、そのモデルからの逸脱状況をプロットします。(その逸脱分が新型コロナ(と2017-18はインフルエンザ)の影響と解釈したいという仮説で集計します)

メリーランド州を選択したのは、以前住んでいたからです。

library(excessmort)
library(dplyr)
library(lubridate)
library(ggplot2)



# A list with six ggplot objects: ‘population‘ is a time series plot of the population. ‘seasonal‘ is a
# plot showing the estimated seasonal effect. ‘trend‘ is a time series plot showing the estimated trend.
# ‘weekday‘ is a plot of the estimated weekday effects if they were estimated. ‘expected‘is a time
# series plot of the expected values. ‘residual‘ is a time series plot of the residuals.

flu_season <- seq(make_date(2017, 12, 16), make_date(2018, 1, 16), by = "day")
exclude_dates <- c(flu_season, seq(make_date(2020, 1, 1), today(), by = "day"))
res <- cdc_state_counts %>%
  filter(state == "Maryland") %>%
  compute_expected(exclude = exclude_dates,
                   keep.components = TRUE)

p <- expected_diagnostic(expected = res, alpha = 0.50)
p$population
p$seasonal
p$trend
p$expected
p$residual

 

このRのコードは、統計解析のために使用されるパッケージや関数を活用しています。以下に、コードの動作をプログラム初心者向けに説明します。

  1. ライブラリの読み込み:
    • excessmort, dplyr, lubridate, および ggplot2というライブラリを読み込んでいます。これらはデータの操作、時系列解析、グラフ作成に役立ちます。
  2. データの前処理:
    • flu_seasonは2017年12月16日から2018年1月16日までの日付を生成しています。
    • exclude_datesは特定の日付範囲を除外するために使用されています。
  3. データのフィルタリングと計算:
    • cdc_state_countsから州が「Maryland」のデータを抽出しています。
    • compute_expected関数を使用して期待値を計算しています。keep.components = TRUEは成分を保持するオプションです。
  4. グラフの作成:
    • expected_diagnostic関数を使用して、期待値の診断プロットを作成しています。
    • このプロットには以下の要素が含まれています:
      • population: 人口の時系列プロット
      • seasonal: 推定された季節効果のプロット
      • trend: 推定されたトレンドの時系列プロット
      • expected: 期待値の時系列プロット
      • residual: 残差の時系列プロット

このコードは、データの前処理からグラフの作成までの一連のステップを示しています。プログラム初心者にとっては、ライブラリの読み込みやデータの操作、グラフの作成などが理解しやすいポイントです。12

  • population: 人口の時系列プロット;y軸を操作して変化がわかりやすくした図も掲載します

  • seasonal: 推定された季節効果のプロット;同上

 

  • trend: 推定されたトレンドの時系列プロット;同上

 

 

  • expected: 期待値の時系列プロット;同上

この周期性の変化のモデル(赤い線と帯)が期待値で、実際の週ごとの死亡数をプロットしたものが下図になります。

 

  • residual: 残差の時系列プロット

R epibasixを触ってみた

epibasixパッケージの関数を試して見ました

sensSpec関数

このRコードは、疫学研究において新しい検査法や自己報告を現行のゴールドスタンダードと比較する際に、感度、特異度、Youden指数、および一致率を計算するためのものです。

library(epibasix)

# This function is designed to calculate Sensitivity, Specificity, Youden’s J and Percent Agreement.
# These tools are used to assess the validity of a new instrument or self-report against the current
# gold standard. In general, self-report is less expensive, but may be subject to information bias.
# Computational formulae can be found in the reference.

dat <- cbind(c(18,1), c(19,11))
summary(sensSpec(dat))

# Szklo M and Nieto FJ. Epidemiology: Beyond the Basics, Jones and Bartlett: Boston, 2007 P.315
  • 感度 (Sensitivity): 検査法が疾患を正しく検出する能力を評価します。感度は、疾患の存在する人々のうち、検査で陽性と判定された割合を示します。
  • 特異度 (Specificity): 検査法が健康な人々を正しく陰性と判定する能力を評価します。特異度は、健康な人々のうち、検査で陰性と判定された割合を示します。
  • Youden指数 (J): Youden指数は、感度と特異度のバランスを示す指標です。Youden指数は、感度と特異度の和から1を引いた値で計算されます。Youden指数が高いほど、検査法の性能が良いことを意味します。
  • 一致率 (Percent Agreement): 現行のゴールドスタンダードと新しい検査法の結果が一致する割合を示します。一致率は、両者の結果が同じと判定された割合です。

このコードでは、epibasixパッケージを使用して、与えられたデータセットから感度、特異度、Youden指数、および一致率を計算しています。具体的な計算式は、参考文献で確認できます1

このような指標を使用することで、新しい検査法の有効性を評価し、疫学研究において適切な判断を行うことができます。

sensSpec関数の実行結果

> summary(sensSpec(dat))

 Detailed Sensitivity and Specitivity Output 
 
Input Matrix: 
           Gold Standard A Gold Standard B
Reported A              18              19
Reported B               1              11

The sample sensitivity is: 94.7% 
95% Confidence Limits for true sensitivity are: [84.7, 104.8]

The sample of specificity is: 36.7% 
95% Confidence Limits for true specificity are: [19.4, 53.9]

The sample value of Youden's J is: 31.4
95% Confidence Limits for Youden's J are: [11.4, 51.4]

Sample value for Percent Agreement (PA) is: 59.2% 
95% Confidence Limits for PA are: [45.4, 72.9]

ま、そういう事みたいです。

univar関数

このRコードは、単一の変数に対する詳細な単変量解析を提供します。具体的には、以下の統計量を計算します:

  • 平均 (mean): 観測値の平均値。
  • 中央値 (median): 観測値の中央値。
  • 標準偏差 (standard deviation): 観測値のばらつきの尺度。
  • 範囲 (range): 観測値の最小値から最大値までの幅。
  • 仮説検定と信頼区間のツール

具体的な使用方法は次の通りです:

#This function provides detailed univariate analysis for a single variable. Values include the sample
# mean, median, standard deviation and range, as well as tools for hypothesis tests and confidence
# intervals.

x <- rexp(100)
univar(x)

# Casella G and Berger RL. Statistical Inference (2nd Ed.) Duxbury: New York, 2002.

univar関数の実行結果

> x <- rexp(100)
> univar(x)

Univariate Summary
 
Sample Size: 100
Sample Mean: 0.972 
Sample Median: 0.632 
Sample Standard Deviation: 0.986 

ま、このパッケージは他のものでカバーできそうかな

 

Rで二項分布をまとめて計算

二項分布をまとめて計算

はじめに

複数の頻度と95%信頼区間を計算したい。普段、頻度とその95%信頼区間はbinom.test(a, b)を用いて計算しています。これに、データフレームのデータを流し込んで一気に、頻度 estimateと信頼区間の上限upperと下限lowerの値をベクトルとして得たい。

サンプルコード

bunsi <- c(1, 2, 3, 4)
bunbo <- c(10, 15, 16, 20)
df <- data.frame(bunsi, bunbo)

result <- mapply( binom.test, df$bunsi, df$bunbo ) 
estimates <- unlist(result[5,]) # estimate, 頻度
conf_int <- matrix ( unlist(result[4,]) , byrow=F, nrow=2 ) # conf.int
lower <- conf_int[1,]
upper <- conf_int[2,]

解説

このRスクリプトは、4つの異なる二項分布に関する二項検定を行っています。 まず、ベクトル`bunsi`と`bunbo`が定義されており、それぞれ成功回数と試行回数を表しています。

次に、これらのベクトルを使用してデータフレーム`df`が作成されます。

`mapply`関数は、`binom.test`を用いて、`df`の各行について二項検定を行います。`binom.test`は、二項分布における成功の確率を推定し、その確率が指定した値(デフォルトでは0.5)から有意に異なるかどうかを検定します。

結果のリストから、`estimates`(推定値)と`conf_int`(信頼区間)が抽出されます。`estimates`は成功の確率の推定値を、`conf_int`はその95%信頼区間を表しています。

最後に、信頼区間の下限`lower`と上限`upper`が抽出されています。 したがって、このスクリプトは4つの二項分布の成功確率を推定し、その信頼区間を計算しています。

二重ルーターになっていないか

二重ルーター

自宅のネットが遅いとき、ハブのつもりで設定している機器が複数ルーターになっていたら、それを解消するだけで良くなるかもしれません。

方法

windows 標準プログラムにある、コマンドプロンプトで次を入力します

Tracert -d 8.8.8.8

出力に以下で始まるアドレスが2つ以上あったら、家のネットにつながっている機器の設定を片端から確認しましょう。

  • 192.
  • 172.
  • 10.

「ブリッジモード」「アクセスポイントモード(APモード)」なら〇
「ルーター」なら×

 

コマンドの意味

`tracert -d 8.8.8.8`はWindowsのコマンドプロンプトで使われるコマンドです。 ここで、`tracert`は”trace route”の略で、インターネット上のルートを追跡するためのツールです。指定された宛先ホストまでのIPネットワークルートを表示します。これはパケットが送信元から宛先までどのルートをたどるかを確認するために使用されます。 `-d`オプションは、途中のルートでの名前解決を行わないことを指示します。つまり、各ホップのIPアドレスを表示しますが、それらのIPアドレスに関連するホスト名は表示しません。 `8.8.8.8`はGoogleの公開DNSサーバの一つのIPアドレスです。 したがって、`tracert -d 8.8.8.8`コマンドは、現在のマシンからGoogleのDNSサーバまでのルートを追跡し、その各ホップのIPアドレスを表示します。 ただし、今回のプロジェクトではインターネットへのアクセスを前提としたコードを生成できないため、このコマンドをプログラム内で使用することはできません。

R データフレームのカラム名の変更

R データフレームのカラム名の変更

dplyr パッケージのrenameを使います。

rename ([新しいカラム名1] = [現在のカラム名1], …., [新しいカラム名n] = [現在のカラム名n])

library(dplyr)

LineList %>%  
  rename(Srsnss    = ILD重篤性,
         WrstGrade = ILD最悪Grade) -> LineList

この例では、Rコードはdplyrパッケージを利用しています。dplyrはデータ操作と変換を行うためのツールを提供するRパッケージです。

このコードは、LineListというデータフレームのカラム名を変更しています。具体的には、”ILD重篤性”というカラム名を”Srsnss”に変更し、”ILD最悪Grade”というカラム名を”WrstGrade”に変更しています。変更後のデータフレームはLineListRに格納されます。

%>%はパイプオペレータと呼ばれ、左側のオブジェクトを右側の関数に引数として渡す役割を果たします。これにより、コードを読みやすく、理解しやすくすることができます。

産後うつ病と誤診されたシーハン症候群の頻度、臨床症状、および経過

シーハン症候群は、産後うつ病に類似した精神科的症状を呈することが多く、診断の遅れが7〜15年に及ぶこともある。しかし、誤診の頻度に関する体系的なデータは存在せず、ホルモン補充療法によって症状は通常迅速に改善する。


産後うつ病に類似した精神科的症状の症例

  • 複数の症例報告およびケースシリーズ(Kaleら, 1999; Maneeshaら, 2024; Chiuら, 2021; Qadriら, 2015; de Silvaら, 2020)では、シーハン症候群が精神科的症状、特にうつ病や精神病として現れることが記述されている。
  • 一部の症例では、幻覚や妄想などの精神病症状が顕著であり(Chiuら, 2021; de Silvaら, 2020)、ホルモン補充療法によって改善した。
  • 他の症例では、うつ病症状が主な特徴であり(Maneeshaら, 2024; Qadriら, 2015)、初期には精神科的治療が行われた。
  • 不穏、恐怖感、認知障害などの行動変化も報告されている(Chiuら, 2021; Errarhayら, 2008; de Silvaら, 2020)。
  • これらの報告では、典型的な内分泌症状が欠如していたり見逃されていたりすることがあり、診断を困難にしていた。

誤診の頻度とパターン

  • シーハン症候群が産後うつ病と誤診される頻度を体系的に報告した研究は含まれていない。
  • 症例報告からの逸話的証拠(Kaleら, 1999; Maneeshaら, 2024; Chiuら, 2021; Qadriら, 2015; de Silvaら, 2020)では、精神科的症状が診断の遅れや見逃しにつながることが多いとされている。
  • より大規模な後ろ向き研究(Ramiandrasoaら, 2013; Sanyal & Raychaudhuri, 2012)は診断の遅れや初期症状に焦点を当てているが、精神科的誤診の割合については要旨に記載がなかった。
  • 症例報告から得られる証拠では、神経精神症状が主であり、典型的な内分泌症状が微妙または欠如している場合に誤診が起こる可能性があるが、体系的なデータがないため、正確な頻度の推定は困難である。

臨床経過と診断の遅れ

  • より大規模な症例集(Ramiandrasoaら, 2013; Sanyal & Raychaudhuri, 2012; Chiuら, 2021)では、平均7〜15年の診断遅延が報告されている。
  • 遅延の原因としては以下が挙げられている:
    • 非特異的な症状
    • 医師の認識不足
    • 精神科的症状を一次的な気分障害や精神病と誤認
  • 複数の症例報告(Maneeshaら, 2024; Qadriら, 2015; de Silvaら, 2020)では、患者が数年間精神科薬で治療された後に正しい診断が下された。
  • ホルモン補充療法により、精神科的および全身症状の迅速かつしばしば完全な改善が見られた(Kaleら, 1999; Chiuら, 2021; Errarhayら, 2008; de Silvaら, 2020)。

鑑別診断の手がかりとなる臨床所見

  • 授乳不能(無乳症)や無月経などの内分泌症状は、これらを記載した研究において信頼できる手がかりとされている(Ramiandrasoaら, 2013; Sanyal & Raychaudhuri, 2012; Errarhayら, 2008)。
  • その他の全身症状(甲状腺機能低下症、副腎不全、低ナトリウム血症、低血糖)は報告にばらつきがある(Ramiandrasoaら, 2013; Sanyal & Raychaudhuri, 2012; Errarhayら, 2008; de Silvaら, 2020)。
  • これらの症状が、産後出血の文脈で出現した場合、産後の精神科的症状を呈する女性に対してシーハン症候群を考慮する契機となる可能性があると示唆されている。

Study Study Design Population Primary Focus Psychiatric Manifestations Reported Full text retrieved
Kale et al., 1999 Case report 1 woman, 23 years Postpartum psychosis in Sheehan’s syndrome Postpartum – No psychosis No
Maneesha et al., 2024 Case report 1 woman, 39 years, multiparous Depression and dyselectrolytaemia in Sheehan’s syndrome Depression No
Ramiandrasoa et al., 2013 Retrospective cohort study 40 women (39 analyzed) Clinical features and diagnostic delay in Sheehan’s syndrome No mention No found
Diri et al., 2015 Review article Not applicable Epidemiology, clinical features, diagnosis, treatment of Sheehan’s syndrome No mention found No
Chiu et al., 2021 Case report and case series 1 woman, 42 years (case); 19 patients (series) Sheehan’s syndrome presenting as postpartum psychosis Behavioral changes, psychosis, depression Yes
Dejager et al., 1998 Case report No mention found Acute phase differential diagnosis in Sheehan’s syndrome No mention No found
Qadri et al., 2015 Case report 1 woman, 45 years Sheehan’s syndrome presenting as major depressive disorder Major depressive disorder No
Sanyal and Raychaudhuri, 2012 Retrospective case series 18 women, 28–71 years Presenting features of Sheehan’s syndrome at diagnosis No mention found No
Errarhay et al., 2008 Case report and literature review 1 woman, 40 years, three pregnancies, three births Sheehan’s syndrome with neuroendocrine and systemic manifestations Agitation, convulsions Yes
de Silva et al., 2020 Case report and literature review 1 woman, 32 years, third child Sheehan’s syndrome with psychotic manifestations Fearfulness, delusions, hallucinations, cognitive impairment No

References

Cynthia Ramiandrasoa, F. Castinetti, I. Raingeard, P. Fénichel, O. Chabre, T. Brue, and B. Courbière. “Delayed Di- agnosis of Sheehan’s Syndrome in a Developed Country: A Retrospective Cohort Study.” European Journal of Endocrinology, 2013.

D. Sanyal, and M. Raychaudhuri. “Varied Presentations of Sheehan’s Syndrome at Diagnosis: A Review of 18 Patients.” Indian Journal of Endocrinology and Metabolism, 2012.

H. Diri, Z. Karaca, F. Tanrıverdi, K. Unluhizarci, and F. Keleştimur. “Sheehan’s Syndrome: New Insights into an Old Disease.” Endocrine, 2015.

H. H. Chiu, E. M. Masamayor, Ma. Belen B. Pilit-Hizon, A. B. Uy, M. C. Ańonuevo-Cruz, and Gabriel Jasul. “Sheehan’s Syndrome Presenting as Postpartum Psychosis.” Acta Medica Philippina, 2021.

K. Kale, N. Nihalani, N. Karnik, and N. Shah. “POSTPARTUM PSYCHOSIS IN A CASE OF SHEEHAN’S SYNDROME.” Indian Journal of Psychiatry, 1999.

M. Maneesha, KS Chenthil, Vignessh Raveekumaran, and J. F. Mary. “A Rare Case of Sheehan’s Syndrome Presenting as Depression and Dyselectrolytaemia in a Multiparous Woman.” Journal of Clinical and Diagnostic Research, 2024.

Mehmood Qadri, M. Mushtaq, I. Qazi, S. Yousuf, and A. Rashid. “Sheehan’s Syndrome Presenting as Major Depressive Disorder.” Iranian Journal of Medical Sciences, 2015.

N. D. de Silva, J. Galhenage, M. Dayabandara, and N. Somasundaram. “Sheehan Syndrome Presenting with Psychotic Manifestations Mimicking Schizophrenia in a Young Female: A Case Report and Review of the Literature.” Case Reports in Endocrinology, 2020.

S. Dejager, S. Gerber, L. Foubert, and G. Turpin. “Sheehan’s Syndrome: Differential Diagnosis in the Acute Phase.” Journal of Internal Medicine, 1998.

S. Errarhay, I. Kamaoui, C. Bouchikhi, H. Chaara, Hakima Bouguern, S. Tizniti, A. Melhouf, and A. Banani. “Sheehan’s Syndrome A Case Report and Literature Review.” Libyan Journal of Medicine, 2008.

Rでデータ整理

上のようなデータがあったとして、dplyrで少し成形します

  1. filter() … 行の選択
  2. arrange() … 行の並び替え
  3. select() … 指定した列のみ選択
  4. mutate() … 新しい列の追加
  5. group_by() … グルーピング
  6. summarize() … 集計

 

tidyverse のフィルターを使って

library(tidyverse)
library(readxl)
library(dplyr)

df <- read_xlsx("0050 irAE.xlsx")

df %>%  
  filter(ir_AE == -1) %>% # ir_AE が-1(TRUEを-1で入力してある)の行のみ選択
  arrange(Time2Onset) %>% # Time2Onsetの順に並べ替え(この後平均を取るので意味なし😛)
  group_by(`医薬品(一般名)`, irAE ) %>% # 医薬品およびirAEごとにグループ化
  summarise(avTO = mean(Time2Onset))  -> newDF # 医薬品・irAE毎のTime2Onset平均値を計算して、newDFというデータフレームへ書き出す

以下のような出力になりました

 

解説

このRスクリプトは、指定されたExcelファイルからデータを読み込み、特定の条件に基づいてデータをフィルタリング、並べ替え、グループ化し、平均値を計算します。

まず、”tidyverse”と”readxl”、”dplyr”という3つのRパッケージを読み込みます。

次に、read_xlsx関数を使用して、指定されたExcelファイル(“0050 irAE.xlsx”)からデータを読み込み、dfという名前のデータフレームに格納します。

その後、dfデータフレームを使用して、ir_AE列が-1(TRUEを-1で入力してある)の行のみを選択します。さらに、Time2Onset列の値を基準に昇順に並べ替えます(ただし、この後の平均値の計算には影響しません)。

次に、医薬品(一般名)とirAEの値を基準にグループ化し、それぞれのグループごとにTime2Onsetの平均値を計算します。計算結果は、”医薬品(一般名)”と”irAE”、”avTO”という列名を持つ新しいデータフレームnewDFに格納されます。

以上が、このRスクリプトの動作です。

便利そうなサイト

フリー写真素材の検索

O-DAN (オーダン)- 無料写真素材・フリーフォト検索

日本語で検索出来て、キーワードに沿ったフリーの写真を提示してくれます。

写真をクリックしたら、フリー素材提供元のサイトへ飛びます。

 

セキュリティチェックサイト

URL(リンク・サイト・ホームページ)の安全・危険、リンクスパム・ウイルスや詐欺フィッシングをチェック、短縮URLの展開・解析、サイトキャプチャ取得も可能。 (securl.nu)

接続する前に安全性をチェック

 

捨てアドサイト

ワンクリックでアドレス発行!「ワンタイムメール」 (onetime-mail.com)

一時的に利用したいメールアドレスをweb上で作成できるサイト

1週間使用できるアドレスが生成されて、当該ページでメールを見ることができます。

 

昔のWebサイトの魚拓

Internet Archive: Wayback Machine

 

 

 

 

WAVLINK AC1200取説

WAVLINK AC1200という、安価な無線ルーターを使用しています。

少し電力消費が多そう(熱くなる)ので経済的でないかもしれませんが、かなり昔ですが安かったのでポチッとしました。

これを中継機として使用するにあたって、説明書がなくて困りました。ネットで調べたリンクを貼っておきます。

とりあえず、ログインするには、こいつのwifi電波に接続した上で 192.168.10.1 へ接続し、パスワードadmin (当然私はもう変更しています)で設定画面に入れます。

backup

Translate »