jlssc: Joint location-and-scale test

View source: R/jlst.R

jlsscR Documentation

Joint location-and-scale test

Description

jlssc performs the joint location-and-scale score test.

Usage

jlssc(y, x, covar = NULL, type = 1, x.sq = FALSE, x.reg = TRUE)

Arguments

y

vector of outcome values

x

vector of exposure values

covar

data.frame of covariates

type

type of test, where 1 = Breusch-Pagan variance test, 2 = Brown-Forsythe variance test, 3 = Method of moments version of test 1, and 4 = Method of moments version of test 2] (default: 1)

x.sq

include x-squared in the model

x.reg

regress out the covariates from the exposure terms

Value

jlst returns a data.frame of results:

Q

the test statistic

DF

the degrees of freedom

P

the p-value

Author(s)

James Staley jrstaley95@gmail.com

Examples

x <- rbinom(1000, 1, 0.5)
y <- 0.5 + 0.025 * x + rnorm(1000, 0, sqrt(0.005 * x)) + rnorm(1000, 0, 0.1)
jlssc(y, x)


jrs95/jlst documentation built on Feb. 2, 2024, 3:19 p.m.