star.sequential: Effect stars for sequential logit models

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

The package EffectStars2 provides a more up-to-date implementation of effect stars!

The function computes and visualizes sequential logit models. The computation is done with help of the package VGAM. The visualization is based on the function stars from the package graphics.

Usage

1
2
3
4
5
6
7
star.sequential(formula, data, global = NULL, test.rel = TRUE, test.glob = FALSE,
    globcircle = FALSE, maxit = 100, scale = TRUE, nlines = NULL, select = NULL, 
    dist.x = 1, dist.y = 1, dist.cov = 1, dist.cat = 1, xpd = TRUE, main = "", 
    col.fill = "gray90", col.circle = "black", lwd.circle = 1, 
    lty.circle = "longdash", col.global = "black", lwd.global = 1, 
    lty.global = "dotdash", cex.labels = 1, cex.cat = 0.8, xlim = NULL, 
    ylim = NULL)

Arguments

formula

An object of class “formula”. Formula for the sequential logit model to be fitted an visualized.

data

An object of class “data.frame” containing the covariates used in formula.

global

Numeric vector to choose a subset of predictors to be included with global coefficients. Default is to include all coefficients category-specific. Numbers refer to total amount of predictors, including intercept and dummy variables.

test.rel

Provides a Likelihood-Ratio-Test to test the relevance of the explanatory covariates. The corresponding p-values will be printed as p-rel. test.rel=FALSE might save a lot of time.

test.glob

Provides a Likelihood-Ratio-Test to test if a covariate has to be included as a category-specific covariate (in contrast to being global). The corresponding p-values will be printed as p-global. test.glob=FALSE and globcircle=FALSE might save a lot of time.

globcircle

If TRUE, additional circles that represent the global effects of the covariates are plotted. test.glob=FALSE and globcircle=FALSE might save a lot of time.

maxit

Maximal number of iterations to fit the sequential logit model. See also vglm.control.

scale

If TRUE, the stars are scaled to equal maximal ray length.

nlines

If specified, nlines gives the number of lines in which the effect stars are plotted.

select

Numeric vector to choose only a subset of the stars to be plotted. Default is to plot all stars. Numbers refer to total amount of predictors, including intercept and dummy variables.

dist.x

Optional factor to increase/decrease distances between the centers of the stars on the x-axis. Values greater than 1 increase, values smaller than 1 decrease the distances.

dist.y

Optional factor to increase/decrease distances between the centers of the stars on the y-axis. Values greater than 1 increase, values smaller than 1 decrease the distances.

dist.cov

Optional factor to increase/decrease distances between the stars and the covariates labels above the stars. Values greater than 1 increase, values smaller than 1 decrease the distances.

dist.cat

Optional factor to increase/decrease distances between the stars and the category labels around the stars. Values greater than 1 increase, values smaller than 1 decrease the distances.

xpd

If FALSE, all plotting is clipped to the plot region, if TRUE, all plotting is clipped to the figure region, and if NA, all plotting is clipped to the device region. See also par.

main

An overall title for the plot. See also plot.

col.fill

Color of background of the circle. See also col in par.

col.circle

Color of margin of the circle. See also col in par.

lwd.circle

Line width of the circle. See also lwd in par.

lty.circle

Line type of the circle. See also lty in par.

col.global

Color of margin of the global effects circle. See also col in par. Ignored, if globcircle = FALSE.

lwd.global

Line width of the global effects circle. See also lwd in par. Ignored, if globcircle = FALSE.

lty.global

Line type of the global effects circle. See also lty in par. Ignored, if globcircle = FALSE.

cex.labels

Size of labels for covariates placed above the corresponding star. See also cex in par.

cex.cat

Size of labels for categories placed around the corresponding star. See also cex in par.

xlim

Optional specification of the x coordinates ranges. See also xlim in plot.window

ylim

Optional specification of the y coordinates ranges. See also ylim in plot.window

Details

The underlying models are fitted with the function vglm from the package VGAM. The family argument for vglm is sratio(parallel=FALSE).

The stars show the exponentials of the estimated coefficients. In sequential logit models the exponential coefficients can be interpreted as odds. More precisely, the exponential e^{γ_{rj}}, r=1,…,k-1 represents the multiplicative effect of the covariate j on the continuation ratio odds \frac{P(Y=r|x)}{P(Y>r|x)} if x_j increases by one unit.

In addition to the stars, we plot a cirlce that refers to the case where the coefficients of the corresponding star are zero. Therefore, the radii of these circles are always exp(0)=1. If scale=TRUE, the stars are scaled so that they all have the same maximal ray length. In this case, the actual appearances of the circles differ, but they still refer to the no-effects case where all the coefficients are zero. Now the circles can be used to compare different stars based on their respective circles radii. The p-values beneath the covariate labels, which are given out if test.rel=TRUE, correspond to the distance between the circle and the star as a whole. They refer to a likelihood ratio test if all the coefficients from one covariate are zero (i.e. the variable is left out completely) and thus would lie exactly upon the cirlce.
The appearance of the circles can be modified by col.circle, lwd.circle and lty.circle.

