R/predict.lae.r

predict.lae <- function(object,newdata=NULL,clean=T,...){   
    if(is.null(newdata)){newdata<-data.frame(object$setup[[1]])}
    if(clean==T){newdata <- newdata[,colnames(newdata)%in%colnames(object$setup[[1]])]}
    pred <- model.matrix(~.,data=newdata)%*%matrix(object$coefficients[,1],ncol=1)
    if(object[[6]][[2]]=="binomial"){pred <- plogis(pred)}
    return(pred)
}

Try the MAMI package in your browser

Any scripts or data that you put into this service are public.

MAMI documentation built on May 6, 2019, 3:02 p.m.