Blog Archives

RStudio in the cloud for dummies, 2014/2015 edition

December 2, 2014
By
RStudio in the cloud for dummies, 2014/2015 edition

In 2012, we presented a post showing how to run RStudio in the cloud on an Amazon server. There were 7 steps, including one with 7 sub-steps, one of which had 6 sub-sub-steps. It was still pretty easy, for what it was-- an effectively free computer i...

Read more »

Example 2014.12: Changing repeated measures data from wide to narrow format

October 21, 2014
By
Example 2014.12: Changing repeated measures data from wide to narrow format

Data with repeated measures often come to us in the "wide" format, as shown below for the HELP data set we use in our book. Here we show just an ID, the CESD depression measure from four follow-up assessments, plus the baseline CESD. Obs ID CESD...

Read more »

Example 2014.11: Contrasts the basic way for R

September 30, 2014
By
Example 2014.11: Contrasts the basic way for R

As we discuss in section 6.1.4 of the second edition, R and SAS handle categorical variables and their parameterization in models quite differently. SAS treats them on a procedure-by-procedure basis, which leads to some odd differences in capabilities...

Read more »

Example 2014.10: Panel by a continuous variable

August 18, 2014
By
Example 2014.10: Panel by a continuous variable

In Example 8.40, side-by-side histograms, we showed how to generate histograms for some continuous variable, for each level of a categorical variable in a data set. An anonymous reader asked how we would do this if both the variables were continuous. ...

Read more »

Example 2014.9: Rolling averages. Also: Second Edition is shipping!

August 11, 2014
By
Example 2014.9: Rolling averages.  Also: Second Edition is shipping!

As of today, the second edition of "SAS and R: Data Management, Statistical Analysis, and Graphics" is shipping from CRC Press, Amazon, and other booksellers. There are lots of additional examples from this blog, new organization, and other features ...

Read more »

Example 2014.8: Estimate power for an interaction, by simulation

June 30, 2014
By
Example 2014.8: Estimate power for an interaction, by simulation

In our last entry, we demonstrated how to simulate data from a logistic regression with an interaction between a dichotomous and a continuous covariate. In this entry we show how to use the simulation to estimate the power to detect that interaction. ...

Read more »

Example 2014.7: Simulate logistic regression with an interaction

June 24, 2014
By
Example 2014.7: Simulate logistic regression with an interaction

Reader Annisa Mike asked in a comment on an early post about power calculation for logistic regression with an interaction. This is a topic that has come up with increasing frequency in grant proposals and article submissions. We'll begin by showing ...

Read more »

Example 2014.6: Comparing medians and the Wilcoxon rank-sum test

June 12, 2014
By
Example 2014.6: Comparing medians and the Wilcoxon rank-sum test

A colleague recently contacted us with the following question: "My outcome is skewed-- how can I compare medians across multiple categories?" What they were asking for was a generalization of the Wilcoxon rank-sum test (also known as the Mann-Whitney...

Read more »

Example 2014.5: Simple mean imputation

April 25, 2014
By
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 ...

Read more »

Example 2014.4: Hilbert Matrix

April 14, 2014
By
Example 2014.4: Hilbert Matrix

Rick Wicklin showed how to make a Hilbert matrix in SAS/IML. Rick has a nice discussion of these matrices and why they might be interesting; the value of H_{r,c} is 1/(r+c-1). We show how to make this matrix in the data step and in R. We also show t...

Read more »


Subscribe

Email:

  Subscribe