The male:female ratio of CRB caught in cross-vane bucket traps baited with oryctalure (Chemtica) on Guam is significantly different from 1:1. More females are caught than males.
import pandas
import pymysql
%load_ext rmagic
db = pymysql.connect(host='mysql.guaminsects.net',
user='readonlyguest',
passwd='readonlypassword',
database='oryctes')
sql = "SELECT SUM(male_count) AS males, SUM(female_count) AS females FROM trap_visit"
df = pandas.read_sql(sql, db)
df
males | females | |
---|---|---|
0 | 7044 | 8616 |
x = df['males'][0]
n = df['males'][0] + df['females'][0]
p = 0.5
%R -i x
%R -i n
%R -i p
%R result = binom.test(x, n, p)
%R print(result)
Exact binomial test data: x and n number of successes = 7044, number of trials = 15660, p-value < 2.2e-16 alternative hypothesis: true probability of success is not equal to 0.5 95 percent confidence interval: 0.4419949 0.4576406 sample estimates: probability of success 0.4498084
A PDF copy of this notebook can be generated using the following command:
ipython nbconvert CRB-sex-ratio.ipynb --to latex --post PDF