llbt.fit: Function to fit an LLBT

Description Usage Arguments Details Author(s) References Examples

View source: R/llbt.fit.R

Description

Function to fit an LLBT using an ELIMINATE feature

Usage

1
llbt.fit(y, Xmodel, q, ncat, maxiter = 100)

Arguments

y

response , usually counts

Xmodel

design matrix

q

number of parameters to eliminate (usually number of comparisons times number of subject covariate levels

ncat

number of response categories

maxiter

nmaximum number of iterations (default 100)

Details

Be careful when specifying the design matrix. Since there is no extrinsic aliasing the matrix msut have full rank. Usually, one of the design columns for object must be left out.

Author(s)

Reinhold Hatzinger

References

Reinhold Hatzinger, Brian J. Francis: Fitting Paired Comparison Models in R. (http://epub.wu-wien.ac.at/dyn/openURL?id=oai:epub.wu-wien.ac.at:epub-wu-01_709)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# fit basic model casewise
mfr <- llbt.design(cemspc, nitems = 6,
    objnames = c("lo", "pa", "mi", "sg", "ba", "st"),
    casewise=TRUE)
mm   <- model.matrix(~ lo+pa+mi+sg+ba + g1, data = mfr)
X    <- mm[, -1]
p    <- ncol(X)
ncat <- 3
q    <- length(levels(mfr$mu)) * length(levels(mfr$CASE))
llbt.fit(mfr$y, X, q, ncat)


# fit the (aggregated) model with one subject covariate
mfr <- llbt.design(cemspc, nitems = 6,
    objnames = c("lo", "pa", "mi", "sg", "ba", "st"),
    cov.sel = "ENG")
eng  <- mfr$ENG
eng  <- factor(eng)
mm   <- model.matrix(~ lo+pa+mi+sg+ba + g1 + (lo+pa+mi+sg+ba):eng, data = mfr)
X    <- mm[, -1]
q    <- length(levels(mfr$mu)) * length(levels(eng))
ncat <- 3
llbt.fit(mfr$y, X, q, ncat)

prefmod documentation built on May 19, 2017, 4:41 p.m.

Search within the prefmod package
Search all R packages, documentation and source code