SAS® and R

Best of Both Worlds

Archive for the ‘Misc’ Category

leave a comment »

Letter from a teacher to parents. I’d say respect goes both ways, and communication is always key to resolving any problems.

Teachable Moments

There are so many things I wish I could say, but alas, I am not allowed. Ok, anyone who actually knows me, knows that I would NEVER say these things, but this is how I really feel, and this is the truth; at least it’s my truth.

Dear Parent/Guardian,

I am looking forward to a great year with your student. I have spent my summer learning new strategies, and looking at ways to improve student learning. Not a day has gone by that I didn’t at least think about something I would like to do or change in order to enhance student learning. I have ignored statements made about what I do with my summers, ignored reports of testing on the news, and done what I know is right. I know, that if I do my best to help and teach all students, tests will take care of themselves.


View original post 281 more words


Written by sasandr

July 27, 2012 at 10:20 am

Posted in Misc

God particle, 5 sigma, and p-value

with 2 comments

About a week ago, CERN announced the discovery of a new sub-atomic particle that’s consistent with the properties of the elusive Higgs Boson, a.k.a. God Particle. CERN scientists say it is a 5 sigma result. It is interesting that almost all the news reports I read converted this 5 sigma to a percentage, and none seemed to be able to explain what exactly 5 sigma is. Some even mistakenly claimed that scientists “99.999% sure God Particle has been found.

Actually 5 sigma is just another way of stating the probability value, in another word, p-value. So what is p-value anyway? P-value is the probability that the data would be at least as extreme as those observed, if the null hypothesis were true.

Standard normal distribution N(0,1) has μ=0 and σ2=1. As you can see from the above graph, a little more than 2/3 of values drawn from a normal distribution are within one standard deviation (one sigma) away from the mean (red area). Approximately 95% of the values are with two sigma (1.96) of the mean. Three sigma covers about 99.7% AUC (Area under the density curve).

Five sigma? That’s about 0.9999997, which means the significance level (alpha) is 0.0000003. In short, there is the null hypothesis (no God particle), and the alternative hypothesis (God particle exists). Five sigma means that there is a very slim chance (less than one in a million) the null hypothesis is true. Note that this is not the equivalent of scientists being 99.99997% sure the alternative hypothesis is correct.

> pnorm(5)
[1] 0.999999713348428
> 1-pnorm(5)
[1] 0.000000286651571923535

Here is the code for the graph. I wrote it in a hurry, any suggestion to make it better is welcome.

my.color   <- rainbow(10)
my.symbol2 <- expression(mu)
my.axis    <- c(-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6)
my.label   <- c('-6', '-5','-4','-3','-2','-1',my.symbol2,'1','2','3','4','5','6')

x = seq(-6, 6, length = 600)
y = dnorm(x)

plot(x, y, type = "n", xlab=my.symbol, ylab=' ', axes=FALSE)

plotsigma <- function(start, end, color){
  sigmax = seq(start, end, length=100)
  sigmay = c(0, dnorm(sigmax), 0)
  sigmax = c(start, sigmax, end)
  polygon(sigmax, sigmay, col = color, border = NA)

for (i in 5:1){
  plotsigma(-i, i, my.color[i])

lines(x, y)
segments(0,0.4,0,0, col='white')
segments(5,0.2,5,0, lty=3)
text(5,0.22, expression(paste(5, sigma, sep='')))

Written by sasandr

July 14, 2012 at 12:08 am

Posted in Misc, Stat

Tagged with ,

Freakonomics survey

with one comment

Freakonomics just put up a survey: Which social science should die?

The four candidates for elimination are: Psychology, Political science, Economics, and Sociology. If you ask me what are these four disciplines in common, on top of my list would be they all tend to misuse statistical test of significance, with sociology and political science leading the charge. I’d be interested to know the survey result. However, I think for the survey to be meanful in any discussion, they should take the survey taker’s profession into consideration.

Please go take the survey, the result is out next week.

Written by sasandr

July 5, 2012 at 11:05 am

Posted in Misc, Stat

Tagged with

What makes you smart can also make you stupid

with 5 comments

Interesting article from New Yorker. [Read more…]

Written by sasandr

June 12, 2012 at 2:12 pm

Posted in Misc

Tagged with

China stocks fall bizarre 64.89 points on June 4, ’89 anniversary

leave a comment »

What are the chances?

CNBC screenshot

China stocks fall bizarre 64.89 points on June 4th, ’89 anniversary

From Reuters:

BEIJING (Reuters) – China’s censors blocked access to the term “Shanghai stock market” on popular microblogs on Monday after the index fell a bizarre 64.89 points on the anniversary of the bloody June 4, 1989, crackdown on pro-democracy protesters in Tiananmen Square. [Read more…]

Written by sasandr

June 4, 2012 at 10:05 am

Posted in Misc

Tagged with