# stepSGB: Stepwise backward elimination for SGB regression In SGB: Simplicial Generalized Beta Regression

## Description

Stepwise elimination of the non significant regression parameters. Possibility to assign a fixed value  shape1 to the overall shape parameter.

## Usage

 1 2 3 4 5 stepSGB(obj0, d, u, weight = rep(1, dim(d)[1]), shape10 = obj0[["par"]][1], bound = 2.1, shape1 = NULL, Mean2 = TRUE, maxiter = 10, control.optim = list(fnscale = -1), control.outer = list(itmax = 1000, ilack.max = 200, trace = TRUE, kkt2.check = TRUE, method = "BFGS") ) 

## Arguments

 obj0 object of class regSGB, see regSGB. d data matrix of explanatory variables (without constant vector) (n \times m); n: sample size, m: number of auxiliary variables. u data matrix of compositions (independent variables) (n \times D); D: number of parts. weight vector of length n; positive observation weights, default rep(1,n). Should be scaled to sum to n. shape10 positive number, initial value of the overall shape parameter, default obj0[["par"]][1]. bound inequality constraints on the estimates of shapes: shape1*shape2[i] > bound, i=1,...,D. By default bound = 2.1, see InequalityConstr. shape1 fixed value of the overall shape parameter. Default is NULL (no fixed value). Mean2 logical, if TRUE (default), the initial shape2 parameters are each replaced by their average. See initpar.SGB. maxiter maximum number of iterations, i.e. attempts to set a parameter to 0. control.optim list of control parameters for optim, see optim. Default is from auglag, except list(fnscale = -1). Always specify fnscale = -1. control.outer list of control parameters to be used by the outer loop in constrOptim.nl, see auglag. Default is from auglag, except list(itmax = 1000, ilack.max = 200).

## Details

This is an experimental procedure for searching a set of non-significant parameters that will be set to zero. The shape parameters are excluded from the elimination procedure. The algorithm starts with obj0, output of regSGB. The p-values for the regression parameters in summary(obj0) are taken in decreasing order. The parameter with the largest p-value is set to zero and regSGB computes the regression with this constraint. If the AIC value is smaller than the AIC in obj0, the parameter with the next largest p-value in obj0 is set to zero and the regression with the two constraints is computed. The process iterates until either a larger AIC is found or maxiter is attained.
The initial value of the overall shape parameter is set to the estimated value in the full model obj0. The other initial values are computed as in regSGB.
There is the possibility to fix the value of the overvall shape parameter, if shape1 is given a positive number a_0 (default NULL, no fixed value).
If regSGB was called without Formula, the data-frame with auxiliary variables for stepSGB follows the same rules as for the initial regSGB object, see Example 1 in regSGB.

## Value

A list of class 'stepSGB' with the following 5 components:

 reg  A list with the following components: full Object of class regSGB, same as obj0, see regSGB. iter1 Object of class regSGB obtained at iteration 1. ... iterk Object of class regSGB obtained at iteration k.

 Formula  The original formula, or NULL iter  Value of k, the last iteration. tab  Data frame with k+1 columns, overall results and k iterations. The rows are value Log-likelihood n.par Total number of parameters (including the shape2 param.) n.par.fixed Number of fixed parameters. AIC Value of the AIC criterion. convergence 0 if converged. kkt1 1 if first Karush-Kuhn-Tucker criterion fulfilled, zero otherwise. kkt2 1 if second Karush-Kuhn-Tucker criterion fulfilled, zero otherwise. counts.function Number of times the objective function (the log-likelihood) was evaluated. counts.gradient Number of times the gradient was evaluated. \ call  Arguments for calling stepSGB.

## References

regSGB, initpar.SGB, auglag.
  1 2 3 4 5 6 7 8 9 10 11 data(carseg) ## Extract the compositions uc <- as.matrix(carseg[,(1:5)]) ## Initial regression data(ocar) step_ocar <- stepSGB(ocar, carseg, uc, bound=2.1, control.outer=list(trace=FALSE)) summary(step_ocar[["reg"]][["full"]]) summary(step_ocar[["reg"]][["iter4"]]) step_ocar[["tab"]]