I want to use the PoweR library function pvalueMC goodness of fit tests p-value, but I do not understand the parameter null.law.index. Maybe someone had to use something like this? Have you encountered anything like this? I read Pierre Lafaye de Micheaux article "PoweR: A Reproducible Research Tool to Ease Monte Carlo Power Simulation Studies for Goodness-of-fit Tests in R". I tried to contact the authors but failed.
Hi, and welcome!
Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers. Because this question is more conceptual, however, it's not needed
First, it's poor etiquette to contact the authors usually, unless it is a likely bug in the program.
The way to work this problem is by looking at help(pvalueMC)
to see what its arguments are asking for.
null.law.index .... index of the distribution to be tested (the null hypothesis distribution), as given by function getindex.
In the function signature
we see that there is no default value (`null.law.index = SOMETHING), so we have to provide one.
What is it? It's a code for the statistical null hypothesis.
Where can the code lookups be found?
In getindex
.
What does getindex
say?
library(PoweR)
#> Loading required package: parallel
#> Loading required package: Rcpp
# getindex(law.indices = NULL, stat.indices = NULL)
getindex()
#> Index Law Nbparams Default1 Default2 Default3
#> 1 1 Laplace(mu,b) 2 0.000000 1 NA
#> 2 2 Normal(mu,sigma) 2 0.000000 1 NA
#> 3 3 Cauchy(mu,sigma) 2 0.000000 1 NA
#> 4 4 Logistic(mu,sigma) 2 0.000000 1 NA
#> 5 5 Gamma(shape,rate) 2 2.000000 1 NA
#> 6 6 Beta(a,b) 2 1.000000 1 NA
#> 7 7 Uniform(a,b) 2 0.000000 1 NA
#> 8 8 Student-t(df) 1 1.000000 NA NA
#> 9 9 Chi-squared(df) 1 1.000000 NA NA
#> 10 10 Lognormal(logmean,logsd) 2 0.000000 1 NA
#> 11 11 Weibull(shape,scale) 2 1.000000 1 NA
#> 12 12 ShiftedExp(l,rate) 2 0.000000 1 NA
#> 13 13 U^{j+1} 1 1.000000 NA NA
#> 14 14 AveUnif(k,a,b) 3 2.000000 0 1.0
#> 15 15 UUnif(j) 1 1.000000 NA NA
#> 16 16 VUnif(j) 1 1.000000 NA NA
#> 17 17 JSU(mu,sigma,nu,tau) 4 0.000000 1 0.0
#> 18 18 Tukey(l) 1 1.000000 NA NA
#> 19 19 LoConN(p,m) 2 0.200000 3 NA
#> 20 20 JSB(g,d) 2 0.000000 1 NA
#> 21 21 SkewN(xi,omega,alpha) 3 0.000000 1 0.0
#> 22 22 ScConN(p,d) 2 0.200000 2 NA
#> 23 23 GP(mu,sigma,xi) 3 0.000000 1 0.0
#> 24 24 GED(mu,sigma,p) 3 0.000000 1 1.0
#> 25 25 Stable(alpha,beta,c,mu) 4 1.000000 0 1.0
#> 26 26 Gumbel(mu,sigma) 2 1.000000 1 NA
#> 27 27 Frechet(mu,sigma,alpha) 3 0.000000 1 1.0
#> 28 28 GEV(mu,sigma,xi) 3 0.000000 1 0.0
#> 29 29 GArcSine(alpha) 1 0.500000 NA NA
#> 30 30 FoldN(mu,sigma) 2 0.000000 1 NA
#> 31 31 MixN(p,m,d) 3 0.500000 0 1.0
#> 32 32 TruncN(a,b) 2 0.000000 1 NA
#> 33 33 Nout(a) 1 1.000000 NA NA
#> 34 34 GEP(t1,t2,t3,crit) 4 0.500000 0 1.0
#> 35 35 Exponential(lambda) 1 1.000000 NA NA
#> 36 36 ALaplace(mu,b,k) 3 0.000000 1 2.0
#> 37 37 NIG(alpha,beta,delta,mu) 4 1.000000 0 1.0
#> 38 38 APD(theta,phi,alpha,lambda) 4 0.000000 1 0.5
#> 39 39 modAPD(mu,sigma,theta1,theta2) 4 0.000000 1 0.5
#> 40 40 LPtn(alpha,mu,sigma) 3 1.959964 0 1.0
#> Default4
#> 1 NA
#> 2 NA
#> 3 NA
#> 4 NA
#> 5 NA
#> 6 NA
#> 7 NA
#> 8 NA
#> 9 NA
#> 10 NA
#> 11 NA
#> 12 NA
#> 13 NA
#> 14 NA
#> 15 NA
#> 16 NA
#> 17 5e-01
#> 18 NA
#> 19 NA
#> 20 NA
#> 21 NA
#> 22 NA
#> 23 NA
#> 24 NA
#> 25 0e+00
#> 26 NA
#> 27 NA
#> 28 NA
#> 29 NA
#> 30 NA
#> 31 NA
#> 32 NA
#> 33 NA
#> 34 1e-06
#> 35 NA
#> 36 NA
#> 37 0e+00
#> 38 2e+00
#> 39 2e+00
#> 40 NA
#> Index Stat Alter Nbparams
#> 1 1 K-S 3 0
#> 2 2 AD^* 3 0
#> 3 3 Z_C 3 0
#> 4 4 Z_A 3 0
#> 5 5 P_S 3 0
#> 6 6 K^2 3 0
#> 7 7 JB 3 0
#> 8 8 DH 3 0
#> 9 9 RJB 3 0
#> 10 10 T_{Lmom} 3 0
#> 11 11 T_{Lmom}^{(1)} 3 0
#> 12 12 T_{Lmom}^{(2)} 3 0
#> 13 13 T_{Lmom}^{(3)} 3 0
#> 14 14 BM_{3-4} 3 0
#> 15 15 BM_{3-6} 3 0
#> 16 16 T_{MC-LR} 3 0
#> 17 17 T_w 0,1,2 0
#> 18 18 T_{MC-LR}-T_w 3 0
#> 19 19 T_{S,5} 3 0
#> 20 20 T_{K,5} 3 0
#> 21 21 W 4 0
#> 22 22 W' 4 0
#> 23 23 tilde{W} 4 0
#> 24 24 D 0,1,2 0
#> 25 25 r 4 0
#> 26 26 CS 3 0
#> 27 27 Q 0,1,2 0
#> 28 28 Q-Q* 0,1,2 0
#> 29 29 BCMR 3 0
#> 30 30 beta_3^2 3 0
#> 31 31 T^*(alpha) 1 1
#> 32 32 I_n 3 0
#> 33 33 R_{sJ} 3 0
#> 34 34 Q* 0,1,2 0
#> 35 35 R_n 3 0
#> 36 36 X_{APD} 3 0
#> 37 37 Z_{EPD} 0,1,2 0
#> 38 38 GLB 3 0
#> 39 39 V_3-ML 0,1,2 0
#> 40 40 V_4-ML 0,1,2 0
#> 41 41 S 3 0
#> 42 42 A^2 3 0
#> 43 43 W^2 3 0
#> 44 44 U^2 3 0
#> 45 45 sqrt{n}D 3 0
#> 46 46 V 3 0
#> 47 47 T_{n,a}^{(1)}-MO 3 1
#> 48 48 T_{n,a}^{(1)}-ML 3 1
#> 49 49 T_{n,a}^{(2)}-MO 3 1
#> 50 50 T_{n,a}^{(2)}-ML 3 1
#> 51 51 T_{m,n}^{V} 4 1
#> 52 52 T_{m,n}^{E} 4 1
#> 53 53 T_{m,n}^{C} 4 1
#> 54 54 hat{G}_n 3 0
#> 55 55 V_3 0,1,2 0
#> 56 56 V_4 0,1,2 0
#> 57 57 K_1 3 0
#> 58 58 T 3 0
#> 59 59 Z 3 0
#> 60 60 K 3 0
#> 61 61 DLLap1 0,1,2 0
#> 62 62 DLLap2 0,1,2 0
#> 63 63 D_n 3 0
#> 64 64 W_{n}^{2} 3 0
#> 65 65 A_{n}^{2} 3 0
#> 66 66 C_n 3 0
#> 67 67 K_n 3 0
#> 68 68 T_1 3 0
#> 69 69 T_2 3 0
#> 70 70 G(n) 3 0
#> 71 71 Q 3 0
#> 72 72 2nI^{lambda} 3 1
#> 73 73 M(n) 3 0
#> 74 74 L_{n}^{(m)} 4 1
#> 75 75 S_{n}^{(m)} 3 1
#> 76 76 H(m,n) 4 1
#> 77 77 A^{*}(n) 3 0
#> 78 78 D_{n,m}(phi_lambda) 3 2
#> 79 79 E_{m,n} 3 1
#> 80 80 T_{n,m}^{lambda} 3 2
#> 81 81 Z_A 3 0
#> 82 82 Z_C 3 0
#> 83 83 t test 0,1,2 1
#> 84 85 DLLap3 3 0
#> 85 86 T(alpha_1,alpha_2) 3 1
#> 86 87 T_n 3 0
#> 87 88 T^{LS}(alpha) 3 1
#> 88 89 T^{LS}_3(mu,alpha) 3 2
#> 89 90 T^{LS}_4(alpha,mu) 3 2
#> 90 91 GV_1 0,1,2 0
#> 91 92 GV_2 0,1,2 0
#> 92 93 Ho_K 0,1,2 0
#> 93 94 Ho_U 0,1,2 0
#> 94 95 Ho_V 0,1,2 0
#> 95 96 Ho_W 0,1,2 0
#> 96 97 SR^* 0,1,2 0
Created on 2020-04-07 by the reprex package (v0.3.0)
That's a lot of options, and which one to use depends on the design of the analysis.
The goal of my research is to test the goodness of fit hypotheses with various tests. I tried to do this using:
statistikos <- statcompute(stat.index =3, data = X, level = 0.05, alter =3)
stat <- statistikos$statistic
pval <-statistikos$pvalue
But with tests 3-5, 18-20, 23-32, 34, 35 pval = NA. Then I tried to use:
pval<-pvalueMC(X, stat.index=3, null.law.index =2, M=1000, alter =3)
print(pval)
Yes I know what getindex () says. But I have a hard to understand what value the null.law.index parameter should use for my unused (3-5, 18-20, 23-32, 34, 35) tests?
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.