Learn R Programming

mi (version 1.1)

censored-continuous-class: The "censored-continuous" Class, the "truncated-continuous" Class and Inherited Classes

Description

The censored-continuous class and the truncated-continuous class are both virtual and both inherit from the continuous-class and each is the parent of four classes that differ depending on whether the lower and upper bounds are numeric vectors or functions. A censored observation is one whose exact value is not observed. A truncated observation is one whose exact value is not observed and which implies that values on some other variables are not observed for that unit of observation. An example of truncation might be that some taxation forms are not required when a person's income falls below a certain threshold. The methods for these classes are not working yet. Aside from these facts, the rest of the documentation here is primarily directed toward developeRs.

Arguments

Objects from the Classes

Both the censored-continuous class and the truncated-continuous class are virtual, so no objects can be created with these classes. However, the missing_variable generic function can be used to create an object that inherits from one of their subclasses by specifying type = "NNcensored-continuous", type = "NFcensored-continuous", type = "FNcensored-continuous", type = "FFcensored-continuous", type = "NNtruncated-continuous", type = "NFtruncated-continuous", type = "FNtruncated-continuous", type = "FFtruncated-continuous". When doing so, the lower and upper slots need to be specified appropriately.

Slots

The censored-continuous class and the truncated-continuous class are both virtual, both inherit from the continuous class, both use the identity transformation by default, and both have two additional slots:

upper

The upper bound for each observation

lower

The lower bound for each observation

Both the censored-continuous class and the truncated-continuous class have four subclasses that differ depending on whether the upper and / or lower bounds are numeric vectors or functions that output numeric vectors (scalars are recycled and can be Inf). These subclasses are

NN_censored-continuous

where both the lower and upper bounds are numeric vectors

FN_censored-continuous

where the lower bound is a function and the upper bound is a numeric vector

NF_censored-continuous

where the lower bound is a numeric vector and the upper bound is a function

FF_censored-continuous

where both the lower and upper bounds are functions

NN_truncated-continuous

where both the lower and upper bounds are numeric vectors

FN_truncated-continuous

where the lower bound is a function and the upper bound is a numeric vector

NF_truncated-continuous

where the lower bound is a numeric vector and the upper bound is a function

FF_truncated-continuous

where both the lower and upper bounds are functions

See Also

missing_variable, continuous-class

Examples

Run this code
# NOT RUN {
# STEP 0: GET DATA
data(CHAIN, package = "mi")

# STEP 0.5 CREATE A missing_variable (you never need to actually do this)
#log_virus <- missing_variable(CHAIN$log_virus, type = "NN_censored-continuous", 
#                              lower = 0, upper = Inf)
#show(log_virus)
# }

Run the code above in your browser using DataLab