Learn R Programming

mi (version 0.10-2)

typecast: Variables type

Description

Function for determinig the variable type.

Usage

typecast( object )
  ## S3 method for class 'ANY':
typecast( object )
  ## S3 method for class 'matrix':
typecast( object )
  ## S3 method for class 'data.frame':
typecast( object )  
  ## S3 method for class 'list':
typecast( object )

Arguments

object
Vector, matrix, or data frame of data to determin the type of.

Value

  • fixedvaraibles that contain only one value.
  • binaryvariables that contain two values.
  • ordered-categoricalvariables that contain 3 to 5 postive values.
  • unorderd-categorialvariables that contain characters or more than 5 postive levels
  • positive-continuousvariables that contain more than 5 postive values, NOT including 0s.
  • nonnegativevariables that contain more than 5 postive values, including 0s.
  • continuousvariables that are not belong to any of the above types.
  • log-continuouslog-scaled continuous variable

Details

The variable type of a vector, or vector of variable types for each variable in the dataset.

References

Yu-Sung Su, Andrew Gelman, Jennifer Hill, Masanao Yajima. (2011). Multiple Imputation with Diagnostics (mi) in R: Opening Windows into the Black Box. Journal of Statistical Software 45(2).

See Also

mi

Examples

Run this code
data(CHAIN)
class(CHAIN)

typecast(CHAIN[,1]) # for vector

typecast(as.matrix(CHAIN))# for matrix

typecast(CHAIN) # for data.frame

Run the code above in your browser using DataLab