coef.eoa: coef.eoa - Coefficient extractor for EoA models.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/coef.eoa.r

Description

Extracts the log-linear model coefficients from an eoa model object. See eoa.

Usage

1
2
## S3 method for class 'eoa'
coef(obj)

Arguments

obj

An object of class eoa.

Value

Estimates of the log-linear model's coefficients.

Author(s)

Trent McDonald

See Also

eoa, labels.eoa

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# A 3 year study of 7 sites. 21 "cells". lambda change = 20/year
set.seed(9430834) # fixes Y and g of this example, but not the RNG's used in chains
ns <- 3

ny <- 7
g <- data.frame(
 alpha = rnorm(ns*ny,70,2),
 beta = rnorm(ns*ny,700,25)
)
Y <- rbinom(ns*ny, c(rep(20,ny), rep(40,ny), rep(60,ny)), g$alpha/(g$alpha+g$beta))

df <- data.frame(year=factor(c(rep("2015",ny),rep("2016",ny),rep("2017",ny))),
   Year=c(rep(1,ny),rep(2,ny),rep(3,ny)))

# Uninformed eoa (use low number of iterations because it's and example)
eoa.1 <- eoa(Y~year, g, df, nburn = 1000, niters= 50*10, nthins = 10 )

coef(eoa.1)

tmcd82070/evoab documentation built on May 13, 2020, 11:25 p.m.