Plot the conditional density using the predicted scenarios
Plot the conditional density using the predicted scenarios
Plots the conditional density for the predicted scenarios provided. It produces a pdf with a page for each predictive scenario provided. Each page has a plot of the predicted response, in the order as they were provided to the function. Note that fixed effects are not processed in this function. This function has been developed for Bernoulli, Normal and Survival response only. This function has been developed for Discrete and Normal covariates only.
Silvia Liverani, David I. Hastie, Lamiae Azizi, Michail Papathomas, Sylvia Richardson (2015). PReMiuM: An R Package for Profile Regression Mixture Models Using Dirichlet Processes. Journal of Statistical Software, 64(7), 1-30. tools:::Rd_expr_doi("10.18637/jss.v064.i07") .
Examples
## Not run:# example with Bernoulli outcome and Discrete covariatesinputs <- generateSampleDataFile(clusSummaryBernoulliDiscrete())# prediction profilespreds<-data.frame(matrix(c(2,2,2,2,2,0,0,NA,0,0),ncol=5,byrow=TRUE))colnames(preds)<-names(inputs$inputData)[2:(inputs$nCovariates+1)]# run profile regressionrunInfoObj<-profRegr(yModel=inputs$yModel, xModel=inputs$xModel, nSweeps=10000, nBurn=10000, data=inputs$inputData, output="output", covNames=inputs$covNames,predict=preds, fixedEffectsNames = inputs$fixedEffectNames)dissimObj <- calcDissimilarityMatrix(runInfoObj)clusObj <- calcOptimalClustering(dissimObj)riskProfileObj <- calcAvgRiskAndProfile(clusObj)predictions <- calcPredictions(riskProfileObj,fullSweepPredictions=TRUE,fullSweepLogOR=TRUE)plotPredictions(outfile="predictiveDensity.pdf",runInfoObj=runInfoObj, predictions=predictions,logOR=TRUE)## End(Not run)