SpecifyCoefficient {cmm} | R Documentation |
Gives the generalized exp-log specification for various coefficients
SpecifyCoefficient(name, arg, rep=1)
name |
character: name of desired coefficient |
arg |
an argument specific to the coefficient, e.g., a vector of scores or number of rows and colums. |
rep |
number of repetitions of the coefficient |
Currently the following coefficients are implemented:
SpecifyCoefficient("Mean",scores) SpecifyCoefficient("Variance",scores) SpecifyCoefficient("StandardDeviation",scores) SpecifyCoefficient("GiniMeanDifference",scores) SpecifyCoefficient("Entropy",k) SpecifyCoefficient("DiversityIndex",k) SpecifyCoefficient("Covariance",list(xscores,yscores)) SpecifyCoefficient("Correlation",list(xscores,yscores)) SpecifyCoefficient("KendallTau",list(r,c)) SpecifyCoefficient("GoodmanKruskalGammma",list(r,c)) SpecifyCoefficient("CohenKappa",r) SpecifyCoefficient("DifferenceInProportions",m) SpecifyCoefficient("LogOddsRatio",) SpecifyCoefficient("LoglinearParameters",dim) SpecifyCoefficient("Probabilities",dim) SpecifyCoefficient("LogProbabilities",dim) SpecifyCoefficient("ConditionalProbabilities",list(var,condvar,dim))
Here, scores
is a score vector, e.g., c(1,2,3,4,5)
; k
is the number of cells in a table;
r
is the number of rows and columns of a square table; dim
is the dimension of the table. "LoglinearParameters"
gives the highest order loglinear parameters (loglinear parameters can also be obtained as output of SampleStatistics
,
ModelStatistics
or MarginalModelFit
by setting ShowParameters=TRUE
and the coefficients equal to log probabilities.
output is of the form list(matlist,funlist)
where matlist
is a list of matrices and funlist
is a list of function names,
which can currently be "log"
, "exp"
, "identity"
, "xlogx"
(i.e., f(x) = x log(x)),
"xbarx"
(i.e., f(x)=x(1-x)), "sqrt"
W. P. Bergsma w.p.bergsma@lse.ac.uk
Bergsma, W. P. (1997). Marginal models for categorical data. Tilburg, The Netherlands: Tilburg University Press. http://stats.lse.ac.uk/bergsma/pdf/bergsma_phdthesis.pdf
Bergsma, W. P., Croon, M. A., & Hagenaars, J. A. P. (2009). Marginal models for dependent, clustered, and longitudunal categorical data. Berlin: Springer.
ConstraintMatrix
, DesignMatrix
, MarginalMatrix
SpecifyCoefficient("Mean",c(1,2,3)) SpecifyCoefficient("Variance",c(1,2,3)) SpecifyCoefficient("StandardDeviation",c(1,2,3)) SpecifyCoefficient("GiniMeanDifference",c(1,2,3)) SpecifyCoefficient("Entropy",5) SpecifyCoefficient("DiversityIndex",5) SpecifyCoefficient("Covariance",list(c(1,2,3),c(1,2,3))) SpecifyCoefficient("Correlation",list(c(1,2,3),c(1,2,3))) SpecifyCoefficient("KendallTau",list(3,4)) SpecifyCoefficient("GoodmanKruskalGammma",list(3,4)) SpecifyCoefficient("CohenKappa",3) SpecifyCoefficient("DifferenceInProportions",1) SpecifyCoefficient("LogOddsRatio",1) SpecifyCoefficient("LoglinearParameters",c(3,3)) SpecifyCoefficient("Probabilities",8) SpecifyCoefficient("LogProbabilities",8) # conditional probabilities for 3x3 table, conditioning on first variable SpecifyCoefficient("ConditionalProbabilities",list(c(1,2),c(1),c(3,3)))