DirichletRegModel: Methods for the Class 'DirichletRegModel'

Description Usage Arguments Author(s) Examples

Description

These are available methods for the results of Dirichlet regression models and objects of class DirichletRegModel. These methods contain functions for print and summary of the data, generate fitted values and predicting new values using predict. Various types of residuals are implemented and confint can be used to compute confidence intervals of the parameters. Furthermore logLik extracts the log-likelihood of the model and vcov extracts the covariance matrix of the parameter estimates.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
## S3 method for class 'DirichletRegModel'
print(x, digits = max(3, getOption("digits") - 3), ...)

## S3 method for class 'DirichletRegModel'
summary(object, ...)

## S3 method for class 'DirichletRegModel'
fitted(object, mu = TRUE, alpha = FALSE, phi = FALSE, ...)

## S3 method for class 'DirichletRegModel'
predict(object, newdata, mu = TRUE, alpha = FALSE, phi = FALSE, ...)

## S3 method for class 'DirichletRegModel'
residuals(object, type = c("standardized", "composite", "raw"), ...)

## S3 method for class 'DirichletRegModel'
confint(object, parm, level, ..., type=c("all", "beta", "gamma"), exp = FALSE)

## S3 method for class 'DirichletRegConfint'
print(x, digits = 3, ...)

## S3 method for class 'DirichletRegModel'
logLik(object, ...)

## S3 method for class 'DirichletRegModel'
AIC(object, ..., k = 2)

## S3 method for class 'DirichletRegModel'
BIC(object, ...)

## S3 method for class 'DirichletRegModel'
nobs(object, ...)

## S3 method for class 'DirichletRegModel'
vcov(object, ...)

## S3 method for class 'DirichletRegModel'
update(object, formula., ..., evaluate = TRUE)

## S3 method for class 'DirichletRegModel'
drop1(object, scope, test = c("LRT", "none"), k = 2, sort = TRUE, ...)

Arguments

x

an object of class DirichletRegModel

object

an object of class DirichletRegModel or DirichletRegConfint for printing an object obtained by confint.DirichletRegModel

alpha

logical; returns alpha values

mu

logical; returns expected values

phi

logical; returns precision values

type

for residuals: defines the type of residuals to be computed "standardized" (i.e., Pearson), "composite", or "raw"

for confint: defines the type of parameter ("all", "beta", or "gamma") for which confidence values are returned

newdata

a data.frame containing new observations

k

number for the weighting of parameters

parm

a vector containing names of the parameters to print

level

(a vector of) confidence level(s), defaults to .95

exp

logical; returns parameters in exponentiated form

digits

the number of digits in the output

formula.

the new formula to be updated, see update.formula and update.Formula

evaluate

if FALSE the updated call will be returned, but not evaluated

scope

defines the scope of variables to be dropped, see drop1

test

defines the type of test for drop1

sort

if TRUE, p-values will be sorted in decreasing order.

...

further arguments

Author(s)

Marco J. Maier

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
ALake <- ArcticLake
ALake$AL <- DR_data(ArcticLake[, 1:3])

mod1 <- DirichReg(AL ~ depth + I(depth^2) | depth, data = ALake, model="alternative")

update(mod1, . ~ . | . + I(depth^2), evaluate = FALSE)
mod1

drop1(mod1)   ### issues a caveat when used for the first time in an R session

summary(mod1)

head(fitted(mod1))

predict(mod1, newdata = data.frame("depth" = seq(10, 100, 10)))

head(residuals(mod1))

confint(mod1)
confint(mod1, exp = TRUE)

logLik(mod1)
round(vcov(mod1), 5)

Example output

Loading required package: Formula
Warning in DR_data(ArcticLake[, 1:3]) :
  not all rows sum up to 1 => normalization forced
DirichReg(formula = AL ~ depth + I(depth^2) | depth + I(depth^2), 
    data = ALake, model = "alternative")
Call:
DirichReg(formula = AL ~ depth + I(depth^2) | depth, data = ALake, model =
"alternative")
using the alternative parametrization

Log-likelihood: 107.8 on 8 df (95 BFGS + 2 NR Iterations)

MEAN MODELS:
-----------------------------------------
Coefficients for variable no. 1: sand
- variable omitted (reference category) -
-----------------------------------------
Coefficients for variable no. 2: silt
(Intercept)        depth   I(depth^2)  
 -1.2885187    0.0706992   -0.0003247  
-----------------------------------------
Coefficients for variable no. 3: clay
(Intercept)        depth   I(depth^2)  
 -2.9754613    0.1064013   -0.0005161  
-----------------------------------------

PRECISION MODEL:
-----------------------------------------
(Intercept)        depth  
    1.32438      0.04177  
-----------------------------------------
CAVEAT: drop1() is still an experimental feature. If you plan to use this
        function, please double-check results, e.g., by comparing two models
        using anova().
Single term deletions

Model:
AL ~ depth + I(depth^2) | depth
                 Df Deviance     AIC    LRT  Pr(>Chi)    
<none>               -215.68 -199.68                     
Mean: I(depth^2)  2  -202.37 -190.37 13.308  0.001289 ** 
Mean: depth       2  -185.52 -173.52 30.157 2.829e-07 ***
Prec: depth       1  -182.59 -168.59 33.087 8.814e-09 ***
---
Signif. codes:  0***0.001**0.01*0.05.’ 0.1 ‘ ’ 1
Call:
DirichReg(formula = AL ~ depth + I(depth^2) | depth, data = ALake, model =
"alternative")

Standardized Residuals:
          Min       1Q   Median      3Q     Max
sand  -1.7598  -0.7459  -0.1833  1.0148  2.7250
silt  -1.1459  -0.5379  -0.1581  0.2467  1.5572
clay  -1.9269  -0.6106  -0.0617  0.6294  1.9976

