Blog Archives

Example 7.10: Get data from R into SAS

August 13, 2009
By
Example 7.10: Get data from R into SAS

In our previous entry, we described how to generate a dataset from SAS that could be used for analyses in R. Alternatively, someone primarily using R might want to test the new ”statistical graphics” procedures available starting with SAS 9.2. Her...

Read more »

Example 7.9: Get data from SAS into R

August 8, 2009
By
Example 7.9: Get data from SAS into R

Some people use both SAS and R in their daily work. They might be more familiar with SAS as a tool for manipulating data and R preferable for plotting purposes. While our goal in the book is to enable people to avoid having to switch back and forth, ...

Read more »

Example 7.8: Plot two empirical cumulative density functions using available tools

August 1, 2009
By
Example 7.8: Plot two empirical cumulative density functions using available tools

The empirical cumulative density function (CDF) (section 5.1.16) is a useful way to compare distributions between populations. The Kolmogorov-Smirnov (section 2.4.2) statistic D is the value of x with the maximum distance between the two curves. As an...

Read more »

Book now shipping from Amazon

July 27, 2009
By
Book now shipping from Amazon

Amazon now reports that the book is in stock! The current discount is 13%.Or, order from the publisher. If you are an ASA member, you can use the online discount code 634LH to obtain a 15% discount.

Read more »

Example 7.7: Tabulate binomial probabilities

July 25, 2009
By
Example 7.7: Tabulate binomial probabilities

Suppose we wanted to assess the probability P(X=x) for a binomial random variate with n = 10 and with p = .81, .84, ..., .99. This could be helpful, for example, in various game settings. In SAS, we find the probability that X=x using differences in t...

Read more »

Example 7.6: Find Amazon sales rank for a book

July 20, 2009
By
Example 7.6: Find Amazon sales rank for a book

In honor of Amazon's official release date for the book, we offer this blog entry.Both SAS and R can be used to find the Amazon Sales Rank for a book by downloading the desired web page and ferreting out the appropriate line. This code is likely to br...

Read more »

Example 7.5: Replicating a prettier jittered scatterplot

July 15, 2009
By
Example 7.5: Replicating a prettier jittered scatterplot

The scatterplot in section 7.4 is a plot we could use repeatedly. We demonstrate how to create a macro (SAS, section A.8) and a function (R, section B.5) to do it more easily.SAS%macro logiplot(x=x, y=y, data=, jitterwidth=.05, smooth=50);data lp1;set...

Read more »

Example 7.4: A prettier jittered scatterplot

July 2, 2009
By
Example 7.4: A prettier jittered scatterplot

The plot in section 7.3 has some problems. At the very least, the jittered values ought to be between 0 and 1, so the smoothed lines fit better with them. Once again we use the data generated in section 7.2 as an example. For both SAS and R, we use conditioning (section 1.11.2) to make the jitter happen...

Read more »

Example 7.3: Simple jittered scatterplot with smoother for dichotomous outcomes with continuous predictors

June 24, 2009
By
Example 7.3: Simple jittered scatterplot with smoother for dichotomous outcomes with continuous predictors

It's useful to look at scatterplots even when the "y" variable is dichotomous. For example, this can help determine whether categorization or linear assumptions would be more plausible. However, an unmodified scatterplot is less than helpful, since all of the "y" values are either 0 or 1, and are hard to separate visually. Some jittering...

Read more »

Book now discounted 33% at Amazon!

June 24, 2009
By
Book now discounted 33% at Amazon!

Our book, SAS and R: Data Management, Statistical Analysis, and Graphics, is discounted by a full third at Amazon. With free shipping! Also, they claim if it is further discounted before it ships, they'll give you the reduced price.

Read more »