mmdlmspec.b_test | R Documentation |
mmdlmspec.b_test
conducts the Su \& Zheng 2017 specification test on a linear model
estimated with the MMD estimator. It is based on the wild bootstrap.
mmdlmspec.b_test(mmd.Obj, B = 199, wmat = NULL, cl = NULL, cluster = NULL)
mmd.Obj |
is an MMD regression output from mmdreg.fit() |
B |
number of wild bootstrap samples. Defaults to 199 |
wmat |
in case the n x B matrix of wild bootstrap weights are supplied by the user. |
cl |
an integer to indicate number of child-processes in pbapply::pbsapply(). |
cluster |
vector of length n with cluster ids if cluster-robust wild-bootstrap is used |
the p-value, test statistic,
## Generate data and run MMD regression
n=100; set.seed(12); X = rnorm(n); er = rchisq(n,df=1)-1; Z=X; X=scale(abs(X))+er/sqrt(2)
Y=X+er; reg1 = mmdreg.fit(Y,X,Z); reg2 = mmdreg.fit(Y,X,X) #run regression
mmdlmspec.b_test(reg1); mmdlmspec.b_test(reg2) #test under the null and the alternative
## MMD coefficients, standard errors, and t-statistics
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.