boxcoxCensored.object {EnvStats}  R Documentation 
Objects of S3 class "boxcoxCensored"
are returned by the EnvStats
function boxcoxCensored
, which computes objective values for
userspecified powers, or computes the optimal power for the specified
objective, based on Type I censored data.
Objects of class "boxcoxCensored"
are lists that contain
information about the powers that were used, the objective that was used,
the values of the objective for the given powers, and whether an
optimization was specified.
Required Components
The following components must be included in a legitimate list of
class "boxcoxCensored"
.
lambda 
Numeric vector containing the powers used in the BoxCox transformations.
If the value of the 
objective 
Numeric vector containing the value(s) of the objective for the given value(s)
of 
objective.name 
Character string indicating the objective that was used. The possible values are

optimize 
Logical scalar indicating whether the objective was simply evaluted at the
given values of 
optimize.bounds 
Numeric vector of length 2 with a names attribute indicating the bounds within
which the optimization took place. When 
eps 
Finite, positive numeric scalar indicating what value of 
sample.size 
Numeric scalar indicating the number of finite, nonmissing observations. 
censoring.side 
Character string indicating the censoring side. Possible values are

censoring.levels 
Numeric vector containing the censoring levels. 
percent.censored 
Numeric scalar indicating the percent of observations that are censored. 
data.name 
The name of the data object used for the BoxCox computations. 
censoring.name 
The name of the data object indicating which observations are censored. 
bad.obs 
The number of missing ( 
Optional Component
The following components may optionally be included in a legitimate
list of class "boxcoxCensored"
. They must be included if you want to
call the function plot.boxcoxCensored
and specify QQ plots or
Tukey MeanDifference QQ plots.
data 
Numeric vector containing the data actually used for the BoxCox computations (i.e., the original data without any missing or infinite values). 
censored 
Logical vector indicating which of the vales in the component 
Generic functions that have methods for objects of class
"boxcoxCensored"
include:
plot
, print
.
Since objects of class "boxcoxCensored"
are lists, you may extract
their components with the $
and [[
operators.
Steven P. Millard (EnvStats@ProbStatInfo.com)
boxcoxCensored
, plot.boxcoxCensored
,
print.boxcoxCensored
.
# Create an object of class "boxcoxCensored", then print it out.
# (Note: the call to set.seed simply allows you to reproduce this example.)
set.seed(250)
x.1 < rlnormAlt(15, mean = 10, cv = 2)
censored.1 < x.1 < 2
x.1[censored.1] < 2
x.2 < rlnormAlt(15, mean = 10, cv = 2)
censored.2 < x.2 < 4
x.2[censored.2] < 4
x < c(x.1, x.2)
censored < c(censored.1, censored.2)
boxcox.list < boxcoxCensored(x, censored)
data.class(boxcox.list)
#[1] "boxcoxCensored"
names(boxcox.list)
# [1] "lambda" "objective" "objective.name"
# [4] "optimize" "optimize.bounds" "eps"
# [7] "data" "censored" "sample.size"
#[10] "censoring.side" "censoring.levels" "percent.censored"
#[13] "data.name" "censoring.name" "bad.obs"
boxcox.list
#Results of BoxCox Transformation
#Based on Type I Censored Data
#
#
#Objective Name: PPCC
#
#Data: x
#
#Censoring Variable: censored
#
#Censoring Side: left
#
#Censoring Level(s): 2 4
#
#Sample Size: 30
#
#Percent Censored: 26.7%
#
# lambda PPCC
# 2.0 0.8954683
# 1.5 0.9338467
# 1.0 0.9643680
# 0.5 0.9812969
# 0.0 0.9776834
# 0.5 0.9471025
# 1.0 0.8901990
# 1.5 0.8187488
# 2.0 0.7480494
boxcox.list2 < boxcox(x, optimize = TRUE)
names(boxcox.list2)
# [1] "lambda" "objective" "objective.name"
# [4] "optimize" "optimize.bounds" "eps"
# [7] "data" "sample.size" "data.name"
#[10] "bad.obs"
boxcox.list2
#Results of BoxCox Transformation
#
#
#Objective Name: PPCC
#
#Data: x
#
#Sample Size: 30
#
#Bounds for Optimization: lower = 2
# upper = 2
#
#Optimal Value: lambda = 0.5826431
#
#Value of Objective: PPCC = 0.9755402
#==========
# Clean up
#
rm(x.1, censored.1, x.2, censored.2, x, censored, boxcox.list, boxcox.list2)