Tag: sapply()

Example 2014.1: "Power" for a binomial probability, plus: News!

Hello, folks! I’m pleased to report that Nick and I have turned in the manuscript for the second edition of SAS and R: Data Management, Statistical Analysis, and Graphics. It should be available this summer. New material includes some of our more po…

Example 9.21: The birthday "problem" re-examined

The so-called birthday paradox or birthday problem is simply the counter-intutitive discovery that the probability of (at least) two people in a group sharing a birthday goes up surprisingly fast as the group size increases. If the group is only 23 peo…

Example 8.26: reading data with variable number of words in a field

A student came with a question about how to snag data from a PDF report for analysis. Once she’d copied things her text file looked like:1 Las Vegas, NV — 53.3 — — 12 Sacramento, CA — 42.3 — — 23 Miami, FL — 41.8 — — 34 Tucson, AZ –…

Example 8.18: A Monte Carlo experiment

In recent weeks, we’ve explored methods to fit logistic regression models when a state of quasi-complete separation exists. We considered Firth’s penalized likelihood approach, exact logistic regression, and Bayesian models using Markov chain Monte Ca…