I have an interval. I know if zero is in the interval. I but only one interval. I want 100 intervals. For everyone I know if zero is in the interval or not … I need this result:
For example:
Zero is in the interval: 54
Zero is not in the interval 46
Thank you for the advice
data = RandomReal[NormalDistribution[0, 1], 100];
Needs["HypothesisTesting`"]
Int = MeanCI[data]
Int1 = Int[[1]]
Int2 = Int[[2]]
If[Int1*Int2 >= 0, "Null is not in interval", "Null is in interval"]
The false counts the cases that 0 is not in the interval and true the cases when it is in the interval. If you want sentences rather then True and false, this might help:
TableForm[Tally[IntervalMemberQ[Interval[#], 0.] & /@ Table[MeanCI[RandomChoice[data1, 20]], {i, 1, 100}]] /. {True -> "Zero is in the interval.", False -> "Zero is not in the interval."}]