Complete The Worksheet Using Rstudio

#Q1

prop.test(c(8609,7796), c(368490,348250))

# Q2

library(epitools)

ods <- matrix(c(22,24,1,23), nrow = 2, byrow = T)

oddsratio.fisher(ods, conf.level = 0.99)

fisher.test(ods, conf.level = 0.99)

22/46

# Q3

q3 <- matrix(c(28,13,7,27), nrow = 2, byrow = T)

mcnemar.test(q3)

# Q4

a = -10.85

b = 0.0058

odds4 <- exp(a + b*2000)

odds4

prob4 <- exp(a + b*1500)/(1+exp(a + b*1500))

prob4

odsratio = exp(a + b*2500)/exp(a + b*2000)

# Q5

q5<- matrix(c(21,12,0,0,4,17,1,0,3,9,15,2,0,0,0,1), nrow = 4, byrow = T)

library(psych)

ob = cohen.kappa(q5)

ob$kappa/sqrt(ob$var.kappa)

1 – pnorm(ob$kappa/sqrt(ob$var.kappa))

sqrt(ob$var.kappa)

# Q6

dat_q6 <- read.csv(“dat_q6.csv”)

attach(dat_q6)

library(nnet)

multinom()

Share this post

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on whatsapp
WhatsApp

Related posts

Keep in touch with the trends