I ran across an interesting conundrum the other day. The intent was to compare the value of X to a list of desired values, and if X matched one of the values in the list, set Flag to 1, otherwise set Flag to 0. I wrote and executed this test program, …
Category: SAS
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.
For more posts like this, see Heuristic Andrew.
North Korea’s 117 missile tests
Data doesn’t always have to be ‘big data’ to be interesting. For example, I recently ran across a small, but very interesting, database containing all of North Korea’s missile tests. The data was a bit difficult to digest in the formats provided, therefore I decided to try my hand at […]
The post North Korea’s 117 missile tests appeared first on SAS Learning Post.
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.
Demystifying SAS certification – Week 1
Well! I did it! I conducted a workshop for internal SAS employees wishing to take SAS certification. The workshop was to help them understand the following: SAS Certification overview Exam preparation Website Content Exam pass score Sample questions St…
Here are the Amazon HQ2 finalists!
Amazon recently announced the 20 finalists in their search for a location to house their new 2nd headquarters (nicknamed ‘hq2’). They showed a map on their web page, but I wanted to create my own map, with a few improvements … Here’s their official m…
Use Network Analysis to Understand Your Customers with SAS Visual Analytics 8.2
You can use the SAS Visual Analytics 8.2 Network Analysis object to visualize relationships. For some recent data analysis, I was trying to understand the customer to sales office relationship. My suspicion was that it wasn’t evenly distributed a…
Polishing up your Bitcoins!
With all the talk about Bitcoin in the news lately, I decided it was time I created a Bitcoin graph! Follow along as I track down the data, create a graph, and then polish up that graph to make it shine. But before we get started, here’s a little examp…