localScore (version 1.0.6)

RealScores2IntegerScores: Convert a real scores vector into an integer scores vector

Description

Convert real scores into integer scores

Usage

RealScores2IntegerScores(RealScore, ProbRealScore, coef = 10)

Arguments

RealScore

vector of real scores

ProbRealScore

vector of probability

coef

coefficient

Value

list containing ExtendedIntegerScore and ProbExtendedIntegerScore

Details

Convert real scores into integer scores by multiplying real scores by a coefficient (default 10) and then assigning probability to corresponding extended (from the minimum to the maximum) integer scores

Examples

Run this code
# NOT RUN {
score <- c(-1,-0.5,0,0.5,1)
prob.score <- c(0.2,0,0.4,0.1,0.3)
(res1 <- RealScores2IntegerScores(score, prob.score, coef=10))
prob.score.err <- c(0.1,0,0.4,0.1,0.3)
(res2 <- RealScores2IntegerScores(score, prob.score.err, coef=10))
# When coef=1, the function can handle integer scores
ex.integer.score <- c(-3,-1,0,1, 5)
(res3 <- RealScores2IntegerScores(ex.integer.score, prob.score, coef=1))
# }

Run the code above in your browser using DataLab