Q: Function to discretize a variable based on a selected...

Description Usage Arguments Value Examples

Description

Function to discretize a variable based on a selected quantile

Usage

1
Q(x, q)

Arguments

x

variable to discretize

q

probability corresponding to quantile

Value

vector with a discretized version of x.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 ## Not run: 

 x <- runif(100,-1,1)
 y <- x^2 + rnorm(100)
 
 summary( lm(y ~ Q(x,0.25) ) )
 summary( lm(y ~ Q(x,0.75) ) )
 
 
## End(Not run)

sumtxt/datatools documentation built on May 30, 2019, 8:38 p.m.