Description Usage Arguments Details Value See Also Examples
Fitting a specific set of multivariate regression models with order restrictions.
1 2 |
formula |
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. |
data |
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which lm is called. |
set |
either a character string (see |
direction |
direction of the order constraints |
n |
a (possibly named) vector of sample sizes for each group |
base |
column of the constraint matrix representing a control group |
control |
a list of control arguments; see |
This function is just a wrapper for repeated calls of orlm
with different constraint definitions. Predefined lists with constraint-sets can be constructed with function constrSet
.
a list with orlm objects
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ########################
## Artificial example ##
########################
n <- 10
m <- c(1,2,4,5,2,1)
nm <- length(m)
dat <- data.frame(grp=as.factor(rep(1:nm, each=n)),
y=rnorm(n*nm, rep(m, each=n), 1))
(cs <- constrSet(table(dat$grp), set="sequence"))
(oss <- orlmSet(y ~ grp-1, data=dat, set=cs))
# the same as:
oss <- orlmSet(y ~ grp-1, data=dat, set="sequence")
|
Loading required package: nlme
$`1<2`
$`1<2`$constr
1 2 3 4 5 6
[1,] -1 1 0 0 0 0
$`1<2`$rhs
[1] 0
$`1<2`$nec
[1] FALSE
$`1<2<3`
$`1<2<3`$constr
1 2 3 4 5 6
[1,] -1 1 0 0 0 0
[2,] 0 -1 1 0 0 0
$`1<2<3`$rhs
[1] 0 0
$`1<2<3`$nec
[1] FALSE FALSE
$`1<2<3<4`
$`1<2<3<4`$constr
1 2 3 4 5 6
[1,] -1 1 0 0 0 0
[2,] 0 -1 1 0 0 0
[3,] 0 0 -1 1 0 0
$`1<2<3<4`$rhs
[1] 0 0 0
$`1<2<3<4`$nec
[1] FALSE FALSE FALSE
$`1<2<3<4<5`
$`1<2<3<4<5`$constr
1 2 3 4 5 6
[1,] -1 1 0 0 0 0
[2,] 0 -1 1 0 0 0
[3,] 0 0 -1 1 0 0
[4,] 0 0 0 -1 1 0
$`1<2<3<4<5`$rhs
[1] 0 0 0 0
$`1<2<3<4<5`$nec
[1] FALSE FALSE FALSE FALSE
$`1<2<3<4<5<6`
$`1<2<3<4<5<6`$constr
1 2 3 4 5 6
[1,] -1 1 0 0 0 0
[2,] 0 -1 1 0 0 0
[3,] 0 0 -1 1 0 0
[4,] 0 0 0 -1 1 0
[5,] 0 0 0 0 -1 1
$`1<2<3<4<5<6`$rhs
[1] 0 0 0 0 0
$`1<2<3<4<5<6`$nec
[1] FALSE FALSE FALSE FALSE FALSE
$unconstrained
$unconstrained$constr
1 2 3 4 5 6
[1,] 0 0 0 0 0 0
$unconstrained$rhs
[1] 0
$unconstrained$nec
[1] FALSE
$`1<2`
Call:
orlm.formula(formula = formula, data = data, constr = s$constr,
rhs = s$rhs, nec = s$nec, control = control)
Coefficients:
grp1 grp2 grp3 grp4 grp5 grp6
1.1631 2.4225 4.8757 5.3762 2.0901 0.7771
$`1<2<3`
Call:
orlm.formula(formula = formula, data = data, constr = s$constr,
rhs = s$rhs, nec = s$nec, control = control)
Coefficients:
grp1 grp2 grp3 grp4 grp5 grp6
1.1631 2.4225 4.8757 5.3762 2.0901 0.7771
$`1<2<3<4`
Call:
orlm.formula(formula = formula, data = data, constr = s$constr,
rhs = s$rhs, nec = s$nec, control = control)
Coefficients:
grp1 grp2 grp3 grp4 grp5 grp6
1.1631 2.4225 4.8757 5.3762 2.0901 0.7771
$`1<2<3<4<5`
Call:
orlm.formula(formula = formula, data = data, constr = s$constr,
rhs = s$rhs, nec = s$nec, control = control)
Coefficients:
grp1 grp2 grp3 grp4 grp5 grp6
1.1631 2.4225 4.1140 4.1140 4.1140 0.7771
$`1<2<3<4<5<6`
Call:
orlm.formula(formula = formula, data = data, constr = s$constr,
rhs = s$rhs, nec = s$nec, control = control)
Coefficients:
grp1 grp2 grp3 grp4 grp5 grp6
1.163 2.423 3.280 3.280 3.280 3.280
$unconstrained
Call:
orlm.formula(formula = formula, data = data, constr = s$constr,
rhs = s$rhs, nec = s$nec, control = control)
Coefficients:
grp1 grp2 grp3 grp4 grp5 grp6
1.1631 2.4225 4.8757 5.3762 2.0901 0.7771
attr(,"class")
[1] "list" "orlmlist"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.