cpolr: Censored ordered probit

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Censored ordered probit for analysis of anchoring vignettes. Used in the context of anchoring vignettes as a parametric model for breaking ties/interval in non-parametric ranks.

Usage

1
2
3
  cpolr(formula, data, weights, start, ..., subset, na.action,
                 contrasts = NULL, Hess = TRUE, model = TRUE, method =
                 c("probit", "logistic", "cloglog", "cauchit"), debug = 0)

Arguments

formula

A formula representing 'C' range produced by anchors as a function of other variables: cbind(Cs, Ce) ~ x1 + x2

data

a data frame containing two columns Cs, Ce and the covariates identified in the formula.

weights

optional case weights in fitting. Default to 1.

start

initial values for the parameters. This is in the format 'c(coefficients, zeta)'

...

additional arguments to be passed to optim[stats], most often a 'control' argument.

subset

expression saying which subset of the rows of the data should be used in the fit. All observations are included by default.

na.action

a function to filter missing data.

contrasts

a list of contrasts to be used for some or all of the factors appearing as variables in the model formula.

Hess

logical for whether the Hessian (the observed information matrix) should be returned.

model

logical for whether the model matrix should be returned.

method

default is probit; alternatives are logistic or complementary log-log or cauchit (corresponding to a Cauchy latent variable and only available in R >= 2.1.0).

debug

additional printing if > 0

Details

For cpolr, cpolr.method default is probit; for additional options, see method option in polr

Value

An object of classes c("cpolr", "polr"). This has components

coefficients

the coefficients of the linear predictor, which has no intercept.

zeta

the intercepts for the class boundaries.

deviance

the residual deviance.

fitted.values

a matrix, with a column for each level of the response.

lev

the names of the response levels.

terms

the 'terms' structure describing the model.

df.residual

the number of residual degrees of freedoms, calculated using the weights.

edf

the (effective) number of degrees of freedom used by the model.

n, nobs

the (effective) number of observations, calculated using the weights. ('nobs' is for use by 'stepAIC').

call

the matched call.

convergence

the convergence code returned by optim.

niter

the number of function and gradient evaluations used by optim.

Hessian

Hessian matrix from optim.

Note

Related materials and worked examples are available at http://wand.stanford.edu/anchors/

Author(s)

Based on polr function written by Brian Ripley, modifications by Jonathan Wand

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. 4th edition. Springer.

Wand, Jonathan; Gary King; and Olivia Lau. (2007) “Anchors: Software for Anchoring Vignettes”. Journal of Statistical Software. Forthcoming. copy at http://wand.stanford.edu/research/anchors-jss.pdf

Wand, Jonathan and Gary King. (2007) Anchoring Vignetttes in R: A (different kind of) Vignette copy at http://wand.stanford.edu/anchors/doc/anchors.pdf

Gary King and Jonathan Wand. "Comparing Incomparable Survey Responses: New Tools for Anchoring Vignettes," Political Analysis, 15, 1 (Winter, 2007): Pp. 46-66, copy at http://gking.harvard.edu/files/abs/c-abs.shtml.

See Also

anchors, polr

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
data(freedom)

## an example of directly using cpolr:
ra <- anchors(self ~ vign1 + vign3 + vign6, data = freedom, method ="C")
freedom2 <- insert(freedom, ra )
out <- cpolr(cbind(Cs, Ce) ~ as.factor(country) + sex + educ, 
            data = freedom2)
summary(out)


## simplified in the context of anchors:
fo <- list(self= self ~ 1,
           vign = cbind(vign1,vign3,vign6) ~ 1,
           cpolr= ~ as.factor(country) + sex + educ)
ra2 <- anchors(self ~ vign1 + vign3 + vign6, data = freedom, method ="C")
summary(ra, ties="cpolr")

## AVERAGE fitted values
## conditional on observed 
fitted(ra2, ties="cpolr", unconditional=FALSE,average=TRUE)
## unconditional prediction
fitted(ra2, ties="cpolr", unconditional=TRUE,average=TRUE)

## fitted probability for each observation
## conditional on observed 
fitted(ra2, ties="cpolr", unconditional=TRUE, average=FALSE)
## unconditional prediction
fitted(ra2, ties="cpolr", unconditional=TRUE, average=FALSE)

anchors documentation built on May 2, 2019, 6:59 a.m.