# hetprobit2: Heteroscedastic Probit Regression Models v2 In hetprobit2: Heteroscedastic Probit Regression Models v2

## Description

Fitting heteroscedastic probit models via maximum likelihood.

## Usage

 ```1 2 3 4 5 6``` ```hetprobit2(formula, data, subset, na.action, model = TRUE, y = TRUE, x = FALSE, control = hetprobit2_control(...), ...) hetprobit2_fit(x, y, z = NULL, control, ...) hetprobit2_control(maxit = 5000, start = NULL, ...) ```

## Arguments

 `formula` FIXME `data` FIXME `subset` FIXME `na.action` FIXME `model` FIXME `x, y` FIXME `z` FIXME `...` FIXME `control, maxit, start` FIXME

FIXME

## Value

An object of class `"hetprobit2"`.

## References

FIXME

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30``` ```## packages require("glmx") ## data-generating process dgp <- function(n = 100, coef = c(1, 1, -1, 0, 1, 0)) { d <- data.frame( x1 = runif(n, -1, 1), x2 = runif(n, -1, 1) ) d\$ystar <- rnorm(100, mean = coef[1] + coef[2] * d\$x1 + coef[3] * d\$x2, sd = exp(coef[4] + coef[5] * d\$x1 + coef[6] * d\$x2) ) d\$y <- ifelse(d\$ystar > 0, 1, 0) return(d) } ## data set.seed(2017-05-20) d <- dgp() ## ## model fitting (m0 with hetglm.fit from glmx package, m1 with hetprobit2 function) m0 <- hetglm(y ~ x1 + x2, data = d) m1 <- hetprobit2(y ~ x1 + x2, data = d) ## comparison of coefficients cbind(coef(m0), coef(m1)) ## comparison of log-Likelihoods cbind(logLik(m0), logLik(m1)) ```