MarginalModelFit             package:cmm             R Documentation

_M_a_r_g_i_n_a_l_M_o_d_e_l_F_i_t

_D_e_s_c_r_i_p_t_i_o_n:

     Fits marginal model

_U_s_a_g_e:

     MarginalModelFit(dat, model, MaxSteps=1000, MaxStepSize=1, MaxError=1e-20, StartingPoint="Automatic",
         MaxInnerSteps=2, ShowProgress=TRUE, CoefficientDimensions="Automatic",
         Labels="Automatic",ShowCoefficients=TRUE,ShowParameters=FALSE, ParameterCoding="Effect",
         ShowCorrelations=FALSE, Method="ML", Title="" )

_A_r_g_u_m_e_n_t_s:

     dat: vector of frequencies or data frame

   model: list specified eg as 'list(bt,coeff,at)'

MaxSteps: integer: maximum number of steps of the algorithm

MaxStepSize: number greater than 0 and at most 1: step size

MaxError: numeric: maximum error term

StartingPoint: vector of starting frequencies corresponding to all
          cells in the manifest table

MaxInnerSteps: nonnegative integer: only used for latent variable
          models, indicates number of steps in M step of EM algorithms

ShowProgress: boolean or integer: FALSE for no progress information,
          TRUE or 1 for information at every step, an integer k for
          information at every k-th step

CoefficientDimensions: numeric vector of dimensions of the table in
          which the coefficient vector is to be arranged

  Labels: list of characters or numbers indicating labels for
          dimensions of table in which the coefficient vector is to be
          arranged

ShowCoefficients: boolean, indicating whether or not the coefficients
          are to be displayed

ShowParameters: boolean, indicating whether or not the parameters
          (computed from the coefficients) are to be displayed

ParameterCoding: Coding to be used for parameters, choice of
          '"Effect"', '"Dummy"' and  '"Polynomial"'

ShowCorrelations: boolean, indicating whether or not to show the
          correlation matrix for the estimated coefficients

  Method: character, choice of "ML" for maximum likelihood or "GSK" for
          the GSK method

   Title: title of computation to appear at top of screen output

_D_e_t_a_i_l_s:

     The data can be a data frame or vector of frequencies.
     'MarginalModelFit' converts a data frame 'dat' using
     'c(t(ftable(dat)))'.

     The model can be specified in various ways, eg, as
     'list(bt,coeff,at)' where 'bt' may be obtained using
     'ConstraintMatrix', 'coeff' using 'SpecifyCoefficient' and 'at'
     using 'MarginalMatrix'. Alternatively, 'list(coeff,at)' or
     'list(coeff,at)' can be used. Furthermore, 'coeff' can be a
     function, eg, a loglinear marginal model can be specified using
     'list(bt,"log",at)'.

     An extended model specification is 'list(margmodel,x)' where
     'margmodel' has one of the above forms, and 'x' is a design
     matrix, which can be obtained using 'DesignMatrix'. In addition to
     the marginal model 'margmodel', this specifies a loglinear model
     based on design matrix 'x'. Fitting is often more efficient by
     specifying a loglinear model for the joint distribution in this
     way rather than using constraints.

     In the output, coefficients are given. These are that part of
     'model' without the 'bt' matrix, eg if the model is
     'list(bt,coeff,at)' then the coefficients are 'list(coeff,at)'. If
     other coefficients are needed, 'ModelStatistics' can be used.

     Latent variable models can be specified: if the size of the table
     for which 'model' is specified is a multiple of the the size of
     the observed frequencies specified in 'dat', it is assumed this is
     due to the presence of latent variables. With respect to
     vectorization, the latent variables are assumed to change their
     value fastest, ie, their values change fastest.

     Convergence may not be achieved with 'MaxStepSize=1' and a lower
     value may need to be used, not too low or convergence is slow.

_V_a_l_u_e:

     NA. Only output to the screen is provided

_A_u_t_h_o_r(_s):

     W. P. Bergsma w.p.bergsma@lse.ac.uk

_R_e_f_e_r_e_n_c_e_s:

     Bergsma, W. P. (1997). _Marginal models for categorical data_.
     Tilburg, The Netherlands: Tilburg University Press. <URL:
     http://stats.lse.ac.uk/bergsma/pdf/bergsma_phdthesis.pdf>

_S_e_e _A_l_s_o:

     'SampleStatistics', 'ModelStatistics'

_E_x_a_m_p_l_e_s:

     # see also the built-in data sets

     data(NKPS)

     # Compute Goodman and Kruskal's gamma for
     # Child's attitude toward sex role's (NKPS[,3], three categories) and
     # parent's attitude toward sex role's (NKPS[,4], three categories).

     coeff = SpecifyCoefficient("GoodmanKruskalGamma",c(3,3))
     MarginalModelFit(NKPS[,c(3,4)], coeff )

