Ange-Régis data analysis

Set my working directory
setwd("C:/Users/ANGE/Documents")

Task 1: Gene versus Sex

Data sex
data_sex = matrix(c(12, 9, 17, 2), 2, 2,
           dimnames = list(c("Female", "Male"), 
                           c("GenXpert_Oui","GenXpert_Non")))

data_sex
##        GenXpert_Oui GenXpert_Non
## Female           12           17
## Male              9            2

Chi-square test

chisq.test(data_sex)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  data_sex
## X-squared = 3.7338, df = 1, p-value = 0.05332

Fisher Test

fisher.test(data_sex)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  data_sex
## p-value = 0.03406
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.01472235 0.99752173
## sample estimates:
## odds ratio 
##  0.1642988

Task 2: Gene versus Race

Data race
data_race = matrix(c(6, 1, 19, 1, 2 ,11), 3, 2,
              dimnames = list(c("Azawak", "Borgou", "White Fulani"), 
                              c("GenXpert_Oui","GenXpert_Non")))

data_race
##              GenXpert_Oui GenXpert_Non
## Azawak                  6            1
## Borgou                  1            2
## White Fulani           19           11

Fisher test

fisher.test(data_race)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  data_race
## p-value = 0.2658
## alternative hypothesis: two.sided

Task 3: Gene versus age

Data age
data_age = matrix(c(3, 6, 8, 9, 1 , 6, 3, 4), 4, 2,
              dimnames = list(c("Three years old", "Four years old", "Five years old", "Six years old"), 
                              c("GenXpert_Oui","GenXpert_Non")))

data_age
##                 GenXpert_Oui GenXpert_Non
## Three years old            3            1
## Four years old             6            6
## Five years old             8            3
## Six years old              9            4

Fisher test

fisher.test(data_age)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  data_age
## p-value = 0.6812
## alternative hypothesis: two.sided

Comments

p value > = 0.05, association could not be established

In case of significant association, odds ratio are diplayed as well as confidence interval

Good luck bro...