Building a better flu map!

The flu seems to be especially potent this year. “How potent is it,” you might ask? … Well, let’s plot some data on a map to help find out! Here in the US, the Centers for Disease Control and Prevention (CDC) compiles data about diseases, and provide…

A better way to view flu data

Have you, or someone you know, gotten the flu this year? Word on the street is that this year’s flu might be particularly bad, and the data seem to be corroborating that so far. You don’t want to take my word for it? — well then, let’s have a look […..

Type I error rates in two-sample t-test by simulation

What do you do when analyzing data is fun, but you don’t have any new data? You make it up.

This simulation tests the type I error rates of two-sample t-test in R and SAS. It demonstrates efficient methods for simulation, and it reminders the reader not to take the result of any single hypothesis test as gospel truth. That is, there is always a risk of a false positive (or false negative), so determining truth requires more than one research study.

A type I error is a false positive. That is, it happens when a hypothesis test rejects the null hypothesis when in fact it is not true. In this simulation the null hypothesis is true by design, though in the real world we cannot be sure the null hypothesis is true. This is why we write that we “fail to reject the null hypothesis” rather than “we accept it.” If there were no errors in the hypothesis tests in this simulation, we would never reject the null hypothesis, but by design it is normal to reject it according to alpha, the significance level. The de facto standard for alpha is 0.05.

R

First, we run a simulation in R by repeatedly comparing randomly-generated sets of normally-distributed values using the two-sample t-test. Notice the simulation is vectorized: there are no “for” loops that clutter the code and slow the simulation.

Read more »

For more posts like this, see Heuristic Andrew.

How to test PROC HTTP and the JSON library engine

Using SAS with REST APIs is fun and rewarding, but it’s also complicated. When you’re dealing with web services, credentials, data parsing and security, there are a lot of things that can go wrong. It’s useful to have a simple program that verifies that the “basic plumbing” is working before […]

The post How to test PROC HTTP and the JSON library engine appeared first on The SAS Dummy.