ahpsurvey (version 0.4.0)

ahp.missing: Impute missing observations using the method in Harker1987;textualahpsurvey

Description

Imputes the missing values of a list of matrices produced by ahp.mat using the methods and assumptions made in Harker1987;textualahpsurvey. Missing values must be coded as NA. As suggested in Harker1987;textualahpsurvey, a minimum of n-1 comparisons must be made, where n is the number of attributes (assuming that the decision-maker is perfectly consistent). Note that the algorithm assumes that the NA values will be imputed under perfect consistency with the other pairwise comparisons made.

Usage

ahp.missing(ahpmat, atts, round = FALSE, limit = FALSE)

Arguments

ahpmat

A list of pairwise comparison matrices of each decision maker generated by ahp.mat.

atts

A list of attributes in the correct order

round

Rounds the imputation values of the matrix to the nearest integer if TRUE. Defaults to FALSE.

limit

If set to TRUE, if the imputation value is larger than 9 or smaller than 1/9, the value is converted to 9 and 1/9 respectively. Defaults to FALSE.

Value

A list of matrices with all NA values imputed.

References

Examples

Run this code
# NOT RUN {
library(magrittr)

atts <- c('cult', 'fam', 'house', 'jobs', 'trans')

data(city200)

set.seed(42)
## Make a dataframe that is missing at random
missing.df <- city200[1:10,]
for (i in 1:10){
  missing.df[i, round(stats::runif(1,1,10))] <- NA
}
missingahp <- ahp.mat(missing.df, atts, negconvert = TRUE)
ahp.missing(missingahp, atts)

# }

Run the code above in your browser using DataLab