| UtilLesWghts | R Documentation | 
Determine the lesion weights distribution 2D matrix of a dataset or manually specify the lesion weights distribution.
UtilLesWghtsDS(dsOrArr, relWeights = 0)
UtilLesWghtsLD(LDOrArr, relWeights = 0)
dsOrArr | 
 A dataset object or a 1D-array, see UtilLesDistr.  | 
relWeights | 
 The relative weights of the lesions: a unit sum vector of 
length equal to the maximum number of lesions per dis. case. For example, 
  | 
LDOrArr | 
 The lesion distribution (LD) dataframe object produced by UtilLesDistr or a 1D-array.  | 
Two characteristics of an FROC dataset, apart from the 
ratings, affect the FOM: the distribution of lesion per case and the 
distribution of lesion weights. This function addresses the weights. 
The distribution of lesions is addressed in UtilLesDistr. 
See 
PlotRsmOpChrs for a function that depends on 
lesWghtDistr. 
The underlying assumption is that lesion 1 is the same type across all 
diseased cases, lesion 2 is the same type across all diseased cases, 
..., etc. This allows assignment of weights independent of the case index.
The lesion distribution (LD) dataframe object produced by UtilLesDistr or a 1D-array.
UtilLesWghtsDS (dataset01) # FROC data
##      [,1] [,2] [,3]
##[1,]    1  1.0 -Inf
##[2,]    2  0.5  0.5
UtilLesWghtsDS (dataset02) # ROC data
##      [,1] [,2]
##[1,]    1  1
UtilLesWghtsDS(c(0.7,0.2,0.1)) # only frequencies supplied
## relWeights defaults to zero
## Dataset with 1 to 4 lesions per case, with frequency as per first argument
UtilLesWghtsLD (c(0.6, 0.2, 0.1, 0.1), c(0.2, 0.4, 0.1, 0.3))
##       [,1]  [,2]      [,3]      [,4]   [,5]
##[1,]    1 1.0000000      -Inf      -Inf -Inf 
##[2,]    2 0.3333333 0.6666667      -Inf -Inf
##[3,]    3 0.2857143 0.5714286 0.1428571 -Inf
##[4,]    4 0.2000000 0.4000000 0.1000000  0.3
## Explanation 
##> c(0.2)/sum(c(0.2))
##[1] 1 ## (weights for cases with 1 lesion)
##> c(0.2, 0.4)/sum(c(0.2, 0.4))
##[1] 0.3333333 0.6666667 ## (weights for cases with 2 lesions)
##> c(0.2, 0.4, 0.1)/sum(c(0.2, 0.4, 0.1))
##[1] 0.2857143 0.5714286 0.1428571 ## (weights for cases with 3 lesions)
##> c(0.2, 0.4, 0.1, 0.3)/sum(c(0.2, 0.4, 0.1, 0.3))
##[1] 0.2000000 0.4000000 0.1000000  0.3 ## (weights for cases with 4 lesions)
UtilLesWghtsLD (c(0.1, 0.7, 0.0, 0.2), c(0.4, 0.3, 0.2, 0.1)) 
## Weights are included for non-existent `lesionID` = 3 but corresponding frequency will be zero
##      [,1]       [,2]       [,3]       [,4] [,5]
## [1,]    1 1.00000000       -Inf       -Inf -Inf
## [2,]    2 0.57142857 0.42857143       -Inf -Inf
## [3,]    3 0.44444444 0.33333333 0.22222222 -Inf
## [4,]    4 0.40000000 0.30000000 0.20000000  0.1
UtilLesWghtsDS(dataset05, relWeights = c(0.78723404, 0.17021277, 0.04255319))
##      [,1]       [,2]       [,3]       [,4]
## [1,]    1 1.00000000       -Inf       -Inf
## [2,]    2 0.82222222 0.17777778       -Inf
## [3,]    3 0.78723404 0.17021277 0.04255319
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.