yget: Use matrix and vector build y

View source: R/APLM_function.R

APLM_functionR Documentation

Use matrix and vector build y

Description

use the method of multiplying the beta vector by the data matrix to calculate the value of y.

Usage

yget(data, beta, e, way)

Arguments

data

data matrix

beta

beta is vector of (beta0, beta1, ... , betan)

e

random error tern e, length is data length

war

way=1 or 2 is 2 way to calculate y

Examples

x <- data.frame(matrix(rnorm(300), ncol=3))
beta <- c(4,2,3)
y1 <- yget(data=x, beta=beta, e=rnorm(dim(x)[1]), way=1)
y2 <- yget(data=x, beta=beta, e=rnorm(dim(x)[1]), way=2)

hans0803/APLM documentation built on June 17, 2024, 5:22 a.m.