Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.
From the calculator above: If N=7 and p=0.3 you will get exactly 5 successes 2.5% of the time.
If N=8 and p=0.3 you will get exactly 5 successes 4.6% of the time.
If N=30 and p=0.3 you will get 4 or fewer successes 3.0% of the time.
So I think the range of N you need for 95% confidence is 7 to 30.
Function SolveForAlpha(r As Integer, p As Double, alpha As Double) As Integer
Dim q As Integer
'lowest test n we can have is r
q = r
Do Until probGE(q, r, p) >= alpha
q = q + 1
Loop
SolveForAlpha = q
End Function
Function probGE(n As Integer, r As Integer, p As Double) As Double
Dim c As Integer
For c = r To n
probGE = probGE + prob(n, c, p)
Next
End Function
Function prob(n As Integer, r As Integer, p As Double) As Double
prob = p ^ r * (1 - p) ^ (n - r) * nCr(n, r)
End Function
Function nCr(n As Integer, r As Integer) As Double
Dim c As Integer
nCr = fact(n) / fact(r) / fact(n - r)
End Function
Function fact(ByVal n As Integer) As Double
If n <= 0 Then
fact = 1
Else
fact = fact(n - 1) * n
End If
End Function
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Locating peaks of a graph in Excel | 9 | 62 | |
Probability Distribution | 8 | 61 | |
Best prediction based on two lists of numbers in excel | 2 | 40 | |
Pre-Linear Regression Tests | 2 | 13 |
Join the community of 500,000 technology professionals and ask your questions.