
Last chance! 50% off unlimited learning
Sale ends in
Creates data suitable for a simple linear regression. In the first step, data is computed using pearson_data()
,
satisfying the conditions
lm1_data(
r,
n = 100,
nmax = 6,
maxt = 30,
xsos = NULL,
ysos = NULL,
center = numeric(0),
scale = numeric(0),
...
)slr_data(
r,
n = 100,
nmax = 6,
maxt = 30,
xsos = NULL,
ysos = NULL,
center = numeric(0),
scale = numeric(0),
...
)
Returns an extended lm
object and the additional list elements:
inter
contains intermediate results (the last column contains the row sums), and
xy
the generated
numeric: desired correlation
integer: number to decompose as sum of squares, see pearson_data()
.
integer: maximal number of squares in the sum, see pearson_data()
.
numeric: maximal number of seconds the routine should run, see pearson_data()
.
sos matrix: precomputed matrix, see pearson_data()
.
sos matrix: precomputed matrix, see pearson_data()
.
numeric(2): center of x
and y
data
numeric(2): standard deviation for x
and y
data
further named parameters given to stats::lm()
data(sos)
n <- sample(5:10, 1)
lm1 <- lm1_data(0.6, nmax=n, xsos=sos100)
str(lm1)
Run the code above in your browser using DataLab