# Here we use the Stat 2016 data to # illustrate how normal modelling works # Curator/Coder: Kno Tsao # 參考資料:2016 統計學課網 # http://faculty.ndhu.edu.tw/%7Echtsao/edu/16/stat/stat.html # Given the class # average=46.52, s.d.= 27.3 # Q1: 我考得如何? How do I do in this exam? Good or bad? # say, my score=60, 46, 20, 10 # Assume X ~ N(46.52, 27.3^2) is reasonable/acceptable # F(x)=P(X <= x), X ~ N(46.52, 27.3^2) x<-c(60,46,20,10) pnorm(x,46.52,27.3) # 幾分會過? What would be the passing threshold, if # the instructor decides to fail, say 1/4, 1/3 of # of the class? # Solve x s.t. F(x)=P(X. # This sqrt-x10 transformation make the lower scores higher while # maintains all scores lie in [0,100] x2<-sqrt(x)*10 hist(x2) # X3 is transformed to make the # while maintainting all scores in [0,100] x3<-(x^2)/100 hist(x3) # It is possible that the generated data having # negative values. # It happens despite the probability is quite small pnorm(0,46.52,27.3) # In such scenario, the common practice is to add a # constant such that all (new) scores are positive x<-rnorm(63,46.52,27.3) # You can find out the smallest value of x by min min(x) # if negative, substract min(x) from all x x<-x-min(x) # the new x are all greater or equal to zero x2<-sqrt(x)*10 hist(x2)