draw.normal 

Package or File:  jmfuns.rda

 

draw.normal computes the X-Y coordinates for a normal probability density function.  It either plots the function or simply outputs the coordinates.

 

function (

   mn, sd,

   xlimit        = NA,

   ylimit        = NA,

   yMax          = NA,

   plot.dist     = TRUE,

   cdf           = FALSE,

   Label         = "default",

   Lwd           = 2,

   showX.axis    = TRUE,

   showY.axis    = FALSE,

   cred.int      = 0.95,

   plot.cred.int = FALSE,

   type.cred.int = 2,

   cred.lab      = TRUE,

   cred.col      = "yellow",

   ... )

#

 

ARGUMENTS:

 

              mn   population mean

 

              sd   population standard deviation.

 

          xlimit   If xlimit = NA, the default x limits are chosen by the plot function where min(x) = qnorm( .0001, mean = mn, sd = sd) and max(x) = qnorm( .9999, mean = mn, sd = sd).  If xlimit = c(A, B), then the plot function is called with xlim = c(A, B)

 

          ylimit   If ylimit = NA, the plot function is called with ylim = c(0, H) where H is either 1.25 in the case where cdf = TRUE, or H is 1.25 times the height of the standard normal density function at 0.  If ylimit = c(G, H), then plot is called with ylim = c(G, H)

 

                             yMax   If yMax = NA (default), then the y-values are scaled so that the area under the pdf equals 1.0.  If yMax = X for some positive X, then the largest value on the pdf equals X - as a consequence, the area under the curve is not equal to 1.0.  Although this is not strictly correct from the standpoint of probability theory, it can be useful if one wants to plot a normal curve with a given mean and standard deviation but scaled to fit the histogram of some data.  yMax only affects the plot or numeric output if cdf = FALSE (pdf is requested). 

 

                 plot.dist   If plot.dist = FALSE, then no plot is made and the X-Y coordinates for the graph are outputted.  If plot.dist = TRUE (default), a plot is made and the coordinates are not outputted.

 

                               cdf   If cdf = FALSE (default), the plot displays a density function.  If cdf = TRUE, the plot displays a cumulative distribution function. 

 

                           Label   If Label = "default", the plot title that states the parameters of the normal distribution.  If Label = "anything else", then the plot title is "anything else"

 

                               Lwd   Lwd controls the line weight on the graph.

 

               showX.axis   If showX.axis = FALSE, the X-axis is omitted; otherwise it is added to the plot.  The default is showX.axis = TRUE.

 

               showY.axis   If showY.axis = FALSE, the Y-axis is omitted; otherwise it is added to the plot.
show.axes = FALSE (default) omits axes. The default is showY.axis = FALSE.

 

                    cred.int   Probability level of the interval from the 1 - cred.int quantile to the cred.int quantile.   

 

        plot.cred.int   If plot.cred.int = TRUE, then the interval from the 1 - cred.int quantile to the cred.int quantile is plotted.  If plot.cred.int = FALSE, the interval is omitted.

 

                    cred.lab   Controls whether or not the probability level of the interval is written inside of the density plot.

 

                    cred.col   Controls the color of the area under the plotted interval.

 

 

#----------------------------------- The 'doc' bookmark highlights all of the documentation but not the function skeleton at the top of the file. ------------------------------------------------------------------------------------------------------------------------------------

Format for this html document:  Page Size = Tabloid:  11" x 17".  Note that Tabloid page size is available if Adobe PDF is set as the default printer, but not if the default printer is a physical printer that prints 8.5" x 11" standard paper.  Table widths = 9.5"