Sharks eat blue fish. Yes? Hypothesis testing

Hi there, I was looking for some help if possible.
So, I have a theory that some sharks eat blue fish. I checked 100 sharks. I found out that 30 ate blue fish. 70 did not.

What analysis can I run in RStudio to test this hypothesis and get a p-value (or the null, which I suppose is: no sharks eat blue fish)?

Initially I ran a chi-squared test and got a nice low p-value - 0.00001. But then I got confused... what if 50 sharks had eaten blue fish... now my p-value is 1. Is a chi square test inappropriate here? What can I do to test this simple hypothesis? I have yes/no data for the 100 sharks.

Any info would be really appreciated! Thanks

Not sure how you ran the chi-square test. You might want to show us the code and maybe post your data. (Copy and paste text, not a picture.)

Another approach is a t-test.

Thanks for your reply, the below is my R code. But i suspect i'm wrong trying a chi squared test. Would a one-sample proportion test be better? How might a perform a t test?

n_yes <- 31 # Replace with your actual count of shark that ate blue
n_no <- 72 # Replace with your actual count of shark that didn't eat blue

Create a contingency table

contingency_table <- matrix(c(n_yes, n_no), ncol = 2, byrow = TRUE)

Perform chi-squared test

chisq_result <- chisq.test(contingency_table)

Print the results

print(chisq_result)

any insight or suggestions would be much appreciated!

Two things:

  1. chisq.test checks whether the proportions are equal unless you tell it different. That's not what you want.

  2. If the null is that no sharks eat bluefish and you observe a shark eating bluefish (which you do), then you can reject the null with absolute certainty without doing any statistics. :grinning:

Yes i absolutely appreciate that! :grinning: It would just be so nice to have a p number or some such to state they are doing so significantly, rather than just a percent or fraction.

thanks for the chi.test info, i am only appreciating that now. So, as I cant say what proportions i care about, a chi.test is not what i want to be using here at all then.

The p-value is zero.

If the probability of a shark snacking on bluefish is zero, then you will never see a shark eat a bluefish. Since you do...

ha, yes, that is fair enough. Thanks for your input, much appreciated

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.