View source: R/permTest_LR_int.R
permTest_LR_int | R Documentation |
This function performs a permutation test on an interaction in a model object using a likelyhood ratio test. It does this by re-sampling the column(s) indicated, and refitting two models to the new data: one with and one without the interaction. The function then performs a likelyhood ratio test using the anova function on these two models, creating a simulated permutation test output. Because two models are needed to be created on each iteration to test the interaction, this function is the slowest of the permutation tests.
permTest_LR_int(
Model_Object,
Test_Parameter,
Randomize_Variables,
Test_Statistic,
Replication,
UseAllAvailableCores = TRUE,
OutputData = FALSE
)
Model_Object |
A statistical model object. |
Test_Parameter |
A character string indicating the parameter that the permutation test is to be performed on.For example, 'var1:var2', or "var1" |
Randomize_Variables |
A character vector of variables that are to be randomized in the permutation test. ex. c("var1","var2") or "var1". |
Test_Statistic |
A character string indicating the desired test statistic to conduct the permutation test. This can be an f value, chi-squared value, p-value...etc, depending on what test statistics are available for your model object. These are different for lm, glm, glmmTMB, etc. |
Replication |
The number of simulations in the permutation test. |
OutputData |
Should the simulated test statistics be outputted ? |
A list of two items. The first is a data frame of results of the permutation test. The second is a histogram displaying the sampling distribution of the simulated test statistics, with a red line displaying the test statistic of the original (non-randomized) data. If OutputData=T, then a vector of simulated test statistics will also be included in the output list.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.