grouped_slr: Running simple linear regression (slr) on multiple variables...

Description Usage Arguments Value See Also Examples

View source: R/grouped_slr.R

Description

Running simple linear regression (slr) on multiple variables across multiple grouping variables.

Usage

1
grouped_slr(data, dep.vars, indep.vars, grouping.vars)

Arguments

data

Dataframe from which variables are to be taken.

dep.vars

List criterion or dependent variables for simple linear model (y in y ~ x).

indep.vars

List predictor or independent variables for simple linear model (x in y ~ x).

grouping.vars

List of grouping variables.

Value

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.

See Also

grouped_lm, grouped_tidy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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
)

IndrajeetPatil/groupedstats documentation built on June 6, 2020, 9:57 a.m.