Learn R Programming

spdgp (version 0.1.0)

make_xb: Calculate predicted X values based on coefficients

Description

This function calculates predicted x values based on regression coefficients. The results of this function can be passed to other sim_*() functions.

Usage

make_xb(x, beta)

Value

A numeric vector

Arguments

x

a data.frame of independent variables generated with make_x().

beta

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.

Examples

Run this code
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