MEAN MODELS:
------------------------------------------------------------------
Coefficients for variable no. 1: sand
- variable omitted (reference category) -
------------------------------------------------------------------
Coefficients for variable no. 2: silt
              Estimate Std. Error z value Pr(>|z|)    
(Intercept) -1.2885187  0.3835030  -3.360  0.00078 ***
depth        0.0706992  0.0147385   4.797 1.61e-06 ***
I(depth^2)  -0.0003247  0.0001210  -2.684  0.00727 ** 
------------------------------------------------------------------
Coefficients for variable no. 3: clay
              Estimate Std. Error z value Pr(>|z|)    
(Intercept) -2.9754613  0.4973405  -5.983 2.19e-09 ***
depth        0.1064013  0.0180002   5.911 3.40e-09 ***
I(depth^2)  -0.0005161  0.0001429  -3.612 0.000303 ***
------------------------------------------------------------------

PRECISION MODEL:
------------------------------------------------------------------
            Estimate Std. Error z value Pr(>|z|)    
(Intercept) 1.324382   0.357461   3.705 0.000211 ***
depth       0.041773   0.006604   6.325 2.53e-10 ***
------------------------------------------------------------------
Significance codes: 0***0.001**0.01*0.05.’ 0.1 ‘ ’ 1

Log-likelihood: 107.8 on 8 df (95 BFGS + 2 NR Iterations)
AIC: -199.7, BIC: -186.4
Number of Observations: 39
Links: Logit (Means) and Log (Precision)
Parametrization: alternative
          sand      silt       clay
[1,] 0.5878381 0.3263858 0.08577610
[2,] 0.5655708 0.3410547 0.09337446
[3,] 0.5467019 0.3532332 0.10006483
[4,] 0.5432735 0.3554206 0.10130588
[5,] 0.4972825 0.3839724 0.11874513
[6,] 0.4871840 0.3900359 0.12278004
            [,1]      [,2]       [,3]
 [1,] 0.59466851 0.3218234 0.08350812
 [2,] 0.42659217 0.4247056 0.14870228
 [3,] 0.28598015 0.4908362 0.22318362
 [4,] 0.18696231 0.5184104 0.29462729
 [5,] 0.12394802 0.5203210 0.35573099
 [6,] 0.08568946 0.5103458 0.40396475
 [7,] 0.06288266 0.4979281 0.43918924
 [8,] 0.04950947 0.4884452 0.46204530
 [9,] 0.04207675 0.4846797 0.47324354
[10,] 0.03871648 0.4879630 0.47332057
        sand        silt       clay
1  0.9919461 -0.73098860 -0.5196036
2  0.8264901 -0.51849202 -0.5632384
3 -0.2172116  0.04425618  0.2898421
4 -0.1081184  0.31301128 -0.3180409
5  1.1641424 -0.70238386 -0.7433259
6  1.0327887 -0.40495044 -0.9711209

95% Confidence Intervals (original form)

- Beta-Parameters:
Variable: sand
  variable omitted

Variable: silt
               2.5%    Est.   97.5%
(Intercept)  -2.040  -1.289  -0.537
depth         0.042   0.071   0.100
I(depth^2)   -0.001   0.000   0.000

Variable: clay
               2.5%    Est.   97.5%
(Intercept)  -3.950  -2.975  -2.001
depth         0.071   0.106   0.142
I(depth^2)   -0.001  -0.001   0.000

- Gamma-Parameters
              2.5%   Est.  97.5%
(Intercept)  0.624  1.324  2.025
depth        0.029  0.042  0.055


95% Confidence Intervals (exponentiated)

- Beta-Parameters:
Variable: sand
  variable omitted

Variable: silt
              2.5%  exp(Est.)  97.5%
(Intercept)  0.130      0.276  0.585
depth        1.043      1.073  1.105
I(depth^2)   0.999      1.000  1.000

Variable: clay
              2.5%  exp(Est.)  97.5%
(Intercept)  0.019      0.051  0.135
depth        1.074      1.112  1.152
I(depth^2)   0.999      0.999  1.000

- Gamma-Parameters
             2.5%  exp(Est.)  97.5%
(Intercept)  1.87       3.76   7.58
depth        1.03       1.04   1.06

'log Lik.' 107.8401 (df=8)
                  silt:(Intercept) silt:depth silt:I(depth^2) clay:(Intercept)
silt:(Intercept)           0.14707   -0.00528           4e-05          0.11699
silt:depth                -0.00528    0.00022           0e+00         -0.00471
silt:I(depth^2)            0.00004    0.00000           0e+00          0.00004
clay:(Intercept)           0.11699   -0.00471           4e-05          0.24735
clay:depth                -0.00440    0.00020           0e+00         -0.00853
clay:I(depth^2)            0.00003    0.00000           0e+00          0.00006
(phi):(Intercept)         -0.04142    0.00191          -2e-05         -0.09849
(phi):depth                0.00076   -0.00003           0e+00          0.00176
                  clay:depth clay:I(depth^2) (phi):(Intercept) (phi):depth
silt:(Intercept)    -0.00440           3e-05          -0.04142     0.00076
silt:depth           0.00020           0e+00           0.00191    -0.00003
silt:I(depth^2)      0.00000           0e+00          -0.00002     0.00000
clay:(Intercept)    -0.00853           6e-05          -0.09849     0.00176
clay:depth           0.00032           0e+00           0.00362    -0.00007
clay:I(depth^2)      0.00000           0e+00          -0.00003     0.00000
(phi):(Intercept)    0.00362          -3e-05           0.12778    -0.00212
(phi):depth         -0.00007           0e+00          -0.00212     0.00004

DirichletReg documentation built on May 18, 2021, 5:06 p.m.