Tag: ifelse()

Example 2014.5: Simple mean imputation

We’re both users of multiple imputation for missing data. We believe it is the most practical principled method for incorporating the most information into data analysis. In fact, one of our more successful collaborations is a review of software for …

Example 9.32: Multiple testing simulation

In examples 9.30 and 9.31 we explored corrections for multiple testing and then extracting p-values adjusted by the Benjamini and Hochberg (or FDR) procedure. In this post we’ll develop a simulation to explore the impact of “strong” and “weak” control…

Example 9.29: the perils of for loops

A recent exchange on the R-sig-teaching list featured a discussion of how best to teach new students R. The initial post included an exercise to write a function, that given a n, will draw n rows of a triangle made up of “*”, noting that for a beginne…

Example 8.40: Side-by-side histograms

It’s often useful to compare histograms for some key variable, stratified by levels of some other variable. There are several ways to display something like this. The simplest may be to plot the two histograms in separate panels.SASIn SAS, the most d…

Example 8.40: Side-by-side histograms

It’s often useful to compare histograms for some key variable, stratified by levels of some other variable. There are several ways to display something like this. The simplest may be to plot the two histograms in separate panels.SASIn SAS, the most d…

Example 8.40: Side-by-side histograms

It’s often useful to compare histograms for some key variable, stratified by levels of some other variable. There are several ways to display something like this. The simplest may be to plot the two histograms in separate panels.SASIn SAS, the most d…

Example 8.21: latent class analysis

Latent class analysis is a technique used to classify observations based on patterns of categorical responses. Collins and Lanza’s book,”Latent Class and Latent Transition Analysis,” provides a readable introduction, while the UCLA ATS center has an o…