Blog Archives

Example 7.36: Propensity score stratification

May 10, 2010
By
Example 7.36: Propensity score stratification

In examples 7.34 and 7.35 we described methods using propensity scores to account for possible confounding factors in an observational study.In addition to adjusting for the propensity score in a multiple regression and matching on the propensity score...

Read more »

Example 7.35: Propensity score matching

May 3, 2010
By
Example 7.35: Propensity score matching

As discussed in example 7.34, it's sometimes preferable to match on propensity scores, rather than adjust for them as a covariate.SASWe use a suite of macros written by Jon Kosanke and Erik Bergstralh at the Mayo Clinic. The dist macro calculates the ...

Read more »

Example 7.34: Propensity scores and causal inference from observational studies

April 26, 2010
By
Example 7.34: Propensity scores and causal inference from observational studies

Propensity scores can be used to help make causal interpretation of observational data more plausible, by adjusting for other factors that may responsible for differences between groups. Heuristically, we estimate the probability of exposure, rather t...

Read more »

Example 7.33: Specifying fonts in graphics

April 19, 2010
By
Example 7.33: Specifying fonts in graphics

For interactive data analysis, the default fonts used by SAS and R are acceptable, if not beautiful. However, for publication, it may be important to manipulate the fonts. For example, it would be desirable for the fonts in legends, axis labels, or o...

Read more »

Example 7.31: Contour plot of BMI by weight and height

April 5, 2010
By
Example 7.31: Contour plot of BMI by weight and height

A contour plot is a simple way to plot a surface in two dimensions. Lines with a constant Z value are plotted on the X-Y plane.Typical uses include weather maps displaying "isobars" (lines of constant pressure), and maps displaying lines of constant e...

Read more »

Example 7.30: Simulate censored survival data

March 30, 2010
By
Example 7.30: Simulate censored survival data

To simulate survival data with censoring, we need to model the hazard functions for both time to event and time to censoring. We simulate both event times from a Weibull distribution with a scale parameter of 1 (this is equivalent to an exponential ra...

Read more »

Example 7.29: Bubble plots colored by a fourth variable

March 27, 2010
By
Example 7.29: Bubble plots colored by a fourth variable

In Example 7.28, we generated a bubble plot showing the relationship among CESD, age, and number of drinks, for women. An anonymous commenter asked whether it would be possible to color the circles according to gender. In the comments, we showed simp...

Read more »

Example 7.28: Bubble plots

March 22, 2010
By
Example 7.28: Bubble plots

A bubble plot is a means of displaying 3 variables in a scatterplot. The z dimension is presented in the size of the plot symbol, typically a circle. The area or radius of the circle plotted is proportional to the value of the third variable. This c...

Read more »

Example 7.27: probability question reconsidered

March 15, 2010
By
Example 7.27: probability question reconsidered

In Example 7.26, we considered a problem, from the xkcd blog:Suppose I choose two (different) real numbers, by any process I choose. Then I select one at random (p= .5) to show Nick. Nick must guess whether the other is smaller or larger. Being righ...

Read more »

Example 7.26: probability question

March 8, 2010
By
Example 7.26: probability question

Here's a surprising problem, from the xkcd blog.Suppose I choose two (different) real numbers, by any process I choose. Then I select one at random (p= .5) to show Nick. Nick must guess whether the other is smaller or larger. Being right 50% of the ...

Read more »