View source: R/MethodsComparison.R
MethodsComparison | R Documentation |
'MethodsComparison' compares the quality of built-in imputation methods using various measures and goodness-of-fit statistical tests for the given fuzzy dataset.
MethodsComparison(
trueData,
iterations = 100,
percentage = 0.05,
trapezoidal = TRUE,
verbose = TRUE,
...
)
trueData |
Name of the input matrix (or data frame) with the true values of the variables. |
iterations |
Number of the repetitions of each analyses (introducing NAs and then imputation of the missing values). |
percentage |
Desired percentage of missing values (NAs) in each row. |
trapezoidal |
Logical value depending on the type of fuzzy values (triangular or trapezoidal ones) in the dataset. |
verbose |
Logical value if the progress bar should be shown. |
... |
Additional parameters passed to other functions. |
The procedure uses the function ImputationTests
to compare the quality of the imputation methods for the specified fuzzy dataset.
To minimize random effects, each analysis is repeated iterations
times with the new randomly generated NA values
in the input dataset, and then new imputed values for all built-in methods.
To generate the new NAs values, the function IntroducingNA
is used.
Next, the results, the same as forImputationTests
(apart from trueValues
and mask
), are averaged and their standard errors calculated (see the column se
).
The input dataset can be given as matrix or data frame.
To get overall comparison of the methods, summary(object,...)
can be used for the output object from this method.
The values diff
are equal to the differences of p-values between the respective tests for the parts
true
and imputed
there.
The output is an S3 object of the class metComp
given as a list of the matrices:
nonFNNumbers
- the vector with the numbers of non-FNs samples for each variable (with the overall mean),
errorMatrix
– the output from the function ErrorMatrix
,
statisticalMeasures
– the output from the function StatisticalMeasures
,
statisticalTests
– the output from the function ApplyStatisticalTests
,
fuzzyMeasures
– the output from the function CalculateFuzzyMeasures
.
ImputationTests for the single imputation benchmark, summary.metComp
.
# seed PRNG
set.seed(1234)
# load the necessary library
library(FuzzySimRes)
# generate sample of trapezoidal fuzzy numbers with FuzzySimRes library
list1<-SimulateSample(20,originalPD="rnorm",parOriginalPD=list(mean=0,sd=1),
incrCorePD="rexp", parIncrCorePD=list(rate=2),
suppLeftPD="runif",parSuppLeftPD=list(min=0,max=0.6),
suppRightPD="runif", parSuppRightPD=list(min=0,max=0.6),
type="trapezoidal")
# convert fuzzy data into a matrix
matrix1 <- FuzzyNumbersToMatrix(list1$value)
# check starting values
head(matrix1)
# check the quality of the imputed values
## Not run:
MethodsComparison(matrix1,iterations=10,trapezoidal=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.