make_cis: Generic function to do build confidence intervals.

Description Usage Arguments Value Examples

View source: R/model_tools.R

Description

Build response variables and aggregate into a plot ready data.frame.

Usage

1
make_cis(mod, level = 0.95, all = FALSE, restore = TRUE)

Arguments

mod

A model object. Only 'lm' and 'lmer' models are currently accepted.

level

The confidence level used between 0-1. Default is .95.

all

Boolean, should all predictor varaibles be returned or just the first predictor (default).

restore

Boolean, shold response variables be transformed back to linear space.

Value

A data.frame with the mean, upper and lower bounds for the response variable confidence interval.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
data(mtcars)
mtcars$cyl %<>% as.factor()
m <- lm(log10(mpg) ~ 0 + cyl, data = mtcars)
make_cis(m)

library(lme4); data(sleepstudy)
sleepstudy$Days %<>% as.factor()
mm <- lmer(Reaction ~ 0 + Days + (1 | Subject), data = sleepstudy)
make_cis(mm)

## End(Not run)

hemoshear/assayr2 documentation built on Nov. 8, 2019, 6:13 p.m.