By setting globcircle=TRUE, an addictional circle can be drawn. The radii now correspond to a model, where the respective covariate is not included category-specific but globally. Therefore, the distance between this circle and the star as a whole corresponds to the p-value p-global that is given if test.glob=TRUE.

It is strongly recommended to standardize metric covariates, display of effect stars can benefit greatly as in general differences between the coefficients are increased.

Value

P-values are only available if the corresponding option is set TRUE.

odds

Odds or exponential coefficients of the sequential logit model

coefficients

Coefficients of the sequential logit model

se

Standard errors of the coefficients

p_rel

P-values of Likelihood-Ratio-Tests for the relevance of the explanatory covariates

p_global

P-values of Likelihood-Ratio-Tests wether the covariates need to be included category-specific

xlim

xlim values that were automatically produced. May be helpfull if you want to specify your own xlim

ylim

ylim values that were automatically produced. May be helpfull if you want to specify your own ylim

Author(s)

Gunther Schauberger
gunther.schauberger@tum.de
https://www.sg.tum.de/epidemiologie/team/schauberger/

References

Tutz, G. and Schauberger, G. (2012): Visualization of Categorical Response Models - from Data Glyphs to Parameter Glyphs, Journal of Computational and Graphical Statistics 22(1), 156-177.

Gerhard Tutz (2012): Regression for Categorical Data, Cambridge University Press

See Also

star.nominal, star.cumulative

Examples

1
2
3
4
5
6
7
## Not run: 
data(insolvency)

star.sequential(Insolvency ~ Sector + Legal + Pecuniary_Reward + Seed_Capital
+ Debt_Capital + Employees, insolvency, test.glob = FALSE, globcircle = TRUE, dist.x = 1.3)

## End(Not run)

Example output

Loading required package: VGAM
Loading required package: stats4
Loading required package: splines
***
The package EffectStars is not the latest implementation of effect stars, 
it is recommended to use EffectStars2 instead!
***
$odds
                  (Intercept) Sectorcommerce Sectorservice industry
odds(P[Y=1|Y>=1])  0.17561738       1.015447               1.041395
odds(P[Y=2|Y>=2])  0.07943945       1.955999               1.482950
odds(P[Y=3|Y>=3])  0.02300911       4.323460               4.290193
odds(P[Y=4|Y>=4])  0.03750044       2.700746               1.956079
odds(P[Y=5|Y>=5])  0.02061177       3.118456               3.356045
odds(P[Y=6|Y>=6])  0.04247058       1.783488               2.347249
                  Legalone man business    LegalGmBH LegalGbR, KG, OHG
odds(P[Y=1|Y>=1])             0.6858798 1.534129e-07         0.6758912
odds(P[Y=2|Y>=2])             0.5486068 3.269772e-01         0.6376350
odds(P[Y=3|Y>=3])             1.2333083 1.476791e-01         1.1227249
odds(P[Y=4|Y>=4])             0.5667274 1.421075e-01         0.7920397
odds(P[Y=5|Y>=5])             2.0601617 5.252218e-01         4.1345631
odds(P[Y=6|Y>=6])             0.2312470 1.851771e-01         0.6078331
                  Pecuniary_Rewardadditional Seed_Capital> 25000
odds(P[Y=1|Y>=1])                  0.4567339          0.09335455
odds(P[Y=2|Y>=2])                  1.2195652          0.42016714
odds(P[Y=3|Y>=3])                  1.0122849          1.11137649
odds(P[Y=4|Y>=4])                  2.0509194          0.63073375
odds(P[Y=5|Y>=5])                  0.6304500          0.38991900
odds(P[Y=6|Y>=6])                  3.3073341          1.86400642
                  Debt_Capitalyes Employees> 2
odds(P[Y=1|Y>=1])       2.2249313    0.6174437
odds(P[Y=2|Y>=2])       1.4734342    1.2884936
odds(P[Y=3|Y>=3])       0.8978703    0.6413286
odds(P[Y=4|Y>=4])       1.6049822    0.9782275
odds(P[Y=5|Y>=5])       1.0245101    0.6955203
odds(P[Y=6|Y>=6])       0.3905674    0.3997563

$coefficients
                       (Intercept) Sectorcommerce Sectorservice industry
logitlink(P[Y=1|Y>=1])   -1.739448      0.0153293             0.04056132
logitlink(P[Y=2|Y>=2])   -2.532760      0.6709010             0.39403306
logitlink(P[Y=3|Y>=3])   -3.771865      1.4640559             1.45633167
logitlink(P[Y=4|Y>=4])   -3.283403      0.9935282             0.67094173
logitlink(P[Y=5|Y>=5])   -3.881893      1.1373381             1.21076315
logitlink(P[Y=6|Y>=6])   -3.158944      0.5785709             0.85324400
                       Legalone man business   LegalGmBH LegalGbR, KG, OHG
