knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  warning = F,
  message = F
)

Introduction

Zuur and Ieno (2016) encourage authors to present the model equation associated with their analyses ("Step 5: Present the statistical model"). This is a very important aspect of an analysis but requires you to know how to interpret R's output and to understand what the underlying relationships which your "Statistical test" implies.

Zuur & Ieno (2016) provide some examples, but they are for fairly complex models. I am working on simpler examples.

Here are some thoughts on understanding and implementing this task

Simple regression: use ggpubr!

For simple regression situations we can get ggpubr to come up with the equation for us.

Some packages and data

library(ggpubr)
library(MASS)
data(mammals)

A simple regression model

mod <- lm(brain ~ body, data = mammals)

Look at the output

summary(mod)

The intercept is 91 and the slope is 0.97

This is an equation for

brain ~ body brain ~ intercept + slopebody brain ~ 91 + 0.97body

ggscatter(data = mammals,
       y = "brain",
       x = "body", 
       add = "reg.line") +
  stat_regline_equation()

References on regession and regression equations

For general information on how to interpret regression equations see these papers

Boldina & Beninger. 2016. Strengthening statistical usage in marine ecology: Linear regression. Journal of Experimental Marine Biology & Ecology

Marril. 2004. Advanced Statistics: Linear Regression, Part I: Simple Linear Regression. Emergency Medicine

Marril 2008. Advanced Statistics: Linear Regression, Part II: Multiple Linear Regression. Emergency Medicine

Schneider et al 2010. Linear regression analysis: part 14 of a series on evaluation of scientific publications. Deutsches Ärzteblatt.

Zuur & Ieno. 2016. A protocol for conducting and presenting results of regression‐type analyses https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.12577



brouwern/mammalsmilkRA documentation built on May 3, 2019, 7:39 p.m.