A previous entry (http://sas-and-r.blogspot.com/2017/07/options-for-teaching-r-to-beginners.html) describes an approach to teaching graphics in R that also “get students doing powerful things quickly”, as David Robinson suggested.

In this guest blog entry, Randall Pruim offers an alternative way based on a different formula interface. Here's Randall:

For a number of years I and...

Read more »

Tags: data science, ggformula package, ggplot2 package, graphics, modeling language, mosaic package

Posted in SAS | Comments Off on ggformula: another option for teaching graphics in R to beginners

A recent post pointed us to a great talk that elegantly described how inferences from a trial could be analyzed with a purely resampling-based approach. The talk uses data from a paper that considered the association between beer consumption and mosqu...

Read more »

Tags: do(), mosaic package, Proc Surveyselect, proc transpose, replicate()

Posted in SAS | Comments Off on Example 2014.13: Statistics doesn’t have to be so hard! Resampling in R and SAS

For those of you who teach, or are interested in seeing an illustrated series of analyses, there is a new compendium of files to help describe how to fit models for the extended case studies in the Second Edition of the Statistical Sleuth: A Course in...

Read more »

Tags: mosaic package, Project MOSAIC, Statistical Sleuth, teaching statistics

Posted in SAS | Comments Off on The Statistical Sleuth (second edition) in R

Dynamite plots are a somewhat pejorative term for a graphical display where the height of a bar indicates the mean, and the vertical line on top of it represents the standard deviation (or standard error). These displays are commonly found in many scie...

Read more »

Tags: barchart() function, confidence intervals, graphics, grid.polyline() function, grid.text() function, lattice library, mapply() function, mosaic package

Posted in SAS | Comments Off on Example 9.38: dynamite plots, revisited

A colleague teaching college algebra wrote in the R-sig-teaching list asking for assistance in plotting the solutions to the inequality x^2 - 3 > 0. This type of display is handy in providing a graphical solution to accompany an analytic one. RThe plot...

Read more »

Tags: ladd(), lines(), mosaic package, overlay option, pattern statement, plotFun(), plotting functions, polygon(), shading regions, symbol statement

Posted in SAS | Comments Off on Example 9.22: shading plots and inequalities

Simpson's paradox is always amazing to explain to students. What's bad for one group, and bad for another group is good for everyone, if you just collapse over the grouping variable. Unlike many mathematical paradoxes, this arises in a number of real...

Read more »

Tags: confounding, lurking variables, mosaic package, proc sgplot, proc_r, SAT scores, Simpson's paradox, teacher salaries

Posted in SAS | Comments Off on Example 9.20: visualizing Simpson’s paradox

In a previous entry, as well as section 2.4.3 of the book, we describe how to carry out a 2 group permutation test in SAS as well as with the coin package in R. We demonstrate with comparing the ages of the female and male subjects in the HELP study.I...

Read more »

Tags: HELP data set, mosaic package, permutation test, resampling based inference, shuffle(), shuffle() function

Posted in SAS | Comments Off on Example 9.12: simpler ways to carry out permutation tests

In a previous entry, as well as section 2.4.3 of the book, we describe how to carry out a 2 group permutation test in SAS as well as with the coin package in R. We demonstrate with comparing the ages of the female and male subjects in the HELP study.I...

Read more »

Tags: HELP data set, mosaic package, permutation test, resampling based inference, shuffle(), shuffle() function

Posted in SAS | Comments Off on Example 9.12: simpler ways to carry out permutation tests