# Return to Minitab macro index

# How to save this page as a macro

# NSCORES.MAC
#
# Prepares data for a normal probability plot.
# Similar to the NSCORES command, but handles ties differently.
#
# 02/04/98
# DKN
#

macro
nscores x zscores


#################################
###       declarations        ###
#################################
mcolumn x zscores tmp tmp2
mconstant obs

#################################
###          main body        ###
#################################

brief 0

count x obs
Set tmp
 1 : obs
End.
let tmp2 = tmp

Sort x tmp x tmp;
  By x.

# Now account for missing entries
let tmp2 = tmp2 +x -x

nscores tmp2 zscores.

Sort x zscores x zscores;
  By tmp.

brief 2

endmacro