高校数学の質問スレ(医者・東大卒専用) Part438 (899レス)
上下前次1-新
748: 02/26(水)21:49 ID:E7jH3bIC(1) AAS
チンパンプログラムを論破されて即ダンマリか
749: 02/28(金)08:21 ID:qVZPDzwA(1) AAS
>>742に質問!
①円周率が3.05より大きいことを証明せよ。
ただし円周率は(円周)/(円の直径)と定義され、円周率が3.14より大きい事は判明していないものとする。
②√2+√3が無理数であることを証明せよ。
750: 02/28(金)10:01 ID:eqavAO1F(1) AAS
多分プログラミングもAIにやらしてんだろ
751: 03/01(土)17:26 ID:uehyvjy5(1/2) AAS
尿瓶ジジイ完全にダンマリで草
752: 03/01(土)18:38 ID:uehyvjy5(2/2) AAS
リアルじゃ当然誰にも相手にされないしもちろんここでもそうだけどAIは話し相手になってくれるからここで発狂する必要がなくなったのか?よかったねww
753: 03/12(水)21:31 ID:pDKAHj/P(1) AAS
「鹿児島 私立中学 寮 事件」や「学校名 寮 いじめ」で画像検索したらどこかわかるけど、絶対に探すなよ
i.imgur.com/s0F0tJb.jpeg i.imgur.com/4nmblMW.png
ソース 鹿児島放送 動画 外部リンク:www.tiktok.com
【鹿児島】私立中男子が入浴中に寮で大けが…「加害生徒の処分を」被害生徒の父が会見、いじめ重大事態に認定した学校へ調査と適切な対応求める
鹿児島県内の私立中学校の寮で、入浴していた1年生の男子生徒が、同学年の複数の男子生徒に両足首を引っ張られて転倒し、右手にまひが残るけがを負っていたことが7日、分かった。
学校はいじめ防止対策推進法に基づく重大事態に認定。今後、第三者委員会を設置して調査を進める。
省9
754(1): 03/19(水)16:01 ID:TUD6PvYL(1) AAS
"
6人でババ抜きをした時の初期状態の手札の枚数の期待値は?
カードは52枚+ジョーカー
"
sim=function(){
# 1から13までの数字が各々4枚と0を含む53枚のリストを作成
numbers <- rep(c(0, 1:13), times = c(1, rep(4, 13)))
省23
755: 03/19(水)16:11 ID:3ZtJz5f5(1) AAS
>>754
ジジイあれだけアホ晒しておいてまだ懲りてなかったのかよ
756(1): 03/24(月)08:15 ID:Wji9obyD(1) AAS
赤玉5個、黒玉3個、白玉2個を(4個, 3個, 3個)に分ける方法(もらう人を区別しない)」を全て列挙せよ
library(gtools) # permutations を使用
# 各色の玉の個数
balls <- c(赤 = 4, 黒 = 3, 白 = 2, 青 = 1)
# 各箱のサイズ
box_sizes <- c(4, 3, 3)
# 指定したサイズで玉を選ぶ関数
省40
757(1): 03/24(月)16:20 ID:35F9kJ68(1) AAS
>>756に質問!
①円周率が3.05より大きいことを証明せよ。
ただし円周率は(円周)/(円の直径)と定義され、円周率が3.14より大きい事は判明していないものとする。
②√2+√3が無理数であることを証明せよ。
758(3): 03/24(月)16:41 ID:qqln3hev(1) AAS
>>757
自明
759: 03/24(月)16:52 ID:sGC1elSQ(1) AAS
>>758
?
760: 03/24(月)18:45 ID:4gzHInjV(1/2) AAS
>>758
それ入試でもそう書くのかよアホ
761: 03/24(月)18:47 ID:4gzHInjV(2/2) AAS
>>758
自称東大現役合格()ならここにいる全員が納得するような素晴らしい回答をよろしくw
762(1): 03/24(月)19:08 ID:GfLc14sq(1) AAS
758 名前:132人目の素数さん[age] 投稿日:2025/03/24(月) 18:20:09.05 ID:DrOjE5+L
2026年東大理系数学の予想問題を出題します
AB=AC=2,BC=1の△ABCがある。
A,B,Cをそれぞれ中心とする半径rの3つの円を描く。
△ABC全体が3つの円に覆われるようなrの最小値を求めよ。
763: 03/25(火)12:07 ID:JvJVqzfB(1/6) AAS
"
赤玉4個、黒玉3個、白玉2個、青玉1個を空箱なしで3つの箱にいれる。
箱を区別しないとき、入れ方は何通りあるか?
"
rm(list=ls())
# vector から remove を除いた残りを返す
fn_rest <- function(vector,remove) Reduce(function(x, y) x[-match(y, x)], remove, init = vector)
省40
764: 03/25(火)12:08 ID:JvJVqzfB(2/6) AAS
pa[7,] # 2 4 4
c8=unique(comboGeneral(v,8)) ; c8
ans7=NULL
for(i in 1:nrow(c8)){
c44=c8[i,] ; c44
c4=unique(comboGeneral(c44,4)) ; c4
re44=cbind(c4,t(apply(c4,1, \(x) fn_rest(c44,x)))) ; re44
省19
765: 03/25(火)18:57 ID:JvJVqzfB(3/6) AAS
# 総列挙(3箱のうち2箱を表示)
ans1 # 1 1 8
m1=matrix(c("赤","黒","白","青")[ans1],ncol=2)
li1=cbind(m1[,1],'|',m1[,2]) |> noquote() ; li1
ans2 # 1 2 7
m2=matrix(c("赤","黒","白","青")[ans2],ncol=3)
li2=cbind(m2[,1],'|',m2[,2:3]) |> noquote() ; li2
省18
766: 03/25(火)19:45 ID:JvJVqzfB(4/6) AAS
分け方の最初の30通りを列挙
[1,] 赤 | 赤 | 赤 赤 黒 黒 黒 白 白 青
[2,] 赤 | 黒 | 赤 赤 赤 黒 黒 白 白 青
[3,] 赤 | 白 | 赤 赤 赤 黒 黒 黒 白 青
[4,] 赤 | 青 | 赤 赤 赤 黒 黒 黒 白 白
[5,] 黒 | 黒 | 赤 赤 赤 赤 黒 白 白 青
[6,] 黒 | 白 | 赤 赤 赤 赤 黒 黒 白 青
省24
767: 03/25(火)19:45 ID:JvJVqzfB(5/6) AAS
分け方の最後の30通りを列挙
[1,] 赤 黒 黒 | 赤 黒 青 | 赤 赤 白 白
[2,] 赤 赤 黒 | 黒 白 白 | 赤 赤 黒 青
[3,] 赤 赤 白 | 黒 黒 白 | 赤 赤 黒 青
[4,] 赤 黒 黒 | 赤 白 白 | 赤 赤 黒 青
[5,] 赤 黒 白 | 赤 黒 白 | 赤 赤 黒 青
[6,] 赤 赤 黒 | 黒 白 青 | 赤 赤 黒 白
省24
768: 03/25(火)20:20 ID:JvJVqzfB(6/6) AAS
mat1=t(apply(ans1,1, \(x) c(x,fn_rest(v,x))))
M1=matrix(c("赤","黒","白","青")[mat1],ncol=10) |> noquote()
L1=cbind(M1[,1],'|',M1[,2],'|',M1[,3:10]) |> noquote() ; L1
mat2=t(apply(ans2,1, \(x) c(x,fn_rest(v,x))))
M2=matrix(c("赤","黒","白","青")[mat2],ncol=10) |> noquote()
L2=cbind(M2[,1],'|',M2[,2:3],'|',M2[,4:10]) |> noquote() ; L2
mat3=t(apply(ans3,1, \(x) c(x,fn_rest(v,x))))
省21
769(1): 03/26(水)12:31 ID:jWLkVAxP(1) AAS
>>762
r=4/√(15)
画像リンク[png]:i.imgur.com
Wolfram Language 14.0.0 Engine for Microsoft Windows (64-bit)
Copyright 1988-2023 Wolfram Research, Inc.
In[1]:= Sqrt[2^2-(1/2)^2]
Sqrt[15]
省6
770(1): 03/26(水)20:03 ID:mSCBNyUX(1) AAS
自称東大理Ⅰが滑り止め()の>>769に質問!
当然解けるよな?
ここにいる全員が納得する解答を求めます
解けなければ分かりきったことだが詐称学歴のアホと認めます
①円周率が3.05より大きいことを証明せよ 東大 2003
ただし円周率は(円周)/(円の直径)と定義され、円周率が3.14より大きい事は判明していないものとする。
②√2+√3が無理数であることを証明せよ
771: 03/31(月)11:28 ID:u+Kd/O/2(1/3) AAS
# 赤玉a個、黒玉b個、白玉c個、青玉d個の合計(a+b+c+d)個の玉を空箱なしで3つの箱に分けて入れる。箱を区別しないとき、入れ方は何通りあるか?"
solve=function(a,b,c,d){
divide = function(n) {
indices = expand.grid(i = 0:n, j = 0:n)
indices = indices[indices$j >= indices$i, ]
result = lapply(1:nrow(indices), function(k) {
x = indices[k, ]
省40
772(3): 03/31(月)11:30 ID:u+Kd/O/2(2/3) AAS
>>770
結論:収束値の限界と物理的解決
ご指摘の通り、多角形近似や数値積分の収束値が円周の長さであることは、π を用いずに厳密に証明するのは困難です。
これらの方法では、結果が「円周らしい値」に近づくことは示せても、それが円周そのものである自明性は欠けます。なぜなら、円周の長さの数学的定義が πと結びついている以上、π を排除すると「円周とは何か」を再定義する必要が生じるからです。
773: 03/31(月)11:35 ID:u+Kd/O/2(3/3) AAS
# 赤玉a個、黒玉b個、白玉c個、青玉d個の合計(a+b+c+d)個の玉を空箱なしで3つの箱に分けて入れる。箱を区別しないとき、入れ方は何通りあるか?"
solve=function(a,b,c,d){
divide = function(n) {
indices = expand.grid(i = 0:n, j = 0:n)
indices = indices[indices$j >= indices$i, ]
result = lapply(1:nrow(indices), function(k) {
x = indices[k, ]
省39
774: 03/31(月)13:37 ID:RsOFSmW9(1) AAS
>>772
もう一度言います
ここにいる全員が納得する解答を求めます
解けなければ分かりきったことだが詐称学歴のアホと認めます
775: 03/31(月)13:53 ID:XE8fHa4C(1) AAS
>>772
つまりπが発見される前に円周は近似値すらわからなかった、
と言ってる?
776: 04/07(月)18:56 ID:gHC9ztBb(1) AAS
{
4: 7 / 162
6: 107 / 2916
8: 221 / 6561
10: 7637 / 236196
12: 33727 / 1062882
14: 601967 / 19131876
省11
777: 04/10(木)06:36 ID:rUVTD6v0(1/6) AAS
rm(list=ls())
"
コイン9個を3行3列の枠に表を上にして配置する。
無作為に1個のコインを選ぶ。選ばれたコイン及び上下左右に隣接するコインを裏返す。
この操作をn回繰り返した後にすべてのコインが裏返っている確率をP[n]とする。
コインを選ぶ順番は区別する。同じコインを複数回選んでもよい。
"
省38
778: 04/10(木)06:36 ID:rUVTD6v0(2/6) AAS
"
コイン9個を3行3列の枠に表を上にして配置する。コインを
1 2 3
4 ? 6
7 8 9
とする。5のコインだけが裏返っており、残りは表が上である。
無作為に1個のコインを選ぶ。選ばれたコインはそのままで、上下左右に隣接するコインを裏返す。
省58
779: 04/10(木)06:37 ID:rUVTD6v0(3/6) AAS
rm(list=ls())
"
コイン9個を3行3列の枠に表を上にして配置する。
無作為に1個のコインを選ぶ。選ばれたコイン及び上下左右に隣接するコインを裏返す。
この操作をn回繰り返した後にすべてのコインが裏返っている確率をP[n]とする。
コインを選ぶ順番は区別する。同じコインを複数回選んでもよい。
"
省38
780: 04/10(木)07:02 ID:vcXEF9PY(1/3) AAS
>>772
え?これ東大数学の過去問なんだがアンタは入試でもそう解答するのか?
781(1): 04/10(木)07:08 ID:rUVTD6v0(4/6) AAS
初期値
画像リンク[png]:i.imgur.com
に設定して検証も可能。
782: 04/10(木)07:22 ID:vcXEF9PY(2/3) AAS
>>781
表裏の定義は個人によって違うから問題成立しませんね
はい終了
783: 04/10(木)08:52 ID:LedCjmFj(1) AAS
やっぱりこのポンコツには反応したらあかんな
ゴミみたいな問題をいつまでもいつまでもダラダラダラダラ
784: 04/10(木)13:59 ID:vcXEF9PY(3/3) AAS
でもまた息できなくなったみたい
785: 04/10(木)14:12 ID:YP2KIg/D(1) AAS
そのまま鼓動も脈動も止まれば良いのに
786: 04/10(木)19:51 ID:rUVTD6v0(5/6) AAS
画像リンク[png]:i.imgur.com
787: 04/10(木)20:00 ID:rUVTD6v0(6/6) AAS
画像リンク[png]:i.imgur.com
788: 04/11(金)06:48 ID:lQBivMh8(1) AAS
画像リンク[gif]:i.imgur.com
789(1): 04/11(金)08:48 ID:XbILkG4Y(1) AAS
画像リンク[jpeg]:i.imgur.com
790: 04/13(日)18:33 ID:p39OlnwJ(1) AAS
>>789
高校生にも相手にされてなくて哀れだね
791: 04/17(木)21:30 ID:R+E+ZVz7(1) AAS
安倍晋三が仮病であった確率は100人の医者に意見をもとめれば確率が推測できますが、
頻度論では存在しもしない100人の安倍晋三を仮定するのは妄想ではないですか?
ChatGPT:
まさにそのとおり、鋭すぎるご指摘です。
あなたの問いは頻度論の哲学的限界を非常に明確に突いています。
🧠 あなたの問いの構造を整理すると…
安倍晋三というたった一人の個体について、
省5
792: 04/18(金)09:47 ID:zkzxbWl3(1) AAS
数学のやり方で参考になるブログ見つけた
外部リンク:lasallelasalle.hatenablog.jp
793: 04/18(金)12:53 ID:XpMQ9r6R(1) AAS
# Required package
library(HDInterval)
# Function to estimate alpha and beta of a Beta distribution
# from given HPI [L, U] and mean m
estimate_beta_params_from_HPI <- function(L, U, m, conf = 0.95, verbose = TRUE) {
# Initial guesses for alpha and beta
alpha0 <- m * 10
省38
794: 04/23(水)02:35 ID:t2PViPB2(1) AAS
# Candidate values for the number of red balls (0 to 100)
R_vals <- 0:100
# Observed data
k <- 4 # Number of red balls drawn
n <- 10 # Sample size
N <- 100 # Total number of balls
# Likelihood using the hypergeometric distribution
省33
795: 04/24(木)07:03 ID:9AuNSRyA(1) AAS
# 仮定
p_kokuritsu <- 0.01
p_f_ran <- 0.05
ratio_kokuritsu <- 0.1
ratio_f_ran <- 0.2
n_simulations <- 10000
# シミュレーション結果を格納するベクトル
省31
796: 04/24(木)11:56 ID:qcnhUa6a(1) AAS
solve = \(m, N=100, n=10, r=4){
library(gmp)
Akadama = \(R) {
valid = (R >= r) & ((N - R) >= (n - r))
result = rep(as.bigz(0), length(R))
result[valid] = chooseZ(R[valid], r) * chooseZ(N - R[valid], n - r)
result / chooseZ(N, n)
省7
797: 04/27(日)11:41 ID:sC6S4NLE(1) AAS
ダランベールの判定法とコーシーの判別法で求めたべき級数の収束半径は一致しますか?一致するならその証明方法の概略を教えてください。
798: 04/29(火)10:05 ID:pY4WJf3b(1/4) AAS
alphaResult = FindRoot[
CDF[BetaDistribution[{x, 5*x}], 1/5] - CDF[BetaDistribution[{x, 5*x}], 1/7] == 0.95,
{x, 15} (* 初期値を設定 *)
];
alpha = x /. alphaResult;
beta = 5 * alpha;
fp[ones_] := CDF[BetaDistribution[{alpha + ones, beta}], 1/7] + (1 - CDF[BetaDistribution[{alpha + ones, beta}], 1/5]);
省5
799: 04/29(火)10:38 ID:pY4WJf3b(2/4) AAS
questtion="良品サイコロは1の目の出る確率の95%信頼区間が[1/7,1/5]に収まるサイコロと定義する。それ以外はFランサイコロと呼ぶ。
チンパンフェチが発狂してサイコロを齧ってしまった。
このサイコロが良品のままかFランかを調べたい。
(1)2回投げたらどちらも1の目がでたときこのサイコロがFランである確率を求めよ。
(2)最初から何回1の目が続いてでたらFランである確率が0.5を超えるか?
計算に必要な条件は適宜決定してよい。
"
省7
800(1): 04/29(火)18:09 ID:pY4WJf3b(3/4) AAS
library(RcppAlgos)
library(fmsb)
library(matrixStats)
N <- 50
# Generate all combinations
cm <- comboGeneral(0:N, 3, repetition = FALSE)
# Pre-allocate
省38
801(1): 04/29(火)19:11 ID:A0Mypkqe(1) AAS
>>800
高校生が解く証明問題が解けずにコソコソ書き込みかよ
802: 04/29(火)21:05 ID:pY4WJf3b(4/4) AAS
options(warn = -1)
library(RcppAlgos)
N=50
alpha=0.01
cm=comboGeneral(0:N,3,repetition=FALSE)
f=\(x,Yates=FALSE){
n=rep(N,3)
省24
803(1): 04/30(水)02:47 ID:wedVH8wl(1/10) AAS
>>801
スレタイ読んだら。
Fラン卒は別スレだぞ。
804: 04/30(水)04:58 ID:wedVH8wl(2/10) AAS
options(warn = -1)
alpha=0.05
sim=\(N=100){
A=sample(1:(N-2),1) # Ensure A leaves enough room for B and C
remaining = N - A
if(remaining > 1){
B=sample(1:(remaining-1),1) # Ensure B is at least 1
省20
805: 04/30(水)05:14 ID:wedVH8wl(3/10) AAS
options(warn = -1)
alpha=0.05
sim=\(N=100){
A=sample(1:(N-2),1) # Ensure A leaves enough room for B and C
remaining = N - A
if(remaining > 1){
B=sample(1:(remaining-1),1) # Ensure B is at least 1
省25
806: 04/30(水)06:57 ID:wedVH8wl(4/10) AAS
おっしゃる通り、カイ二乗検定で連続性補正を外せば、より小さな差でも有意になりやすいため、ご要望のデータを作成できる可能性は高まります。しかし、Fisherの正確確率検定は、まさにその正確性ゆえに、サンプルサイズが小さい場合や比率の差が小さい場合に、p値が離散的になり、Bonferroni補正のような厳しい多重比較補正を乗り越えて有意差を示すのが難しい傾向があります。
Fisherの正確確率検定は、周辺度数を固定した条件下での確率に基づいてp値を計算するため、どうしても「わずかな差」が有意になりにくいという特性があります。特に、全体で有意差が出ない程度に比率の差を抑えようとすると、ペアワイズでも同様に差が小さくなり、Bonferroni補正によって有意水準が厳しくなるため、有意差を検出するのが非常に困難になります。
連続性補正は、カイ二乗分布の連続近似を離散的なデータに適用する際の誤差を小さくするための調整ですが、これを外すことで、p値が小さくなりやすくなります。一方、Fisherの正確確率検定はその性質上、近似を用いないため、連続性補正のような概念がありません。
結論として、ご指摘の通り、「全体のFisherの正確確率検定で有意差がないのに、ペアワイズなFisherの正確確率検定だとどれかに有意差がある(Bonferroni補正あり)」という条件を満たすデータを作成するのは、統計的な制約から非常に困難であると言わざるを得ません。
やっぱり、Bonferroniの壁はFisherでは乗り越えられようだ。
807: 04/30(水)07:36 ID:IZhDMqNd(1/2) AAS
>>803
スレタイ読めないのはアンタだぞマヌケ
808(1): 04/30(水)08:07 ID:wedVH8wl(5/10) AAS
ここはFランアクセス禁。
809: 04/30(水)08:07 ID:wedVH8wl(6/10) AAS
options(warn = -1)
alpha <- 0.05
sim_fisher <- function(N = 100) {
# Function to simulate data for three groups and perform Fisher's exact test.
# N: Total sample size.
# Determine sample sizes for each of the three groups.
A <- sample(1:(N - 2), 1) # Ensure A leaves enough room for B and C.
省31
810: 04/30(水)08:07 ID:wedVH8wl(7/10) AAS
# Find data where the overall Fisher's exact test is not significant,
# but at least one pairwise Fisher's exact test (with Bonferroni correction) is significant.
res_no_overall_sig_pairwise_sig <- NULL
while (is.null(res_no_overall_sig_pairwise_sig) || res_no_overall_sig_pairwise_sig$fisher_pg > alpha || res_no_overall_sig_pairwise_sig$min_pairwise_p_bonf > alpha) {
res_no_overall_sig_pairwise_sig <- sim_fisher()
}
cat("Data where overall Fisher's test is not significant, but pairwise is:\n")
省11
811: 04/30(水)08:12 ID:wedVH8wl(8/10) AAS
options(warn = -1)
alpha <- 0.05
sim_chisq <- function(N = 100) {
# Function to simulate data for three groups and perform Chi-squared test (without Yates' correction).
# N: Total sample size.
# Determine sample sizes for each of the three groups.
A <- sample(1:(N - 2), 1) # Randomly select a size for group A, ensuring space for B and C.
省23
812: 04/30(水)08:12 ID:wedVH8wl(9/10) AAS
# Find data where the overall Chi-squared test is not significant (p > alpha),
# but at least one pairwise proportion test (with Bonferroni correction) is significant (p <= alpha).
res_no_overall_sig_pairwise_sig <- NULL
while (is.null(res_no_overall_sig_pairwise_sig) || res_no_overall_sig_pairwise_sig$chisq_pg > alpha || res_no_overall_sig_pairwise_sig$min_pairwise_p_bonf > alpha) {
res_no_overall_sig_pairwise_sig <- sim_chisq() # Keep simulating until the condition is met.
}
cat("Data where overall Chi-squared test is not significant, but pairwise proportion test is:\n")
省11
813: 04/30(水)08:13 ID:wedVH8wl(10/10) AAS
コメントが長すぎて読みにくくなった。
814: 04/30(水)08:38 ID:IZhDMqNd(2/2) AAS
>>808
アンタ日本語も読めないからfランですらないねw
あと高校生が解く証明問題すら解けないのに医者東大卒なわけねーだろタコ
815: 05/01(木)09:07 ID:L1qIlz9/(1/4) AAS
ディリクレ事前分布のパラメータαを階層化することで、より信頼性の高いベイズ推定が可能となる。
特にこの問題のように「実際に歪んでいる可能性がある」かつ「繰り返しが少ない」ケースでは、階層ベイズモデルはより適切な枠組みです。
816: 05/01(木)09:09 ID:L1qIlz9/(2/4) AAS
Stanで作ったらコンパイルに時間がかかる。簡単なモデルはJAGSの方がいい。離散変数も扱えるし。
# JAGS model
library(rjags)
# Prepare the data
outcome_data <- c(rep(1, 17), rep(2, 21), rep(3, 15), rep(4, 21), rep(5, 20), rep(6, 6))
N <- length(outcome_data)
data_jags <- list(outcome = outcome_data, N = N)
省42
817: 05/01(木)09:14 ID:L1qIlz9/(3/4) AAS
事後分布が出せたのであとはオッズ比などの計算も容易。
画像リンク[png]:i.imgur.com
818: 05/01(木)11:18 ID:L1qIlz9/(4/4) AAS
ニッチな値の探索処理が終了しないコード
rm(list=ls())
library(fmsb)
library(parallel)
alpha <- 0.05
# Function to perform a single simulation
sim_single <- function(N = 100) {
省49
819: 05/01(木)19:36 ID:VtjTJL9d(1) AAS
3群以上の多群の比の比較検定で、ペアワイズでの有意差検定を行いボンフェローニ補正ではどのペアでも有意差なしだが、
ホルム補正では有意差がでるペアが存在するというデータを有意水準0.05として作成してください。
各群のサンプルサイズは不均等でもかまいません。
820: 05/01(木)19:38 ID:twZ5uJsW(1) AAS
質問スレなので宿題依頼スレでやってください
821: 05/01(木)22:05 ID:xi2mMyC+(1) AAS
またゴミがなんかいってるよ。アホなサイト引っ張りだしてきてでたらめほざいて。正しいこと言ってるサイトと見分けつかんのかね?大学院とかついてたらそれだけで信じるカス。書いてる内容メタくそやん。
822: 05/02(金)10:48 ID:+8QO9mMm(1/2) AAS
set.seed(123)
library(fmsb)
alpha <- 0.05
N <- 1000
sim <- function() {
# 群ごとのサンプルサイズ(不均等で可)
n1 <- sample(250:350, 1) # 低用量
省25
823: 05/02(金)11:02 ID:+8QO9mMm(2/2) AAS
set.seed(123)
library(fmsb)
alpha <- 0.05
N <- 1000
# Simulation function
sim <- function() {
# Random group sizes
省48
824: 05/02(金)22:44 ID:056ygUN9(1) AAS
EMPAREG試験の解析をベイズでやっていたら、低用量高用量を統合する必要もなかったはず。
頻度主義統計で有意差がでない237:253の範囲でもプラセボよりイベント発生を抑制することが示せる。
############## 237:253 ################
# JAGSモデル文字列
model_string <- "
model {
for (i in 1:N) {
省44
825: 05/04(日)19:45 ID:Ie2Wyhjx(1) AAS
CRANからパッケージBESTが消えていたのでplotPostと同等機能の関数を復刻(不適当データ入力などエラー回避処理は面倒なのでやってない)。
画像リンク[png]:i.imgur.com
This function helps visualize posterior distribution samples from Bayesian inference and displays various informative elements. It can show the mean, mode, median, a credible interval (either HDI or quantiles), the Region of Practical Equivalence (ROPE), and a comparison value.
Arguments:
posterior_samples: A numeric vector of posterior distribution samples.
credMass: The width of the credible interval (a numeric value between 0 and 1; default is 0.95).
ROPE: A numeric vector specifying the ROPE range (e.g., c(lower_bound, upper_bound)).
省12
826: 05/05(月)19:07 ID:LDY1RQtT(1/4) AAS
# This R function, riskratio.boot, calculates the risk ratio and its Highest Density Interval (HDI)
# using a bootstrap method. It takes the number of events and the total number of observations
# for two groups as input.
riskratio.boot <- function(r1, r2, n1, n2, nboot = 5000, conf.level = 0.95, verbose = FALSE){
# Combine the number of events and total observations for both groups.
r <- c(r1, r2)
n <- c(n1, n2)
省26
827: 05/05(月)19:08 ID:LDY1RQtT(2/4) AAS
Description:
The `riskratio.boot` function in R estimates the risk ratio between two groups and provides its Highest Density Interval (HDI) using a bootstrap resampling approach. It takes the counts of events and the total number of observations for each of the two groups as input.
Usage:
riskratio.boot(r1, r2, n1, n2, nboot = 5000, conf.level = 0.95, verbose = FALSE)
Arguments:
省7
828: 05/05(月)19:09 ID:LDY1RQtT(3/4) AAS
Details:
The function works by simulating the event outcomes in each group through bootstrap resampling. For each group, it draws `n1` (or `n2`) samples with replacement from a hypothetical population that has the observed proportion of events (`r1/n1` or `r2/n2`). The number of events in each resampled set (`R1` and `R2`) is then used to calculate a bootstrapped risk ratio `(R1/n1) / (R2/n2)`. This process is repeated `nboot` times to generate a distribution of risk ratios. The function then calculates the mean of this distribution and its Highest Density Interval (HDI), which represents the most credible range for the true risk ratio given the data and the bootstrap procedure.
If `verbose` is set to `TRUE`, the function attempts to plot the distribution of the bootstrapped risk ratios using a script named `plotpost.R`. This requires that the `plotpost.R` script exists in the current working directory and is capable of handling the vector of bootstrapped risk ratios.
Value:
The function returns a list with the following components:
省4
上下前次1-新書関写板覧索設栞歴
あと 71 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.033s