Advertisement
Guest User

Q4Hw3

a guest
Jan 22nd, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. # Q4
  2.  
  3. ## (a)
  4. This is a retrospective study as the women were surveyed as to whether they used prenatal vitamins 3 months before pregnancy once their children were 24-60 months old, and they were not randomly divided into taking the vitamins
  5.  
  6. ## (b)
  7.  
  8. This is false as our data came from surveys of mother's of children with autism and those with normal development and so we cannot estimate what is the rate of autism in the population of mothers who used prenatal vitamins
  9.  
  10. ## (c)
  11.  
  12. This is fase as our data came from surveys of mother's of children with autism and those with normal development and so we cannot estimate what is the relative risk of autism in the population of mothers who used prenatal vitamins compared to those who did not use them
  13.  
  14. ## (d)
  15.  
  16. ```{r}
  17. OddsRatio = ((143/253)/(111/254))/((159/229)/(70/229))
  18. OddsRatio
  19. ```
  20.  
  21. ## (e)
  22. ```{r}
  23. LogOddsRatio <- log(OddsRatio)
  24. z <- 1.96
  25. e <-exp(1)
  26. FourEOddsRatioSE <- sqrt((1/143)+(1/111)+(1/159)+(1/70))
  27. FourELogCI <- c(LogOddsRatio - z*FourEOddsRatioSE, LogOddsRatio + z*FourEOddsRatioSE)
  28. FourEAntiLogCI <- c(e^FourELogCI)
  29. FourEAntiLogCI
  30. ```
  31. Since our confidence interval is (0.3914,0.8284) then the null hypothesis that the odds ratio for women with children with autism and took prenatal vitamins compared to women with children without autism being 1 and thus the odds being equal is false as 1 does not appear in our CI and so the null hypothesis would be rejected at the .05 alpha level
  32.  
  33. ## (f)
  34. This is true that the odds of having a child with autism for women who used prenatal vitamins is 56.7% the odds of having a child with autism for women who did not as this can be estimated by the 2 way table due to the fact that odds ratio is symmetric across zero and so the rows and coloumns can be switched
  35.  
  36. ## (g)
  37.  
  38. ```{r}
  39. RelativeRisk <- (143/302)/(111/181)
  40. LogRelativeRisk <- log(RelativeRisk)
  41. RelativeRiskSE <- sqrt((159/(143*302))+(70/(111*181)))
  42. LogRelativeRiskCI <- c(LogRelativeRisk-z*RelativeRiskSE, LogRelativeRisk + z*RelativeRiskSE)
  43. RelativeRiskCI <- c(e^LogRelativeRiskCI)
  44. RelativeRiskCI
  45. ```
  46. Since our confidence interval is (0.6541,0.9115) then the null hypothesis that the relative risk of having a child with autism for women who took prenatal vitamins compared to women who did not take prenatal vitamins being 1 is false since 1 is not in our 95% CI and so the null hypothesis of the relative risk being equal would be rejected at the .05 alpha level
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement