make.mon.ui | R Documentation |
Function make.mon.ui
creates the matrix ui
for a factor, depending on its coding.
make.mon.ui(x, type = "coeff", contr = NULL)
x |
an |
type |
the situation for which |
contr |
relevant in case of Explicit choices for |
The function determines the matrix ui
as needed for the functions in
packge ic.infer, when a monotone increase from first to last level
of the x
is under investigation (type = "coeff"
)
or when a monotone increase among the components of the expectation vector is
investigated (type = "mean"
). The respective monotone decrease can be accomodated
by -make.mon.ui()
.
If the coding of the factor x
is explicitly given, the function throws an error
if the actual coding does not correspond to the specified value of contr
.
Care is needed when using make.mon.ui
with a linear model: It is the users responsibility
to make sure that the coding used in the model corresponds to the coding used in
make.mon.ui
.
a square matrix with as many rows and columns as there are dummy variables for the factor
Ulrike Groemping, BHT Berlin
See also contrasts
for how to apply contrasts,
contrast
for the available contrasts in package stats,
contr.diff
for the specific monotonicity contrast function
from this package.
gifte <- boot::poisons ## gifte is German for poisons
## default: contr.treatment (with default base 1)
linmod <- lm(1/time~poison+treat, gifte)
summary(orlm(linmod, ui=make.mon.ui(gifte$poison), index=2:3))
## next: contr.diff
contrasts(gifte$poison) <- "contr.diff"
linmod <- lm(1/time~poison+treat, gifte)
summary(orlm(linmod, ui=make.mon.ui(gifte$poison), index=2:3))
## next: contr.SAS
contrasts(gifte$poison) <- "contr.SAS"
linmod <- lm(1/time~poison+treat, gifte)
summary(orlm(linmod, ui=make.mon.ui(gifte$poison), index=2:3))
## next: contr.sum
contrasts(gifte$poison) <- "contr.sum"
linmod <- lm(1/time~poison+treat, gifte)
summary(orlm(linmod, ui=make.mon.ui(gifte$poison), index=2:3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.