In order to find the best distribution fit to a dataset, I need to pass a component from a character vector of possible distributions (intentionally short-sized in this example) to the ks.test() R function as an argument. So, my problem relates to Statistics and, much more generally, to R programming.
install.packages("ISLR")
library(ISLR)
attach(Credit)
distr.list <- c("pbeta","pbinom","pcauchy","pchisq")
p.val <- double(length(distr.list))
for (i in 1:length(distr.list))
{
p.val[i] <- ks.test(Income,distr.list[i])$p.value
}
I get:
Error in y(sort(x), ...) : argument "shape1" is missing, with no default
What does it mean? Where is my mistake? Many thanks in advance.
sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)