binned_residuals() fails for models fitted with na.action = na.exclude

オープン 初心者向け
#1,038 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
r

調査の方向性

binned_residuals() の実装から始めて、提供された glm() の例を na.action = na.exclude 付きで再現する。test-check_model.R の既存のケース、特に過分散のテストを調べ、その後、予測変数が欠落しているケースの回帰テストを追加する。完了の基準は、除外された観測が長さの不一致なく処理され、binned_residuals(m) が成功し、check_model() の Binned Residuals パネルが表示されることである。

索引モデルが issue の本文から書いたものです。

説明

binned_residuals() errors for a logistic regression fitted with na.action = na.exclude when a predictor has a missing value:

library(performance)
d <- transform(mtcars, x = replace(wt, 1, NA_real_))
m <- glm(am ~ x, data = d, family = binomial, na.action = na.exclude)
binned_residuals(m)
#> Error in binned_residuals(m): 'x' must be nonnegative and integer
#> In addition: Warning message:
#> In y0 - fitted_values :
#>   longer object length is not a multiple of shorter object length

The response still includes the excluded row, but the fitted values don't, so the two vectors have different lengths. With the default na.omit it works. check_model() calls binned_residuals() inside .safe(), so for these models the Binned Residuals panel just goes missing without a message. The package's tests already use na.exclude with glm fits in check_model() (test-check_model.R, the overdispersion tests).

主要言語
R
スター
1.2k
フォーク
113
平均マージ
9時間 8分
マージ済み PR(30日)
27

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

easystats/performance のほかの issue

easystats/performance の issue をすべて見る

似ている issue

R の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。