Skip to contents

Assigns each value of x to the half-open interval [at[i], at[i+1]) it falls in, labelling it with the interval's lower bound. The final breakpoint is exclusive: values equal to or beyond it (and values below the first breakpoint) return NA, matching Stata's cut() egen function.

Usage

cut_stata(x, at)

Arguments

x

A numeric vector.

at

A numeric vector of breakpoints, in increasing order.

Value

A numeric vector of interval lower bounds (or NA).