Blog Archives

Example 8.32: The HistData package, sunflower plots, and getting data from R into SAS

March 29, 2011
By
Example 8.32: The HistData package, sunflower plots, and getting data from R into SAS

This entry is mainly a promotion of the fascinating HistData R package. The package, compiled by the psychologist, statistician, and graphics innovator Michael Friendly, contains a number of small data sets of historical interest. These include data ...

Read more »

Example 8.31: Choropleth maps

March 22, 2011
By
Example 8.31: Choropleth maps

In our book, we show a simple example of a map (section 6.4.2) where we read the boundary files as data sets and use SAS and R to plot them. But both SAS and R have complex functionality for using pre-compiled map data. To demonstrate them, we'll sho...

Read more »

Example 8.30: Compare Poisson and negative binomial count models

March 15, 2011
By
Example 8.30:  Compare Poisson and negative binomial count models

How similar can a negative binomial distribution get to a Poisson distribution?When confronted with modeling count data, our first instinct is to use Poisson regression. But in practice, count data is often overdispersed. We can fit the overdispersio...

Read more »

Example 8.29: Risk ratios and odds ratios

March 7, 2011
By
Example 8.29: Risk ratios and odds ratios

When can you safely think of an odds ratio as being similar to a risk ratio?Many people find odds ratios hard to interpret, and thus would prefer to have risk ratios. In response to this, you can find several papers that purport to convert an odds rat...

Read more »

Plug for RStudio: powerful, free, and easy to use interactive development environment for R

February 28, 2011
By
Plug for RStudio: powerful, free, and easy to use interactive development environment for R

(click for a bigger picture)As a longtime SAS user, one obstacle for me in using R professionally has been figuring out a process for saving and testing code across several work sessions and integrating code composition and execution. There are a coup...

Read more »

Example 8.20: Referencing lists of variables, part 2

January 10, 2011
By
Example 8.20: Referencing lists of variables, part 2

In Example 8.19, we discussed how to refer to a group of variables with sequential names, such as varname1, varname2, varname3. This is trivial in SAS and can be done in R as we showed.It's also sometimes useful to refer to all variables which begin w...

Read more »

Example 8.18: A Monte Carlo experiment

December 13, 2010
By
Example 8.18: A Monte Carlo experiment

In recent weeks, we've explored methods to fit logistic regression models when a state of quasi-complete separation exists. We considered Firth's penalized likelihood approach, exact logistic regression, and Bayesian models using Markov chain Monte Ca...

Read more »

Example 8.17: Logistic regression via MCMC

December 6, 2010
By
Example 8.17: Logistic regression via MCMC

In examples 8.15 and 8.16 we considered Firth logistic regression and exact logistic regression as ways around the problem of separation, often encountered in logistic regression. (Re-cap: Separation happens when all the observations in a category sha...

Read more »

Example 8.16: Exact logistic regression

November 30, 2010
By
Example 8.16: Exact logistic regression

In example 8.15, on Firth logistic regression, we mentioned alternative approaches to separation troubles. Here we demonstrate exact logistic regression. The code for this appears in the book (section 4.1.2) but we don't show an example of it there. ...

Read more »

SAS and R joins SAS-x

November 29, 2010
By
SAS and R joins SAS-x

Tal Galili, organizer of the R-bloggers blog aggregator, has opened a new aggregator for people blogging about SAS. If you're unfamiliar with the concept, an aggregator is a single blog which republishes (with permission, in this case) the entries fro...

Read more »