123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174openOCamlRopenOCamlR_baseletfloat_tup(x,y)=Enc.floats[|x;y|]moduleSymbol=structletks'test=symbol"ks.test"letp'adjust=symbol"p.adjust"endletformula_stub=symbol"formula"letformulax=callformula_stub[argEnc.stringx]|>Formula.unsafe_of_sexpletrnorm_symbol=symbol"rnorm"letrnorm?mean?sdn=callrnorm_symbolEnc.[arg~name:"n"intn;opt_argfloat"mean"mean;opt_argfloat"sd"sd;]|>Numeric.unsafe_of_sexpletstring_of_test_kind=function|`two_sided->"two.sided"|`greater->"greater"|`less->"less"letenc_test_kindx=Enc.string(string_of_test_kindx)moduletypeTest=sigincludemoduletypeofList_valp'value:t->floatval_method_:t->stringvaldata'name:t->stringvalalternative:t->stringend(**
Note that not all access operations really are available,
the selection is performed via signature shadowing.
*)moduleTest_impl=structincludeList_letp'valueo=List_.subset2_exno"p.value"Dec.floatlet_method_o=List_.subset2_exno"method"Dec.stringletdata'nameo=List_.subset2_exno"data.name"Dec.stringletalternativeo=List_.subset2_exno"alternative"Dec.stringletconf'into=List_.subset2o"conf.int"Dec.floats|>Option.map(function|[|x;y|]->(x,y)|_->assertfalse)letestimateo=List_.subset2_exno"estimate"Dec.floatletnull'valueo=List_.subset2_exno"null.value"Dec.floatletstatistico=List_.subset2_exno"statistic"Dec.floatendmoduleFisher'test=structincludeTest_implletfisher_test_symbol=symbol"fisher.test"letlogicals?alternativevv'=callfisher_test_symbol[arg~name:"x"Logical.to_sexpv;arg~name:"y"Logical.to_sexpv';opt_argenc_test_kind"alternative"alternative;]|>List_.unsafe_of_sexpendmoduleT'test=structincludeTest_impllett_test_symbol=symbol"t.test"letone_sample?alternativex=callt_test_symbol[opt_argenc_test_kind"alternative"alternative;arg~name:"x"Numeric.to_sexpx;]|>List_.unsafe_of_sexpendmoduleChisq'test=structincludeTest_implletchisq_test_symbol=symbol"chisq.test"letcontingency_table?correct?simulate'p'value?bmat=callchisq_test_symbolEnc.[arg~name:"x"Integer.Matrix.to_sexpmat;opt_argbool"correct"correct;opt_argbool"simulate.p.value"simulate'p'value;opt_argint"B"b;]|>List_.unsafe_of_sexpendmoduleKs'test=structincludeTest_implletmake?alternativevv'=callSymbol.ks'testEnc.[argNumeric.to_sexpv;argNumeric.to_sexpv';opt_arg(funx->string(string_of_test_kindx))"alternative"alternative;]|>List_.unsafe_of_sexpendletenc_p'adjust_methodx=Enc.string(matchxwith|`fdr->"fdr"|`holm->"holm"|`hochberg->"hochberg"|`hommel->"hommel"|`bonferroni->"bonferroni"|`BH->"BH"|`BY->"BY")letp'adjust?method_data=callSymbol.p'adjust[argNumeric.to_sexpdata;opt_argenc_p'adjust_method"method"method_;]|>Numeric.unsafe_of_sexpmoduleEcdf=structtypet=List_.tletecdf_symbol=symbol"ecdf"letmakex=callecdf_symbol[argNumeric.to_sexpx]|>List_.unsafe_of_sexpletplot_ecdf_symbol=symbol"plot.ecdf"letplot?(main="")?xlab?ylab?xlim?ylimo=callplot_ecdf_symbolEnc.[arg~name:"x"List_.to_sexpo;opt_argstring"xlab"xlab;opt_argstring"ylab"ylab;argstring~name:"main"main;opt_argfloat_tup"xlim"xlim;opt_argfloat_tup"ylim"ylim;]|>ignoreendletqqplot_symbol=symbol"qqplot"letqqplot?main?(xlab="")?(ylab="")?plot_type?lwd?colxy=callqqplot_symbolEnc.[argfloatsx;argfloatsy;opt_argstring"main"main;argstring~name:"xlab"xlab;argstring~name:"ylab"ylab;opt_argOCamlR_graphics.Enc.plot_type"type"plot_type;opt_argint"lwd"lwd;opt_argstring"col"col;]|>ignore