get_y: get y (right hand of var)

Description Usage Arguments Details Value Examples

View source: R/linear.tools.R

Description

get y (right hand of var)

Usage

1
get_y(Formula, method = c("raw", "model", "coeff"))

Arguments

Formula

a formula to be paste.

method

either 'raw','model', or 'coeff', to decide what kind variables to show. Default is 'raw'. See section Detials below.

Details

What do 'raw' variable, 'model' variable, and 'coeff' variable mean?

In the formula, log(y) ~ x1 + x2, we have: 'raw' variable for y: y 'model' variable for y: log(y) 'coeff' variable for y: log(y)

More examples see the sample code below.

Value

y in formula

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
get_y(log(price) ~sdfsf + dsa )
get_y(log(price) ~ sdfsf + dsa, method = "model")
get_y(log(price) ~ sdfsf + dsa, method = "coeff") # same as model var in the get_y() case

# can deal with un-regular formula
get_y(log(price) ~sdfsf + dsa ~ dsad)
get_y(log(price) ~ sdfsf + dsa ~ dsad, method = "coeff")
get_y(log(price) ~ sdfsf + dsa ~ dsad, method = "model")

model_dirty = model = lm(price~  I(carat^   2) + cut  - carat:table - cut ,ggplot2::diamonds)
get_y(model_dirty)

linear.tools documentation built on May 2, 2019, 3:17 a.m.