permTest_LR: Perform a permutation test using the likelyhood ratio test

View source: R/permTest_LR.R

permTest_LRR Documentation

Perform a permutation test using the likelyhood ratio test

Description

This function performs a permutation test on a model object using a likelyhood ratio test. It works by generating a specified amount of replicated data frames and fits the supplied model object to each one. The permutation test is based on the test statistic output of a likelyhood ratio test. This function will not work on interactions, to run a permutation test on an interaction with a likelyhood ratio test, use permTest_LR_int(). When there is no interaction, the null model lacks the variable of interest, and only needs to be fitted one. Therefore, only 1 model is fitted on each iteration, making it twice as fast as the perm_Test_LR_int function.

Usage

permTest_LR(
  Model_Object,
  Variable,
  Test_Statistic,
  Replication,
  UseAllAvailableCores = TRUE,
  OutputData = FALSE
)

Arguments

Model_Object

A statistical model object.

Variable

A character string of the variable requiring the permutation test is run on.

Test_Statistic

A character string of the desired test statistic to conduct the permutation test.

Replication

The number of simulations in the permutation test.

OutputData

Should the simulated test statistics be outputted ?

Value

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.


RichieHonor/PermutateR documentation built on July 2, 2023, 2:07 p.m.