For this lab, you will use R Markdown and knitr
to recreate this report. Your lab only needs to include the header (above this paragraph) and the numbered sections below starting with Introduction. You will need the diabetes
dataset from lab 8 and the tab_diab
object from Homework 1.
Instructions:
knitr
options and load all the packages you need.diabetes.csv
and read the chunks for the two external files exfile1.R
and exfile2.R
.exfile1.R
and exfile2.R
to bring in the chunks corresponding to the Tables and Figure. Note: you should not have any R code written in this file in the Tables and Figure section.exfile1.R
, I’ve created an R object called cat1
. Use in-line text to include this picture in the output file.The diabetes
dataset has 403 observations and 20 variables. In this report, we create:
A table displaying means and number of observations for the diabetes dataset as in Homework 1.
A table displaying the odds ratios for the diabetes dataset as in Lab 8.
A plot displaying the odds ratios from Table 2 and corresponding 95% confidence intervals.
Variable | Mean | N_diabetic | Mean_diabetic | N_not_diabetic |
---|---|---|---|---|
chol | 207.85 | 60 | 228.60 | 329 |
hdl | 50.45 | 60 | 45.28 | 329 |
age | 46.85 | 60 | 58.40 | 330 |
height | 66.02 | 59 | 66.17 | 326 |
weight | 177.59 | 59 | 192.71 | 330 |
Variable | OR | p-value | LB | UB |
---|---|---|---|---|
chol | 1.01 | 0.00 | 1.00 | 1.02 |
hdl | 0.98 | 0.02 | 0.96 | 1.00 |
age | 1.06 | 0.00 | 1.04 | 1.08 |
weight | 1.01 | 0.01 | 1.00 | 1.02 |
height | 1.01 | 0.77 | 0.93 | 1.10 |
Figure 1. Associations between covariates and diabetes