logitlink(P[Y=1|Y>=1])            -0.3770528 -15.6901329        -0.3917232
logitlink(P[Y=2|Y>=2])            -0.6003733  -1.1178648        -0.4499892
logitlink(P[Y=3|Y>=3])             0.2097002  -1.9127136         0.1157586
logitlink(P[Y=4|Y>=4])            -0.5678769  -1.9511713        -0.2331438
logitlink(P[Y=5|Y>=5])             0.7227845  -0.6439345         1.4193817
logitlink(P[Y=6|Y>=6])            -1.4642688  -1.6864426        -0.4978549
                       Pecuniary_Rewardadditional Seed_Capital> 25000
logitlink(P[Y=1|Y>=1])                -0.78365443          -2.3713506
logitlink(P[Y=2|Y>=2])                 0.19849439          -0.8671027
logitlink(P[Y=3|Y>=3])                 0.01221002           0.1055993
logitlink(P[Y=4|Y>=4])                 0.71828819          -0.4608715
logitlink(P[Y=5|Y>=5])                -0.46132136          -0.9418163
logitlink(P[Y=6|Y>=6])                 1.19614246           0.6227282
                       Debt_Capitalyes Employees> 2
logitlink(P[Y=1|Y>=1])      0.79972604  -0.48216735
logitlink(P[Y=2|Y>=2])      0.38759583   0.25347376
logitlink(P[Y=3|Y>=3])     -0.10772968  -0.44421325
logitlink(P[Y=4|Y>=4])      0.47311267  -0.02201299
logitlink(P[Y=5|Y>=5])      0.02421459  -0.36309510
logitlink(P[Y=6|Y>=6])     -0.94015485  -0.91690024

$se
                       (Intercept) Sectorcommerce Sectorservice industry
logitlink(P[Y=1|Y>=1])   0.5881327      0.5823069              0.5754202
logitlink(P[Y=2|Y>=2])   0.5074392      0.4556767              0.4635765
logitlink(P[Y=3|Y>=3])   0.7876534      0.7404356              0.7413618
logitlink(P[Y=4|Y>=4])   0.6662614      0.6096970              0.6215566
logitlink(P[Y=5|Y>=5])   0.8671284      0.7719186              0.7665086
logitlink(P[Y=6|Y>=6])   0.6821514      0.6217999              0.6125099
                       Legalone man business   LegalGmBH LegalGbR, KG, OHG
logitlink(P[Y=1|Y>=1])             0.3491397 469.8580606         0.4460096
logitlink(P[Y=2|Y>=2])             0.3137769   0.4115745         0.3615460
logitlink(P[Y=3|Y>=3])             0.3447993   0.6049860         0.4083810
logitlink(P[Y=4|Y>=4])             0.3658928   0.6029517         0.4068952
logitlink(P[Y=5|Y>=5])             0.5063849   0.7129934         0.5171544
logitlink(P[Y=6|Y>=6])             0.5254381   0.5706510         0.4805166
                       Pecuniary_Rewardadditional Seed_Capital> 25000
logitlink(P[Y=1|Y>=1])                  0.3497732           0.5249049
logitlink(P[Y=2|Y>=2])                  0.2852715           0.3202548
logitlink(P[Y=3|Y>=3])                  0.3231631           0.3416503
logitlink(P[Y=4|Y>=4])                  0.3358002           0.3788952
logitlink(P[Y=5|Y>=5])                  0.4062107           0.4206556
logitlink(P[Y=6|Y>=6])                  0.3959170           0.4450993
                       Debt_Capitalyes Employees> 2
logitlink(P[Y=1|Y>=1])       0.3489165    0.3663873
logitlink(P[Y=2|Y>=2])       0.2808158    0.2830114
logitlink(P[Y=3|Y>=3])       0.3302155    0.3180963
logitlink(P[Y=4|Y>=4])       0.3442941    0.3404903
logitlink(P[Y=5|Y>=5])       0.4102248    0.3791932
logitlink(P[Y=6|Y>=6])       0.4981974    0.4234093

$p_rel
     Sectorcommerce Sectorservice industry Legalone man business    LegalGmBH
[1,]     0.02019306             0.04156506           0.003709244 2.694355e-10
     LegalGbR, KG, OHG Pecuniary_Rewardadditional Seed_Capital> 25000
[1,]        0.05743264                 0.00214324         5.05262e-08
     Debt_Capitalyes Employees> 2
[1,]      0.04626055    0.1160858

$xlim
[1] 18.93675 84.48040

$ylim
[1] 12.40833 84.22099

EffectStars documentation built on Oct. 30, 2019, 9:39 a.m.