Blog Archives

Using R for Data Management, Statistical Analysis and Graphics soon to start shipping

July 19, 2010
By
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 inte...

Read more »

Second year of entries!

June 28, 2010
By
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 mad...

Read more »

Example 7.41: hazard function plotting

June 14, 2010
By
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....

Read more »

Example 7.40: Nelson-Aalen plotting

June 7, 2010
By
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...

Read more »

Example 7.39: Nelson-Aalen estimate of cumulative hazard

May 31, 2010
By
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 ...

Read more »

Example 7.38: Kaplan-Meier survival estimates

May 24, 2010
By
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 su...

Read more »

Example 7.37: calculation of Hotelling’s T^2

May 17, 2010
By
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 ...

Read more »

Example 7.32: Add reference lines to a plot; fine control of tick marks

April 12, 2010
By
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...

Read more »

Augmented support for complex survey designs in R

March 3, 2010
By
Augmented support for complex survey designs in R

We'll get back to code examples later this week, but wanted to let you know about an R package with updated functionality in the meantime.The appropriate analysis of sample surveys requires incorporation of complex design features, including stratification, clustering, weights, and finite population correction. These can be address in SAS and R for many common models. Section...

Read more »

Example 7.24: Sampling from a pathological distribution

March 1, 2010
By
Example 7.24:  Sampling from a pathological distribution

Evans and Rosenthal consider ways to sample from a distribution with density given by:f(y) = c e^(-y^4)(1+|y|)^3where c is a normalizing constant and y is defined on the whole real line.Use of the probability integral transform (section 1.10.8) is not feasible in this setting, given the complexity of inverting the cumulative density function.The Metropolis--Hastings algorithm is a Markov...

Read more »