R/ppmodel.R

Defines functions ppmodel

Documented in ppmodel

###
### ppmodel.R
###

ppmodel <- function(nlpfit) {
  postmodel <- apply(nlpfit$postModel==1,1,function(z) paste(which(z),collapse=','))
  ans <- table(postmodel)
  ans <- ans[order(ans,decreasing=TRUE)]
  nvars <- sapply(strsplit(names(ans),split=','),length)
  ans <- data.frame(selectVars=names(ans),nvars=nvars,count=ans,posprob=ans/sum(ans))
  rownames(ans) <- NULL
  return(ans)
}

Try the mombf package in your browser

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

mombf documentation built on Dec. 6, 2019, 3:01 a.m.