predict.ConsReg {ConsReg} | R Documentation |
Predict or fitted values of object ConsReg
Description
Predict or fitted values of object ConsReg
Usage
## S3 method for class 'ConsReg'
predict(object, newdata = NULL, components = F, ...)
Arguments
object |
object of class |
newdata |
New data to predict the objective function. If is NULL (default), then the fitted values will be returned |
components |
if its |
... |
Additional argument passed to family. In particular, at this moment, if type = 'link', then for binomial family, it will return the link values |
Value
predictions
Examples
data('fake_data')
data = fake_data
data$y = 1/(1+exp(-data$y))
data$y = ifelse(data$y > .5, 1, 0)
table(data$y)
fit5 = ConsReg(y~x1+x2+x3+x4, data = data,
family = 'binomial', penalty = 10000,
LOWER = -.5, UPPER = .2,
optimizer = 'gosolnp')
pr = predict(fit5, newdata = data[1:3,], type = 'probability')
pr
[Package ConsReg version 0.1.0 Index]