Learn R Programming

qut (version 2.2)

predict.qut: Make predictions from a "qut" object.

Description

Similar to other predict methods, this function predicts fitted values from a fitted "qut" object

Usage

# S3 method for qut
predict(object, newx, mode = "glm", offset = NULL,...)
# S3 method for qut
coef(object, mode = "glm",...)

Arguments

object

fitted "qut" model object.

newx

matrix of new values for X at which predictions are to be made. Must be a matrix.

mode

make predictions with lasso coefficients (type=lasso) or with fitted glm coefficients (type=glm). Default is glm.

offset

if an offset is used in the fit, then one must be supplied for making predictions

...

not used. Other arguments to predict.

Value

a vector/matrix of fitted values

See Also

qut

Examples

Run this code
# NOT RUN {
	set.seed(1234)
	x=matrix(rnorm(200*20),200,20)
	y1=x[,1]*10+rnorm(100)

	fit1=qut(y1,x,family=gaussian,sigma=1)
	predict(fit1,newx=x[1:5,])
	predict(fit1,newx=x[1:5,],mode='lasso')
	y1[1:5]
	
	coef(fit1,mode='lasso')
	coef(fit1,mode='glm')

# }

Run the code above in your browser using DataLab