semi-continuous: Class "semi-continuous" and Inherited Classes

semi-continuous-classR Documentation

Class "semi-continuous" and Inherited Classes

Description

The semi-continuous class inherits from the continuous-class and is the parent of the nonnegative-continuous class, which in turn is the parent of the SC_proportion class for semi-continuous variables. A semi-continuous variable has support on one or more point masses and a continuous interval. The semi-continuous class differs from the censored-continuous-class and the truncated-continuous-class in that observations that fall on the point masses are bonafide data, rather than indicators of censoring or truncation. If there are no observations that fall on a point mass, then either the continuous-class or one of its other subclasses should be used. Aside from these facts, the rest of the documentation here is primarily directed toward developers.

Objects from the Classes

Objects can be created that are of semi-continuous, nonnegative-continuous, or SC_proportion class via the missing_variable generic function by specifying type = "semi-continuous" type = "nonnegative-continuous", type = "SC_proportion".

Slots

The semi-continuous class inherits from the continuous class and is intended for variables that, for example have a point mass at certain points and are continuous in between. Thus, its default transformation is the identity transformation, which is to say no transformation in practice. It has one additional slot.

indicator

Object of class "ordered-categorical" that indicates whether an observed value falls on a point mass or the continuous interval in between. By convention, zero signifies an observation that falls within the continuous interval

At the moment, there are no methods for the semi-continuous class. However, the basic approach to modeling a semi-continuous variable has two steps. First, the indicator is modeled using the methods that are defined for it and its missing values are imputed. Second, the continuous part of the semi-continuous variable is modeled using the same techniques that are used when modeling continuous variables. Note that in the second step, only a subset of the observations are modeled, although this subset possibly includes values that were originally missing in which case they are imputed.

The nonnegative-continuous class inherits from the semi-continuous class, which has its point mass at zero and is continuous over the positive real line. By default, the transformation for the positive part of a nonnegative-continuuos variable is log(y + a), where a is a small constant determined by the observed data. If a variable is strictly positive, the positive-continuous-class should be used instead.

The SC_proportion class inherits from the nonnegative-continuous class. It has no additional slots, and the only supported transformation function is the (y * (n - 1) + .5) / n function. Its default fit_model method is a wrapper for the betareg function in the betareg package. Its family must be binomial so that its link function can be passed to betareg If the observed values fall strictly on the open unit interval, the proportion-class should be used instead.

Author(s)

Ben Goodrich and Jonathan Kropko, for this version, based on earlier versions written by Yu-Sung Su, Masanao Yajima, Maria Grazia Pittau, Jennifer Hill, and Andrew Gelman.

See Also

missing_variable, continuous-class, positive-continuous-class, proportion-class

Examples

# STEP 0: GET DATA
data(nlsyV, package = "mi")

# STEP 0.5 CREATE A missing_variable (you never need to actually do this)
income <- missing_variable(nlsyV$income, type = "nonnegative-continuous")
show(income)

mi documentation built on June 7, 2022, 1:04 a.m.