gammaFit {PracTools} | 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 |
y |
vector of dependent variables for individual units |
maxiter |
maximum number of iterations allowed |
show.iter |
should values of |
tol |
size of relative difference in |
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 |
converged |
|
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.
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.002)