predict.hetprobit: Predictions and Residuals for Heteroscedastic Probit Models

Description Usage Arguments Details Value References See Also Examples

Description

Methods for obtaining predictions and residuals from a fitted heteroscedastic probit model object.

Usage

1
2
3
4
5
6
## S3 method for class 'hetprobit'
predict(object, newdata = NULL,
    type = c("response", "link", "scale"),
    na.action = na.pass, ...)
## S3 method for class 'hetprobit'
residuals(object, type = c("standardized", "pearson", "response"), ...)

Arguments

object

a fitted object of class inheriting from hetprobit.

newdata

optional. A data frame in which to look for variables with which to predict can be supplied. If omitted, the fitted linear predictors are used.

type

the type of prediction/residuals required: The default is on the scale of the response, i.e. probabilities. The alternative link is on the scale of the scaled linear predictor and scale returns predictions for the scale parameter sigma.
The default for residuals are standardized/Pearson residuals. Alternatively, raw response residuals can be extracted by specifying type = "response".

na.action

function determining what should be done with missing values in newdata. The default is to predict NA.

...

currently not used.

Details

If newdata is omitted the predictions are based on the data used for fitting.

In addition to the methods above, a set of standard extractor functions for "hetprobit" objects is available, see hetprobit for an overview.

Value

A vector of predictions/residuals.

References

Alvarez R.M. and Brehm J. (1995) American Ambivalence Towards Abortion Policy: Development of a Heteroskedastic Probit Model of Competing Values. American Journal of Political Science, 39(4), 1055–1082.

Greene W.H. (2012) “Econometric Analysis”, Pearson, Prentice Hall, Seventh Edition.

Harvey A.C. (1976) Estimating Regression Models with Multiplicative Heteroscedasticity. Econometrica, 44(3), 461–465.

Keele L.J. and Park D.K. (2006) Ambivalent about Ambivalence: A Re-examination of Heteroskedastic Probit Models. Unpublished manuscript, Penn State University.

See Also

hetprobit

Examples

 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
31
32
33
## data-generating process
dgp <- function(n = 500, coef = c(0.5, -1.5, 0, 1, 0)) {
  d <- data.frame(
    x1 = runif(n, -1, 1),
    x2 = runif(n, -1, 1)
  )
  d$ystar <- rnorm(n,
    mean = coef[1] + coef[2] * d$x1 + coef[3] * d$x2,
    sd = exp(coef[4] * d$x1 + coef[5] * d$x2)
  )
  d$y <- ifelse(d$ystar > 0, 1, 0)
  return(d)
}

## data
set.seed(2017-05-20)
d <- dgp()

## estimate model
m1 <- hetprobit(y ~ x1 + x2, data = d)

## create some new data
nd <- data.frame(x1 = seq(from = -1, to = 5, length.out = 10), 
                 x2 = seq(from = 0.5, to = 5, length.out = 10))

## predicted probabilities (default)
p1 <- predict(m1, newdata = nd)

## predictions on scaled linear predictor
p2 <- predict(m1, newdata = nd, type = "link")

## predictions for scale parameter sigma
p3 <- predict(m1, newdata = nd, type ="scale")

hetprobit documentation built on May 2, 2019, 5:19 p.m.