simer: Simulation of simple linear regression with hidden...

Description Usage Arguments Value Author(s) Examples

View source: R/simer.R

Description

Simulates n observations, (y, x) from a simple linear regression, y = a+b*x+e, where x is uniformly distributed on (0, n), e are normally distributed with mean 0 and variance 1. The parameeters a and b are zero. The error term is not independent but has an exponential correlation with parameter r so that observations close together in the x-space are positively correlated. When r=0, the correlation is zero but as r increases the correlation gets stronger.

Usage

1
simer(n, r)

Arguments

n

number of observations

r

correlation parameter

Value

A data frame with components:

x

input variable

y

output variable

Author(s)

A. I. McLeod and Yun Shi

Examples

1
data <- simer(50, 5)

hcc documentation built on May 2, 2019, 2:08 a.m.