Articles by PirateGrunt

Makefiles and RMarkdown

March 28, 2015 | 0 Comments

Quite some time ago (October 2013, according to Amazon), I bought a copy of “Reproducible Research with R and RStudio” by Christopher Gandrud. And it was awesome. Since then, I’ve been using knitr and RMarkdown quite a lot. However, until recently, I never bothered with a makefile. At the time, ... [Read more...]

Visualizing the History of Epidemics

October 27, 2014 | 0 Comments

I really like National Geographic. Their magazine is great, their television documentaries are done well and they helped give me a lifelong love of maps. They generate very good information and help shed light on the world we all share. So why is this graphic so awful? Let's have a ... [Read more...]

An Idiot Learns Bayesian Analysis: Part 3

August 9, 2014 | 0 Comments

A week or so ago, the grand Magus over at published a great, quick thought exercise taken from Daniel Kahneman’s book Thinking, Fast and Slow. Here are the particulars of the problem: you’re in a community with two different color vehicles; 85% are green and 15% are ... [Read more...]

Stuff I’ve gotten horribly wrong

June 5, 2014 | 0 Comments

I'm the first (I hope) to admit when I've gotten something wrong. I like to think I'm humble enough to realize that there are limits to my knowledge. Actually, humility doesn't enter into it. Every day I'm confronted with things that I don't know or understand. Those same limits can ... [Read more...]

Recursive assignment

June 2, 2014 | 0 Comments

Here’s yet another example where I just need to read the help files. Before I go on, I should add my own notion as to why that’s not always easy to do. On loads of message boards, you’ll see people say- correctly- that the documentation is very ... [Read more...]

Another skewed normal distribution

February 8, 2014 | 0 Comments

At the CLRS last year, Glenn Meyers talked about something very near to my heart: a skewed normal distribution. In loss reserving (and I'm sure, many other contexts) standard linear regression is less than ideal as it presumes that deviations from the mean are equally distributed. We rarely expect this ... [Read more...]

An idiot learns Bayesian analysis: Part 2

February 1, 2014 | 0 Comments

A week ago, I wrote a bit about my personal journey to come to grips with Bayesian inference. I referred to the epiphany that when we're talking about Bayesian analysis, what we're talking about- in a tangible way- is using and modifying multivariate distributions. This reminds me of the moment, ... [Read more...]

An idiot learns Bayesian analysis: Part 1

January 25, 2014 | 0 Comments

I've done a dreadful job of reading The Theory That Would Not Die, but several weeks ago I somehow managed to read the appendix. Here the author gives a short explanation of Bayes' theorem using statistics related to breast cancer and mammogram results. This is the same real world example (... [Read more...]

24 Days of R: Day 24

December 24, 2013 | 0 Comments

OK, so I phoned it in last night. Final post and maybe this one will be a bit better. Can't recall what got me thinking about it, but I was running over the issue of school performance and the erroneous notion that small class sizes will produce better students. This ... [Read more...]

24 Days of R: Day 23

December 23, 2013 | 0 Comments

Penultimate post, I'm going to take a quick look at the Gini indicator for wealth inequality. Data comes from the World Bank. I've downloaded the zipped file, decompressed it and given it a different name. I'm going to This will give us a decent set of data. How does this ... [Read more...]

24 Days of R: Day 22

December 22, 2013 | 0 Comments

I like to use Goodreads to keep track of which books I'm reading (and not reading). They very helpfully sent me an e-mail to inform me how many books I've read so far in 2013. The number is 19. Hardly an impressive number, but between job, family and trying to develop my ... [Read more...]

24 Days of R: Day 21

December 21, 2013 | 0 Comments

I drove through Tennessee today. Despite having grown up in Kentucky, I had never really noticed the Tennessee flag, but earlier this year, while in Nashville, I saw it and thought it was one of the cooler state flags. I downloaded a PNG file of the flag from wikicommons and ... [Read more...]

24 Days of R: Day 20

December 20, 2013 | 0 Comments

Some time ago, I was doing some analysis and trying to determine whether or not there was a predictive variable for a binomial response. I ran logistic regressions for about half a dozen variables in different combinations and nothing showed a fit of any significance. Well, almost nothing. I had ... [Read more...]

24 Days of R: Day 19

December 19, 2013 | 0 Comments

Carrying on with the multi-level model, I'm going to look at the paid and incurred workers comp losses for a large number of insurance companies. This is a similar exercise to what I did last night, but I'm now working with real, rather than simulated data and the stochastic process ... [Read more...]

24 Days of R: Day 18

December 18, 2013 | 0 Comments

Earlier today, while looking for something else, I managed to stumble across a presentation given at the 2010 CAS RPM. (Egregious self-promotion: I'll be leading a day-long workshop at next year's RPM in Washington, DC.) I wasn't looking for a presentation on hierarchical models, but there one was. The fantastic Jim ... [Read more...]

24 Days of R: Day 17

December 18, 2013 | 0 Comments

I couldn't manage to find time yesterday, so today I'm going to try and catch up with two posts. In the first, I'm going to talk about a package I've been gradually working on over the course of the year. After all, what's Christmas if you don't get a package? ... [Read more...]

24 Days of R: Day 16

December 16, 2013 | 0 Comments

Yesterday I said that I'd carry on with the monte carlo simulation of insurance data. I'm not going to as I don't think I've got enough time and mental energy to do it justice. I'm sure tens of people are disappointed to learn this. Instead, I'm going to have a ... [Read more...]

24 Days of R: Day 15

December 15, 2013 | 0 Comments

Over the course of the next few days, I'm going to try to find enough time to build up a reasonably simple simulation of insurance exposure and claims. I'll be taking a hierarchical view of the underlying process. As with pretty much everything that I write about, I'm writing about ... [Read more...]

24 Days of R: Day 14

December 14, 2013 | 0 Comments

I've had a statistical question that I've wanted to answer for more than 20 years. In college, I often played the strategy game “Axis & Allies” with friends. (Hi Brad, Rob, Brady and Marty!) The game is a crude simulation of the second world war, with various military units available to the ... [Read more...]

24 Days of R: Day 13

December 13, 2013 | 0 Comments

In this post, I'll look at a very quick way to look at the relationships in a database. I had a bit of fun with my first network graph and plotting the connections between tables and views seems like a natural extension. Here, I'm going to create a bare bones ... [Read more...]
1 2 3

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)