dummy.coef.glmb: Extract Coefficients in Original Coding

Description Usage Arguments Details Value Examples

Description

This extracts coefficients in terms of the original levels of the coefficients rather than the coded variable

Usage

1
2
3
4
5
## S3 method for class 'glmb'
dummy.coef(object, use.na = FALSE, ...)

## S3 method for class 'dummy_coef.glmb'
print(x, ...)

Arguments

object

a glmb model fit

use.na

logical flag for coefficients in a singular model. If use.na is true, undetermined coefficients will be missing; if false they will get one possible value.

x

object to be printed

...

arguments passed to or from other methods

Details

A fitted linear model has coefficients for the contrasts of the factor terms, usually one less in number than the number of levels. This function re-expresses the coefficients in the original coding; as the coefficients will have been fitted in the reduced basis, any implied constraints (e.g., zero sum for contr.helmert or contr.sum) will be respected. There will be little point in using dummy.coef for contr.treatment contrasts, as the missing coefficients are by definition zero.

Value

A list giving for each term the draws for the coefficients.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
set.seed(333)
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
mysd<-1
mu<-matrix(0,5)
mu[1]=log(mean(counts))
V0<-((mysd)^2)*diag(5)
glmb.D93<-glmb(n=1000,counts ~ outcome + treatment, 
family = poisson(),pfamily=dNormal(mu=mu,Sigma=V0))
summary(glmb.D93)


myd=dummy.coef(glmb.D93)
print(myd)

knygren/glmbayes documentation built on Sept. 4, 2020, 4:39 p.m.