Publications by Ken Kleinman
A third year of entries!
Contrary to previous reports, we started blogging after our book was published, with the conceit that we were adding examples to the book. Today marks the second anniversary of the book’s appearance and of the blog. To celebrate, we’re turning over our calendar, and starting a new volume of entries– Example 9.1 will appear on ...
1966 sym 14 img
Example 9.2: Transparency and bivariate KDE
In Example 9.1, we showed a binning approach to plotting bivariate relationships in a large data set. Here we show more sophisticated approaches: transparent overplotting and formal two-dimensional kernel density estimation. We use the 10,000 simulated bivariate normals shown in Example 9.1.SASIn SAS, transparency can be found in proc sgplot, w...
1717 sym R (286 sym/4 pcs) 22 img
Really useful R package: sas7bdat
For SAS users, one hassle in trying things in R, let alone migrating, is the difficulty of getting data out of SAS and into R. In our book (section 1.2.2) and in a blog entry we’ve covered getting data out of SAS native data sets. Unfortunately, for all of these methods, you need a working, licensed version of SAS. However Matt Sh...
1516 sym R (356 sym/2 pcs) 14 img
Taking August off!
We’ll be back with recharged batteries and lots of new entries in September. Have a great summer*!As usual, please send any questions you have about using SAS or R.*Not valid in the southern hemisphere. Related To leave a comment for the author, please follow the link and comment on their blog: SAS and R. R-bloggers.com offers ...
613 sym 14 img
Example 9.4: New stuff in SAS 9.3– MI FCS
We begin the new academic year with a series of entries exploring new capabilities of SAS 9.3, and some functionality we haven’t previously written about.We’ll begin with multiple imputation. Here, SAS has previously been limited to multivariate normal data or to monotonic missing data patterns.SASSAS 9.3 adds the FCS statement to proc mi. ...
2445 sym Python (948 sym/3 pcs) 14 img
Example 9.5: New stuff in SAS 9.3– proc FMM
Finite mixture models (FMMs) can be used in settings where some unmeasured classification separates the observed data into groups with different exposure/outcome relationships. One familiar example of this is a zero-inflated model, where some observations come from a degenerate distribution with all mass at 0. In that case the exposure/outcome ...
4798 sym R (1472 sym/6 pcs) 18 img
Example 9.6: Model comparison plots (Completed)
We often work in settings where the data set has a lot of missing data– some missingness in the (many) covariates, some in the main exposure of interest, and still more in the outcome. (Nick describes this as “job security for statisticians”).Some analysts are leery of imputing anything at all, preferring to rely on the assumption that the ...
3274 sym R (1651 sym/3 pcs) 18 img
Example 9.7: New stuff in SAS 9.3– Frailty models
Shared frailty models are a way of allowing correlated observations into proportional hazards models. Briefly, instead of l_i(t) = l_0(t)e^(x_iB), we allow l_ij(t) = l_0(t)e^(x_ijB + g_i), where observations j are in clusters i, g_i is typically normal with mean 0, and g_i is uncorrelated with g_i’. The nomenclature frailty comes ...
2731 sym R (1814 sym/5 pcs) 14 img
Example 9.8: New stuff in SAS 9.3– Bayesian random effects models in Proc MCMC
Rounding off our reports on major new developments in SAS 9.3, today we’ll talk about proc mcmc and the random statement.Stand-alone packages for fitting very general Bayesian models using Markov chain Monte Carlo (MCMC) methods have been available for quite some time now. The best known of these are BUGS and its derivatives WinBUGS (last upda...
4394 sym R (1520 sym/4 pcs) 16 img
Example 9.11: Employment plot
A facebook friend posted the picture reproduced above– it makes the case that President Obama has been a successful creator of jobs, and also paints GW Bush as a president who lost jobs. Another friend pointed out that to be fair, all of Bush’s presidency ought to be included. Let’s make a fair plot of job growth and loss. Data can be re...
3807 sym R (1709 sym/5 pcs) 22 img