gw: Fitting GWRM Models

Description Usage Arguments Value Examples

View source: R/gw.r

Description

gw is used to fit Generalized Waring Regression Models (GWRM), specified by giving a symbolic description of the linear predictor.

Usage

1
2
3
4
gw(formula, data, weights, k = NULL, subset, na.action, kstart = 1,
  rostart = 2, betastart = NULL, offset, control = list(...),
  method = NULL, hessian = TRUE, model = TRUE, x = FALSE, y = TRUE,
  ...)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula).

weights

an optional vector of 'prior weights' to be used in the fitting process. Should be NULL or a numeric vector.

k

optional value for the k parameter. If NULL, it is estimated.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

na.action

a function which indicates what should happen when the data contain NA values. See glm.

kstart

starting value for the k parameter.

rostart

starting value for the ro parameter.

betastart

starting values for the vector of means.

offset

this can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector of length equal to the number of cases. One or more offset terms can be included in the formula instead or as well, and if more than one is specified their sum is used. See model.offset.

control

a list of parameters for controlling the fitting process.

method

the method to be used in fitting the model. The default method initially uses non-linear minimization (nlm) and Nelder-Mead optimization (optim) to fit a model which is then re-fitted by "L-BFGS-B" (optim). In this way, SE estimates for all the model parameters are provided. "nlm" and "Nelder-Mead" are also possible values, but they do not provide SE estimates for k and ro.

hessian

if TRUE, the hessian of f at the minimum is returned.

model

a logical value indicating whether model frame should be included as a component of the returned value.

x,y

For gw: logical values indicating whether the response vector and model matrix used in the fitting process should be returned as components of the returned value.

For gw.fit: x is a design matrix of dimension n * p, and y is a vector of observations of length n.

...

further arguments.

Value

gw returns an object of class "gw". The function summary can be used to obtain or print a summary of the results. An object of class "gw" is a list containing the following components:

Examples

1
2
data(goals)
gw(goals ~ position + offset(log(played)), data = goals)

ujaen-statistics/GWRM documentation built on July 18, 2021, 7:02 a.m.