Skip to contents

The function mglm4twin is used for fitting multivariate generalized linear models to twin data. The models are specified by a set of lists giving a symbolic description of the linear and matrix linear predictors. The user can choose between a list of link and variance functions. The models are fitted using an estimating function approach, combining the quasi-score function for the regression parameters and the Pearson estimating function for the covariance parameters. For details see Bonat and Jorgensen (2016).

Usage

mglm4twin(linear_pred, matrix_pred, link, variance,
       offset, Ntrial, power_fixed, weights, data, control_initial,
       contrasts, control_algorithm)

Source

Bonat, W. H. and Jorgensen, B. (2016) Multivariate covariance generalized linear models. Journal of Royal Statistical Society - Series C 65:649–675.

Bonat, W. H. (2018). Multiple Response Variables Regression Models in R: The mcglm Package. Journal of Statistical Software, 84(4):1–30.

Arguments

linear_pred

a list of formula see formula for details.

matrix_pred

a list of matrices, in general the output of mt_twin function.

a list of link functions names. Options are: "logit", "probit", "cauchit", "cloglog", "loglog", "identity", "log", "sqrt", "1/mu^2" and "inverse". See mt_link_function for details.

variance

a list of variance functions names. Options are: "constant", "tweedie", "poisson_tweedie", "binomialP" and "binomialPQ".
See mt_variance_function for details.

offset

a list of offset values if any.

Ntrial

a list of number of trials on Bernoulli experiments. It is useful only for binomialP and binomialPQ variance functions.

power_fixed

a list of logicals indicating if the values of the power parameter should be estimated or not.

weights

A list of weights for model fitting. Each element of the list should be a vector of weights of size equals the number of observations. Missing observations should be annotated as NA.

data

a data frame.

control_initial

a list of initial values for the fitting algorithm. If no values are supplied automatic initial values will be provided by the function mt_initial_values.

contrasts

extra arguments to passed to model.matrix.

control_algorithm

a list of arguments to be passed for the fitting algorithm. See fit_mglm for details.

Value

mcglm returns an object of class 'mcglm'.

See also

fit_mglm, mt_link_function and mt_variance_function.

Author

Wagner Hugo Bonat, wbonat@ufpr.br