significance test on R

Hi all,
I have a data set like this one.
What I would like to do is a significance test to see if the number of species in night period is significantly higher than in day period or vice versa

df <- tribble(
  ~period, ~Sp, ~value, 
  'day', 'Atlanticus', 2, 
  'day', 'Olrikii', 1, 
  'night', 'Medius', 5, 
  'day', 'Glacialis', 7, 
  'night', 'Unidentified', 3,
  'day', 'Glacialis', 2, 
  'day', 'Medius', 4, 
  'night', 'Capilatta', 17, 
  'night', 'Olrikii', 1
)

what kind of test can I do and how can I do it ?

Thanks a lot

Two sample t test for difference of means

day <- subset(df, period == "day")
night <- subset(df, period == "night")
t.test(y = day$value, x = night$value, alternative = "greater", var.equal = TRUE)

1 Like

Thanks for your response !
I thought about t.test before but my two sample don't respect the normal distribution, and it's a condition to apply the t.test..
What kind of significance test can I do without the necessity to have a normal distribution ?

Thank you !

You might investigate Wilcoxon Rank Sum Test, but I am not too familiar with it.

1 Like

Ok no problem, thank you very much for your help !

This topic was automatically closed 7 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.