Exercise 6. Diet data: tabulating incidence rates and modelling with Poisson regression

You may have to install the required packages the first time you use them. You can install a package by install.packages("package_of_interest") for each package you require.

Load the diet data using time-on-study as the timescale.

(b)

Fit a poisson model to find the incidence rate ratio for the high energy group compared to the low energy group and compare the estimate to the one you obtained in the previous question.

## Waiting for profiling to be done...

Also write out the regression equation, defining your notation.

(c)

Grouping the values of total energy into just two groups does not tell us much about how the CHD rate changes with total energy. It is a useful exploratory device, but to look more closely we need to group the total energy into perhaps 3 or 4 groups.

In this example we shall use the cut points 1500, 2500, 3000, 4500. Compare with a normal distribution to check if these cutpoints seem reasonable.

(d)

Create a new variable eng3 coded 1500 for values of energy in the range 1500–2499, 2500 for values in the range 2500–2999, and 3000 for values in the range 3000–4500.

(h)

Use poisson to compare the second and third levels with the first.

Compare your estimates with those you obtained in part 6e. Write the linear predictor using pen and paper.

Also write out the regression equation, defining your notation.

(j)

Repeat the analysis comparing the second and third levels with the first but this time have R create the indicators automatically y using the categorical variable eng3.

(k)

Calculate the total number of events during follow-up, person-time at risk, and the crude incidence rate (per 1000 person-years)