The included public functions are 'Friedman' and 'Quade'. ----- # Friedman() The function 'Friedman' performs the classic nonparametric Friedman test for location differences in the matched K-sample case. ## Arguments: - ... takes _either_ a gretl list as argument, _or_ a corresponding matrix as 2nd argument, in which case the list argument in the first position must be explicitly set to 'null'. - The 3rd and optional argument enables some printed output (default = 1/TRUE). - The 4th and optional argument tells the function whether the matrix argument (in 2nd place) already contains rankings instead of the raw data (default = 0/FALSE). The list (or matrix) of so-called treatment effects must contain values that are suitable for ranking. (For example in forecasting applications it would have to be several series of [absolute, or squared]forecast errors, or losses.) For matrix input the K variables (or K different "treatments") must be in columns. The N observations in rows are sometimes called "groups" in this literature. ## Output is a 4-element vector of 1) test stat 2) pvalue 3) test conclusion at 5% (reject = 1, not reject = 0) 4) test conclusion at 1% For small samples the pvalue is NA, whenever the Chi2 approximation is not used anymore. In fact, that is the reason why the test conclusions are explicitly returned as well. (This is different in R, apparently.) Critical values for small samples are taken from https://www.york.ac.uk/depts/maths/tables/friedman.pdf and partly cross-checked with tables from the (German) book Buening & Trenkler, Nichtparametrische Methoden, 2nd ed. 1994. ----- # Quade(): This tests the same hypothesis as the Friedman test and has the same first three function arguments. The difference is that the ranges of the cardinal values in each row are taken into account. (Therefore these ranges must have meaning, which is an additional assumption compared to the Friedman test.) Output is a two-element vector of test statistic and p-value, based on the F-distribution approximation. --------------------------- # Changelog: ## 1.2, October 2024: fix minor bug in checking for empty list argument require gretl 2020c for syntax reasons switch to markdown for help text ## 1.1, December 2017: add Quade test fix bug in arg declaration as constant matrix add more output (if verbose) change verbose default to on (1) ## 1.0, December 2017: initial release