My statistics sucks these days, can someone help? #asknostr

If I have 25 heifers, how many do I need to randomly test (sample) initially to confirm at least 50% are pregnant? I want to be 75% confident in my result.

I will empty my wallet into your zaps if you can help me.

I built a tool for this in college (can't find it) for a mortgage company to streamline internal auditing of underwriting files. These numbers are wrong, but the way it worked was if they pulled and audited 5 files randomly out of 100 and all of them passed, they'd have x% confidence that y files are compliant. However if they found 1 of the 5 to fail, that confidence would be lower, so the tool would say "randomly pull another 10 files and test if you want to try get back to that confidence" and then repeat until you get the numbers you want or have tested all files.

Reply to this note

Please Login to reply.

Discussion

This is what the AI just spit out.

To determine the sample size needed to confirm at least 50% of the heifers are pregnant with a 75% confidence level, you can use a formula for calculating sample size for proportions in a finite population.

The formula is:

n = [Z^2 * P(1-P) * N] / [(N-1) * MOE^2 + Z^2 * P(1-P)]

where:

n = sample size

Z = Z-score corresponding to the desired confidence level (for 75% confidence level, Z ≈ 1.15)

P = estimated proportion (0.5 for 50%)

N = population size (25 heifers)

MOE = margin of error

Assuming a margin of error of 0.05 (5%), you can plug in the values:

n = [(1.15)^2 * 0.5 (1-0.5) * 25] / [(25-1) * 0.05^2 + (1.15)^2 * 0.5 (1-0.5)]

n = 2.56 / (24 * 0.0025 + 1.56)

n = 2.56 / (0.06 + 1.56)

n ≈ 2.56 / 1.62

n ≈ 1.58

Therefore, you would need to initially test at least 2 heifers to confirm with 75% confidence that at least 50% of the 25 heifers are pregnant.

Yes and this is a dumb way to go about it, because a sample size of 2 is too small & 75% confidence leaves too big of an error.

You'd want to bump that confidence interval to 90-95% & test at least 5.

What did you prompt with? Can you ask again for the same thing with 90 or 95% confidence?

I just plugged in your initial question then changed the 75% to 95%. I have no clue on validity of the info but this is for 95%.

To determine the sample size needed to confirm at least 50% of the heifers are pregnant with a 95% confidence level, you can use the formula for calculating sample size for proportions in a finite population:

n = [Z^2 * P(1-P) * N] / [(N-1) * MOE^2 + Z^2 * P(1-P)]

where:

n = sample size

Z = Z-score corresponding to the desired confidence level (for 95% confidence level, Z ≈ 1.96)

P = estimated proportion (0.5 for 50%)

N = population size (25 heifers)

MOE = margin of error (let's use 0.05)

Plugging in the values:

n = [(1.96)^2 * 0.5 * (1-0.5) * 25] / [(25-1) * 0.05^2 + (1.96)^2 * 0.5 * (1-0.5)]

n = 3.8416 * 0.5 * 0.5 * 25 / (24 * 0.0025 + 3.8416 * 0.5 * 0.5)

n = 2.401 * 25 / (0.06 + 2.401)

n = 60.025 / 0.060025

n ≈ 24.996

Therefore, you would need to initially test at least 25 heifers to confirm with 95% confidence that at least 50% of the 25 heifers are pregnant. Since you cannot test a fraction of a heifer, rounding up to the nearest whole number means you should test at least 25 heifers.