coef.logitchoice: Return estimated coefficients from fitted logitchoice object.

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

View source: R/coef.logitchoice.r

Description

Returns the model coefficients for each lambda.

Usage

1
2
## S3 method for class 'logitchoice'
coef(object, lambdaIndex = NULL, ...)

Arguments

object

Fitted "logitchoice" model object.

lambdaIndex

Index of lambda value at which to extract coefficients. If NULL, return the coefficients for all values of lambda in the path.

...

Not used.

Details

Returns the actual main effect and interaction coefficients. These satisfy the sum constraints in the original linear interaction model.

Value

A matrix of dimension nvars x length(lambdaIndex).

Author(s)

Michael Lim and
Maintainer: Michael Lim michael626@gmail.com

See Also

predict.logitchoice, logitchoice

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  groupSizes = sample(6:18, 100, replace=TRUE)
  numGroups = length(groupSizes)
  n = sum(groupSizes)
  p = 10
  X = matrix(rnorm(n*p), nrow=n)
  X = scale(X)
  Y = rep(0, n)
  Y[cumsum(groupSizes)] = 1
  grouping = rep(1:numGroups, groupSizes)
  fit = logitchoice(X, Y, grouping)
max(abs(fit$betahat - coef(fit)))

logitchoice documentation built on May 29, 2017, 11:56 a.m.