我需要为每个学校进行一次费舍尔测试

时间:2019-05-25 15:23:14

标签: loops testing

我的目标是为我的每所学校进行一次渔夫测试,并存储分配的p值。考虑到与渔民测试工作区相关的问题,我运行了一个模拟pvalue。我的问题在循环中(我想是这样),因为我每所学校的最终p值都相同。我认为我的代码不正确,导致总体估计的p值。我在循环中做错了什么,但是呢?你能给我一些反馈吗?

`getwd()
setwd("C:/Users/User/Desktop/Test_Fisher")
mydata <- read.csv("C:/Users/User/Desktop/Test_Fisher/test.csv", header = TRUE)

fishert <- numeric()
for (id_scuola in 1:5000) 
fishert[id_scuola] <- fisher.test(mydata$g8_ethnic_rec, mydata$id_classe_test, simulate.p.value = TRUE, B = 1000)$p.value

print(fishert)`

我没有错误,但请看下面的打印内容。我很少去上学。每个学校的p值都相同。

[501] 0.000999001 0.000999001 0.000999001 0.000999001 0.000999001 0.000999001 0.000999001 0.000999001 0.000999001 0.000999001

0 个答案:

没有答案
相关问题