powered by
This function calculates predicted x values based on regression coefficients. The results of this function can be passed to other sim_*() functions.
sim_*()
make_xb(x, beta)
A numeric vector
a data.frame of independent variables generated with make_x().
data.frame
make_x()
a vector of the beta coefficients for each of the variables. There must be ncol(x) + 1 values. The first element of the vector is the intercept.
ncol(x) + 1
x <- make_x(25, c(0,1), c(1,4)) betas <- c(1, 1.5, -2) make_xb(x, betas)
Run the code above in your browser using DataLab