Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gammaFit

Iteratively estimate variance model parameter γ


Description

Iteratively computes estimate of γ in a model with E_M(y)=x^Tβ and Var_M(y)=σ^2x^γ.

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 γ be printed of each iteration? TRUE or FALSE

tol

size of relative difference in \hat{γ}'s between consecutive iterations used to determine convergence. Algorithm terminates when relative difference is less than tol.

Details

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

Value

A list with the components:

g.hat

estimate of γ 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. (2013, chap. 3). Practical Tools for Designing and Weighting Survey Samples. New York: Springer.

See Also

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

Tools for Designing and Weighting Survey Samples

v1.2.2
GPL (>= 2)
Authors
Richard Valliant, Jill A. Dever, Frauke Kreuter
Initial release
2020-07-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.