R/score.transform.R

`score.transform` <-
function(scores, mu.new=0, sd.new=1, normalize=FALSE){

percentile <- trunc(rank(scores))/length(scores)

if(normalize) scores.new <- qnorm(percentile) 
else{
  mu.old <- mean(scores)
  sd.old <- sd(scores)
  scores.new <- (scores - mu.old)/sd.old
}

scores.new <- (scores.new*sd.new) + mu.new
out <- list(new.scores = scores.new, p.scores = percentile)
out
}

Try the CTT package in your browser

Any scripts or data that you put into this service are public.

CTT documentation built on Feb. 5, 2018, 1:02 a.m.