Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何为Fisher'尝试不同的效果尺寸;什么是精确测试?_R_Simulation_Inference_Hypothesis Test - Fatal编程技术网

如何为Fisher'尝试不同的效果尺寸;什么是精确测试?

如何为Fisher'尝试不同的效果尺寸;什么是精确测试?,r,simulation,inference,hypothesis-test,R,Simulation,Inference,Hypothesis Test,我目前正在进行模拟,我想看看如果效果大小不同会发生什么。如何使用当前代码测试Fisher精确测试的不同效果大小 # p1<-response in controls # p2<-response in treated # Generating random deviates from a Uniform(0,1) distribution control.year1<-(runif(16, min = 0, max = 1)) treat.year1<

我目前正在进行模拟,我想看看如果效果大小不同会发生什么。如何使用当前代码测试Fisher精确测试的不同效果大小

  # p1<-response in controls
  # p2<-response in treated
  # Generating random deviates from a Uniform(0,1) distribution
  control.year1<-(runif(16, min = 0, max = 1))
  treat.year1<-(runif(16, min = 0, max = 1))

  #Generating dichotomous response variables for each group
  control.respond1<-ifelse(control.year1<=0.05,1,0)
  treat.respond1<-ifelse(treat.year1<=0.30,1,0)

  #Summing number of responses from each group
  control.no1<-sum(control.respond1==0)
  control.yes1<-sum(control.respond1==1)
  treat.no1<-sum(treat.respond1==0)
  treat.yes1<-sum(treat.respond1==1)

  #Perform the Fisher's exact test (one sided) with p<=0.01
  fisher<-
  matrix(c(control.no1,control.yes1,treat.no1,treat.yes1),nrow=2,ncol=2)
   f<-fisher.test(fisher,alternative = "greater") 

#p1问题可能更适合于@Dave2e is提到的“交叉验证”站点链接到该站点。@Dave2e谢谢,我将在那里发布。