Publications by Nick Horton
Example 7.32: Add reference lines to a plot; fine control of tick marks
Sometimes it’s useful to plot regular reference lines along with the data. For a time-series plot, this can show when critical values are reached in a clearer way than simple tick marks.As an example, we revisit the empirical CDF plot shown in Example 7.11. If you missed that entry, the data can be downloaded so you can easily exp...
803 sym 2 img
Example 7.37: calculation of Hotelling’s T^2
Hotelling’s T^2 is a multivariate statistic used to compare two groups, where multiple outcomes are observed for each subject. Here we demonstrate how to calculate Hotelling’s T^2 using R and SAS, and test the code using a simulation study then apply it to data from the HELP study.RWe utilize an approach suggested by Peter Mandev...
802 sym 2 img
Example 7.38: Kaplan-Meier survival estimates
In example 7.30 we demonstrated how to simulate data from a Cox proportional hazards model.In this and the next few entries, we expand upon support in R and SAS for survival (time-to-event) models. We’ll start with a small, artificial dataset of 19 subjects. Each subject contributes a pair of variables: the time and an indicator o...
800 sym 2 img
Example 7.39: Nelson-Aalen estimate of cumulative hazard
In our previous example, we demonstrated how to calculate the Kaplan-Meier estimate of the survival function for time to event data. A related quantity is the Nelson-Aalen estimate of cumulative hazard. In addition to summarizing the hazard incurred by a particular timepoint, this quantity has been used in missing data models (see W...
801 sym 2 img
Example 7.40: Nelson-Aalen plotting
In our previous entry, we described how to calculate the Nelson-Aalen estimate of cumulative hazard. In this entry, we display the estimates for the time to linkage to primary care for both the treatment and control groups in the HELP study.RWe use the previously defined function, after removing missing values and sorting by the time ...
803 sym 2 img
Example 7.41: hazard function plotting
As we continue with our series on survival analysis, we demonstrate how to plot estimated (smoothed) hazard functions. RWe will utilize the routines available in the muhaz package. Background information on the methods can be found in K.R. Hess, D.M. Serachitopol and B.W. Brown Hazard Function Estimators: A Simulation Study, Statist...
802 sym 2 img
Second year of entries!
Hello, readers new and old!We started adding examples a year ago, in advance of the book’s publication. To mark the occasion, we’re closing chapter 7 and starting chapter 8 next week. We’ve crafted a listing of all entries from the first year and made this available here.For those wanting to keep score at home, the five entrie...
802 sym 2 img
Using R for Data Management, Statistical Analysis and Graphics soon to start shipping
Our newest book, Using R for Data Management, Statistical Analysis and Graphics, is anticipated to soon start shipping from Amazon, CRC Press, and other fine retailers. The book complements our existing SAS and R book, particularly for users less interested in SAS. It presents an easy way to learn how to perform an analytical task i...
795 sym 2 img
Using SAS for Data Management, Statistical Analysis, and Graphics
Our newest book, Using SAS for Data Management, Statistical Analysis and Graphics, will soon be shipping from Amazon, CRC Press, and other fine retailers. The book complements our SAS and R book, particularly for users less interested in R. It presents an easy way to learn how to perform analytical tasks in SAS, without having to na...
799 sym 2 img
Example 8.3: pyramid plots
Pyramid plots are a common way to display the distribution of age groups in a human population. The percentages of people within a given age category are arranged in a barplot, often back to back. Such displays can be used distinguish males vs. females, differences between two different countries or the distribution of age at differ...
802 sym 2 img