SimpleRegressionData: Generates sample data for a simple regression, y = alpha +...

Description Usage Arguments Value Examples

View source: R/SimpleRegressionData.R

Description

Generates sample data for a simple regression, y = alpha + beta x + epsilon with control over var(x) and var(epsilon)

Usage

1
2
3
4
5
6
7
SimpleRegressionData(
  alpha = 1,
  beta = 5,
  rangex = c(0, 10),
  sigma = 1,
  N = 100
)

Arguments

alpha

intercept of regression.

beta

slope coefficient.

rangex

range of the uniform normal that will be used to generate x variables in the form c(max,min).

sigma

standard deviation of the error term

N

Number of observations

Value

Data.frame with Y, X and er.

Examples

1
2
3
4
## Not run: 
SimpleRegressionData(alpha = 2, beta = -2, rangex= c(-10, 20), sigma = 3, N =100)

## End(Not run)

woodsjam/PSUEC469 documentation built on Jan. 8, 2021, 3:30 a.m.