Make `exact_r` and `exact_sas` methods for `bin_prob_test()`

Đang mở
#5 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
r
Lĩnh vực
data

Hướng nghiên cứu

Read the implementation of bin_prob_test() and its tests to see how it currently calculates one-sided and two-sided p-values. Add exact_r and exact_sas methods that follow the tail-selection and two-sided conventions described in the issue. The right-tail numerical correction is left unresolved, so clarify its expected behavior before considering the work done.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

There are some methodological differences between SAS and R for these tests.

  1. One-sided p-values. Both use the same tail sums, $P(X \le x)$ and $P(X \ge x)$.
  • R returns whichever tail you ask for.
  • PROC FREQ keeps only the smaller tail, in XPL_BIN or XPR_BIN, and leaves the other variable missing.
  1. Two-sided p-values.
  • binom.test() uses the "minlike" method: it adds the probabilities of every outcome no more likely than the observed one.
  • SAS uses the "central" method: twice the smaller tail, capped at 1. The two agree only when $p_0 = 0.5$, where the null distribution is symmetric.
  1. Numerical calculation (not a definition difference).
  • SAS's right tail behaves as if it were computed as $1 − P(X \le x − 1)$. That subtraction leaves an absolute error of about 1e-14.
  • R computes the upper tail directly.

Instead of trying to rectify them, we'll use two different methods. Not sure what to do about the right tail correction.

Ngôn ngữ chính
R
Star
0
Fork
0
Merge trung bình
3 ngày 13 giờ
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của posit-dev/segue

Tất cả issue của posit-dev/segue

Issue tương tự

Thêm issue về R

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.