Message Boards Message Boards

0
|
3996 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

The ratio figures interval

Posted 10 years ago

Hello, I would like to ask:

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"]
Attachments:
POSTED BY: martin martin
2 Replies

Hi,

regarding the question whether 0 is in the interval, would this not work for you?

IntervalMemberQ[Interval[Int], 0.]

Now, if that is what you want then this line might solve your problem:

Tally[IntervalMemberQ[Interval[#], 0.] & /@ Table[MeanCI[RandomChoice[data1, 20]], {i, 1, 100}]]

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."}]

enter image description here

Cheers,

Marco

POSTED BY: Marco Thiel
data1 = RandomReal[NormalDistribution[0, 1], 30];
Needs["HypothesisTesting`"]

data2 = For[i = 1, i < 20, 
  i++, {Print[MeanCI[RandomChoice[data1, 20]]]}]

My job ... :( but i don't know...

POSTED BY: martin martin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract