tidy_lm_permute: 'tidy_lm_permute'

Description Usage Arguments Value Author(s) Examples

View source: R/tidy_lm_permute.R

Description

permute lm and output the results as a tidy table.

Usage

1
tidy_lm_permute(data, formula, n_permute = 1000, var_permute)

Arguments

data

a data.frame to be analyzed

formula

a formula to be analyzed as typically written for the lm function

n_permute

= 1000 (default) the number of permutations to perform

var_permute

variable(s) to unlink in the permutation

Value

outputs tidy table that includes the p.value from the permutation of a lm test

Author(s)

Ekarin Eric Pongpipat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
packages <- c("broom", "broomExtra", "dplyr", "modelr", "purrr", "tibble")
xfun::pkg_attach2(packages, message = F)

data <- tibble(
  a = scale(sample.int(100), scale = F),
  b = scale(sample.int(100), scale = F),
  c = b^2,
  d = scale(sample.int(100), scale = F)
)

tidy_lm_permute(data = data, formula = "a ~ b + c", n_permute = 100, var_permute = "a")

epongpipat/broomExtra documentation built on Aug. 9, 2019, 12:10 p.m.