library(tidyverse)
library(ggplot2)
library(lme4)
devtools::load_all(".")
orders <- mammals %>%
    filter(order == 'Artiodactyla' | order == 'Carnivora' | order == 'Cetacea' | order == 'Insectivora' | order == 'Lagomorpha' | order == 'Primates' | order == 'Rodentia' )

library(broom)
library(ggthemes)
mammals_sub
d <- lmer(log.oy ~ log.wm + (log.wm | order), data = mammals_sub)
summary(d)
lme4::ranef(d)
library(broom)
tidy(d, conf.int = TRUE)
broom::augment(d) %>%
    ggplot(aes(x = log.wm, y = .fixed)) +
    geom_line() +
    geom_point(aes(x = log.wm, y = log.oy, color = order), alpha = 0.2) +
    geom_line(aes(y = .fitted, color = order), alpha = 0.8) + 
    team_theme()
install.packages("MuMIn")
base <- glm(log.oy ~ log.wm , data=orders.again)
summary(base)
tidy(d, conf.int=TRUE)
broom::augment(base) %>%
    ggplot(aes(x=log.wm, y=.fitted)) +
    geom_line() +
    geom_point(aes(x=log.wm, y=log.oy)) +
    geom_line(aes(y=.fitted)) + 
  team_theme()
library(MuMIn)
MuMIn::model.sel(d, base, rank=AIC)
mammals_sub


UofTCoders/eeb430.2017.Python documentation built on May 28, 2019, 3:19 p.m.