Quasi binomial regression for proportions | R Documentation |
Quasi binomial regression for proportions.
prop.reg(y, x, varb = "quasi", tol = 1e-09, maxiters = 100)
prop.regs(y, x, varb = "quasi", tol = 1e-09, logged = FALSE, maxiters = 100)
y |
A numerical vector proportions. 0s and 1s are allowed. |
x |
For the "prop.reg" a matrix with data, the predictor variables. This can be a matrix or a data frame. For the "prop.regs" this must be a numerical matrix, where each columns denotes a variable. |
tol |
The tolerance value to terminate the Newton-Raphson algorithm. This is set to |
varb |
The type of estimate to be used in order to estimate the covariance matrix of the regression coefficients. There are two options, either "quasi" (default value) or "glm". See the references for more information. |
logged |
Should the p-values be returned (FALSE) or their logarithm (TRUE)? |
maxiters |
The maximum number of iterations before the Newton-Raphson is terminated automatically. |
We are using the Newton-Raphson, but unlike R's built-in function "glm" we do no checks and no extra calculations, or whatever. Simply the model. The "prop.regs" is to be used for very many univariate regressions. The "x" is a matrix in this case and the significance of each variable (column of the matrix) is tested. The function accepts binary responses as well (0 or 1).
For the "prop.reg" function a list including:
iters |
The number of iterations required by the Newton-Raphson. |
varb |
The covariance matrix of the regression coefficients. |
phi |
The phi parameter is returned if the input argument "varb" was set to "glm", othwerise this is NULL. |
info |
A table similar to the one produced by "glm" with the estimated regression coefficients, their standard error, Wald test statistic and p-values. |
For the "prop.regs" a two-column matrix with the test statistics (Wald statistic) and the associated p-values (or their loggarithm).
Michail Tsagris
R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.
Papke L. E. & Wooldridge J. (1996). Econometric methods for fractional response variables with an application to 401(K) plan participation rates. Journal of Applied Econometrics, 11(6): 619–632.
McCullagh, Peter, and John A. Nelder. Generalized linear models. CRC press, USA, 2nd edition, 1989.
anova_propreg univglms, score.glms, logistic_only
y <- rbeta(100, 1, 4)
x <- matrix(rnorm(100 * 3), ncol = 3)
a <- prop.reg(y, x)
y <- rbeta(100, 1, 4)
x <- matrix(rnorm(400 * 100), ncol = 400)
b <- prop.regs(y, x)
res<-mean(b[, 2] < 0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.