pattLrep.fit(obj, nitems, tpoints = 1, formel = ~1, elim = ~1,
resptype = "ratingT", obj.names=NULL, undec = TRUE, ia = FALSE,
iaT = FALSE, NItest = FALSE, pr.it = FALSE)formel is not ~1 then
elim will be set to the highest interaction between all terms
contained i"ratingT" by default and is reserved for future usage.
Any other specification will not change the behaviour of pattLrep.fitundec = TRUE.ia = TRUE.iaT = TRUE, dependence parameters for each item between
two successive time points.NItest = TRUE. Currently,
NItest is set to FALSE if subject covariates are specified.TRUEpattLrep.fit returns an object of class pattMod. The function
print (i.e., print.pattMod) can be used to
print the results and the function patt.worth to
produce a matrix of worth parameters. An object of class pattMod
is a list containing the following components:coefficients),
log likelihood of the model (ll), log likelihood of the saturated model
(fl), and the callnlm.covdesmat, paired comparison reponse pattern matrix
Y, etc.partsList is again a list containing
counts, missing value pattern, the CL matrix represented as the vector s, and
the specification of the covariates. Use str to inspect
the elements and see example below.NA,
rows with less than 2 valid responses are removed from the fit
and a message is printed.
Optional subject covariates have to be specified
such that the categories are represented by consecutive integers
starting with 1. Rows with missing values for subject covariates are
removed from the data and a message is printed. Again, the leftmost columns in
the data must be the ratings, optionally followed by columns for
categorical subject covariates.
The data specified via obj are supplied using either a data frame
or a datafile in which case obj is a path/filename. The input
data file if specified must be a plain text file with variable names in
the first row as readable via the command read.table(datafilename,
header = TRUE).formel and elim arguments. formel specifies the
actual model to be fitted. For instance, if specified as
formel=~SEX different preference scale for the objects will be
estimated for males and females. For two or more covariates,
the operators + or * can be used to model main or interaction
effects, respectively. The operator : is not allowed (redundant terms
are removed automatically). See also formula.
The specification for elim follows the same rules as for
formel. However, elim specifies the basic contingency
table to be set up but does not specify any covariates to be fitted.
This is done using formel.
If, e.g., elim=~SEX but formel=~1,
then the table is set up as if SEX would be fitted but only one global
preference scale is computed. This feature
allows for the succesive fitting of nested models to enable the use of
deviance differences for model selection (see example below).pattL.fit,patt.design, pattPC.fit, pattR.fit, pattRrep.fit# simulated data: 3 items, 2 timepoints
dat <- as.data.frame(matrix(sample(1:5, 300, replace = TRUE), ncol = 6))
res <- pattLrep.fit(dat, nitems = 3, tpoints = 2, iaT = TRUE)
res
patt.worth(res, obj.names = LETTERS[1:3])Run the code above in your browser using DataLab