censor 

File:  jmfuns.rda

 

censor is a function for sampling from a censored distribution.  By default, the sampled value xx must be strictly between the bounds, lower < xx  < upper, i.e., the samples are drawn from an open interval (lower, upper).  This default can be overridden (see include.ends below).

 

censor(lower = -Inf, upper = Inf, FUN = function() rnorm(1,

   mean = 0, sd = 1), n.iterations = 100, include.ends = FALSE)

 

 

ARGUMENTS:

 

lower = lower bound of censoring interval.  Set lower = -Inf (default)  if no lower bound is desired.

 

upper = upper bound of censoring interval.  Set upper = Inf (default)  if no upper bound is desired.

 

FUN is function that randomly samples from a specified distribution.  Typically, FUN has the form FUN = function() rdistribution(n = 1, <parameters>), where  rdistribution is replaced with an R distribution like rnorm or rbeta and <parameters> are replaced with the parameter values to be used in the random  sampling. 

 

n.iterations specifies the number of times samples are drawn before  ceasing to attempt to sample between lower and uppern.iterations is set to 100 (default) only to prevent an infinite loop in the case where the user mistakenly sets (lower, upper) to be outside of the range  of possible samples, e.g., if lower = -3, upper = -2, and  FUN = function() rbeta(n = 1, shape1 = 1, shape2 = 1).  If you are  certain that FUN is capable of drawing samples between lower and upper, then one can set n.iterations = Inf to make sure that the call to censor  will yield a numeric value.

 

include.ends = FALSE (default) implies that lower and upper are not acceptable values of the sample; if include.ends = TRUE, then lower and upper are accepted as within the interval of acceptable  values.

 

 

 

 

#-------------- The 'doc' bookmark highlights all of the documentation but not the function skeleton at the top of the file.  Use rdocToString macro to convert documentation to an R string variable  ---------------------------------------------------------------------------------------------------------------------------------------------

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"