linear_data: Linear example

View source: R/data.R

linear_dataR Documentation

Linear example

Description

Generate data points with a linear relationship.

Usage

linear_data(n = 100, a = -3, b = 3)

Arguments

n

Number of data points.

a, b

Lower and upper bound of the uniform distribution.

Value

A data frame with three variables. Variable 'y = 0.6 * x1 + 0.3 * x2

  • 0.1 * x3' is the response, and 'x1', 'x2' and 'x3' are uniform random variables between a and b.

Examples

xy <- linear_data(n = 30, a = -1, b = 1)

spatgeom documentation built on April 27, 2023, 1:11 a.m.