# gammaFit: Iteratively estimate variance model parameter gamma In PracTools: Tools for Designing and Weighting Survey Samples

 gammaFit R Documentation

## Iteratively estimate variance model parameter \gamma

### Description

Iteratively computes estimate of \gamma in a model with E_M(y)=x^T\beta and Var_M(y)=\sigma^2x^\gamma.

### Usage

gammaFit(X, x, y, maxiter = 100, show.iter = FALSE, tol = 0.001)


### Arguments

 X matrix of predictors in the linear model for y x vector of x's for individual units in the assumed specification of Var_M(y) y vector of dependent variables for individual units maxiter maximum number of iterations allowed show.iter should values of \gamma be printed of each iteration? TRUE or FALSE tol size of relative difference in \hat{\gamma}'s between consecutive iterations used to determine convergence. Algorithm terminates when relative difference is less than tol.

### Details

The function gammaFit estimates the power \gamma in a model where the variance of the errors is proportional to x^\gamma for some covariate x. Values of \gamma are typically in [0,2]. The function calls gamEst.

### Value

A list with the components:

 g.hat estimate of \gamma when iterative procedure stopped converged TRUE or FALSE depending on whether convergence was obtained steps number of steps used by the algorithm

### Author(s)

Richard Valliant, Jill A. Dever, Frauke Kreuter

### References

Valliant, R., Dever, J., Kreuter, F. (2018, chap. 3). Practical Tools for Designing and Weighting Survey Samples, 2nd edition. New York: Springer.

gamEst

### Examples

data(hospital)
x <- hospital$x y <- hospital$y

X <- cbind(sqrt(x), x)
gammaFit(X = X, x = x, y = y, maxiter=100, tol=0.001)


PracTools documentation built on Nov. 9, 2023, 9:06 a.m.