reciprocal: Reciprocal transformation for linear models

Description Usage Arguments Value Examples

View source: R/reciprocal.R

Description

The function transforms the dependent variable of a linear model using the Reciprocal transformation.

Usage

1
reciprocal(object)

Arguments

object

an object of type lm.

Value

An object of class trafo. Methods such as as.data.frame.trafo and print.trafo can be used for this class.

Examples

1
2
3
4
5
6
7
8
# Load data
data("cars", package = "datasets")

# Fit linear model
lm_cars <- lm(dist ~ speed, data = cars)

# Transform dependent variable 
reciprocal(object = lm_cars)

Example output

Registered S3 method overwritten by 'pryr':
  method      from
  print.bytes Rcpp
Reciprocal Transformation 

Summary of transformed variables 
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.5000  0.9615  0.9722  0.9549  0.9821  0.9917 

trafo documentation built on May 2, 2019, 2:13 p.m.

Related to reciprocal in trafo...