lcpm: Fitting a Log Cumulative Probability Model

Description Usage Arguments Value Note References See Also Examples

View source: R/lcpm.R

Description

lcpm provides the maximum likelihood estimate for ordinal outcomes (J>2 categories) and a Generalized Linear Model (GLM) with the log link without the assumption of proportionality. That is, lcpm determines the MLE for log[P(y <= j)]= cut_j + X beta_j subject to [cut_j-1 + X beta_j-1 <= cut_j + X beta_j] and [cut_j + X beta_j <=0]. This implementation uses constrOptim to determine the MLE and so the results account for the restricted parameter space.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
lcpm(
  formula.linear,
  data,
  conf.level = 0.95,
  y.order = NULL,
  startval = NULL,
  less.than.0 = TRUE,
  control.list = NULL,
  eps.outer = NULL,
  ...
)

Arguments

formula.linear

an object of class "formula": a symbolic description of the linear model to be fitted.

data

dataframe containing the data in linear model.

conf.level

optional confidence level (1-alpha) defaulted to 0.95.

y.order

optional if y contains ordered integer categories 1:J. If y is not ordered integer 1:J then this is a vector with the ordinal values for y ranging from the lowest to largest ordinal outcome. See Examples below.

startval

optional vector of the starting values.

less.than.0

optional logical for constraint cut_j <= 0 for all j=1:(J-1). Default is TRUE.

control.list

optional list of controls for constrOptim

eps.outer

option for constrOptim

...

Additional arguments for built in functions

Value

list of class "lcpm" is returned containing:

coefficients

vector of the estimate of cut_j and beta_j

se

vector of the estimate of standard errors

vcov

matrix of the inverse of the negative Hessian

fitted.values

matrix of unique covariates and the corresponding estimate of the cumulative probabilities: exp(X %*% coefficients)

loglik

numerical value of the log-likelihood at the maximum likelihood estimate

barrier.value

value of mu in the log-barrier algorithm

outer.iterations

value of the number of outer iterations

formula

formula in the call of lcpm

startvalues

vector of the starting values for constrained optimization algorithm

proptest

Score test if a proportionality assumption is appropriate, includes test statistic (teststat), p-value (pval), df, and fitted proportional probability model (propmodel)

Note

A warning of MLE close to the boundary must be carefully considered. Data may have some structure that requires attention. Additionally, there is no imputation. Any NA results in complete row removal.

References

Singh, G; Fick, G.H. Ordinal outcomes: a cumulative probability model with the log link without an assumption of proportionality. Manuscript in preparation.

See Also

ppm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Example below showing the use of y.order if outcome is not integers 1:J.
# See examples in ppm for an additional example


var_a <- c(rep(0,60),rep(1,60))
var_b <- c(rep(0,90),rep(1,30))
y1<-c(rep(2,5),rep(3,10),rep(5,5),rep(10,10),
rep(2,5),rep(3,10),rep(5,10),rep(10,5),
rep(2,10),rep(3,5),rep(5,5),rep(10,10),
rep(2,10),rep(3,5),rep(5,10),rep(10,5))

testdata<-data.frame(y=y1,var_a=var_a,var_b=var_b)

# LCPM estimates for non-proportional model
test1<-lcpm(y ~ var_a + var_b, data=testdata, y.order=c(2,3,5,10))
summary(test1)

# The proportional probability model used for the score test
summary(test1$proptest$propmodel)

lcpm documentation built on Jan. 9, 2020, 9:07 a.m.

Related to lcpm in lcpm...