Learn R Programming

PReMiuM (version 3.0.24)

calcAvgRiskAndProfile: Calculation of the average risks and profiles

Description

Calculation of the average risks and profiles.

Usage

calcAvgRiskAndProfile(clusObj, includeFixedEffects=F)

Arguments

clusObj
Object of type clusObj.
includeFixedEffects
By default this is set to FALSE. If it is set to FALSE then the risk profile is computed with the parameters beta of the fixed effects assumed equal to zero. If it is set to TRUE, then risk profile at each sweep is computed adjusting for the sample of the

Value

  • A list with the following components. This is an object of type riskProfileObj.
  • riskProfClusObjThe object of type clusObj as given in the input of this function.
  • riskA matrix that has a column for each cluster and a row for each sweep. Each element of the matrix represents the estimated risk at each sweep for each cluster.
  • profileAn array whose first dimension is the number of sweeps, the second is the number of clusters, the third is the number of discrete covariates and the fourth is the number of categories of each of the covariates. Each element of the array represents the covariate profile at each sweep for each cluster. The fourth dimension does not exists if the covariate type is Normal. If the covariate type is mixed, then instead of this element, the two elements below are defined, 'profilePhi' and 'profileMu'.
  • profileStarThis is NULL if there has not been any variable selection. otherwise it contains the
  • empiricalsA vector of length of the optimal number of clusters, where each value is the empirical mean of the outcome for each cluster.
  • profileStdDevAn array whose first dimension is the number of sweeps, the second is the number of clusters, the third and the fourth are the number of continuous covariates. Each square matrix identified by the first and second dimension of the array represents the standard deviation at each sweep for each cluster. This element is only available if the covariate type is continuous or mixed.
  • profilePhiThis array is the equivalent of the 'profile' above for discrete covariates in case of mixed covariates.
  • profileStarPhiThis array is defined as profile and profilePhi, but the values are computed only if a variable selection procedure has been run. The definition of the star profile is given in Liverani, S., Hastie, D. I. and Richardson, S. (2013) PReMiuM: An R package for Bayesian profile regression.
  • profileMuThis array is the equivalent of the 'profile' above for Normal covariates in case of mixed covariates.
  • profileStarMuThis array is defined as profile and profileMu, but the values are computed only if a variable selection procedure has been run. The definition of the star profile is given in Liverani, S., Hastie, D. I. and Richardson, S. (2013) PReMiuM: An R package for Bayesian profile regression.

Authors

David Hastie, Department of Epidemiology and Biostatistics, Imperial College London, UK

Silvia Liverani, Department of Epidemiology and Biostatistics, Imperial College London and MRC Biostatistics Unit, Cambridge, UK

Maintainer: Silvia Liverani

References

Liverani, S., Hastie, D. I., Azizi, L., Papathomas, M. and Richardson, S. (2013) PReMiuM: An R package for Profile Regression Mixture Models using Dirichlet Processes. Submitted. Available at http://uk.arxiv.org/abs/1303.2836

Examples

Run this code
generateDataList <- clusSummaryBernoulliDiscrete()
inputs <- generateSampleDataFile(generateDataList)
runInfoObj<-profRegr(yModel=inputs$yModel, xModel=inputs$xModel, nSweeps=10, 
    nBurn=20, data=inputs$inputData, output="output", nClusInit=15,
    covNames=inputs$covNames)

dissimObj<-calcDissimilarityMatrix(runInfoObj)
clusObj<-calcOptimalClustering(dissimObj)
riskProfileObj<-calcAvgRiskAndProfile(clusObj)

Run the code above in your browser using DataLab