
Running simple linear regression (slr) on multiple variables across multiple grouping variables.
grouped_slr(data, dep.vars, indep.vars, grouping.vars)
Dataframe from which variables are to be taken.
List criterion or dependent variables for simple linear
model (y
in y ~ x
).
List predictor or independent variables for simple
linear model (x
in y ~ x
).
List of grouping variables.
A tibble dataframe with tidy results from simple linear regression
analyses. The estimates are standardized, i.e. the lm
model used is
scale(y) ~ scale(x)
, and not y ~ x
.
# NOT RUN {
# for reproducibility
set.seed(123)
# in case of just one grouping variable
groupedstats::grouped_slr(
data = iris,
dep.vars = c(Sepal.Length, Petal.Length),
indep.vars = c(Sepal.Width, Petal.Width),
grouping.vars = Species
)
# }
Run the code above in your browser using DataLab