llbt.fit {prefmod} | R Documentation |
Function to fit an LLBT using an ELIMINATE feature
llbt.fit(y, Xmodel, q, ncat, maxiter = 100)
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) |
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.
Reinhold Hatzinger
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)
## fit basic model casewise data(cemspc) mfr<-llbt.design(cemspc,nitems=6,objnames=c("lo","pa","mi","sg","ba","st"), blnCasewise=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 data(cemspc) 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)