Title: | Joint location-and-scale tests |
---|---|
Description: | Joint location-and-scale tests for joint testing of mean (location) and variance (scale). |
Authors: | James Staley [aut, cre] |
Maintainer: | James Staley <[email protected]> |
License: | GPL-3 |
Version: | 0.0.2 |
Built: | 2024-10-31 03:18:36 UTC |
Source: | https://github.com/jrs95/jlst |
jlsp
performs the joint location-and-scale test using
Fisher's method.
jlsp(y, x, covar = NULL, covar.var = FALSE, var.type = 1, x.sq = FALSE)
jlsp(y, x, covar = NULL, covar.var = FALSE, var.type = 1, x.sq = FALSE)
y |
vector of outcome values |
x |
vector of exposure values |
covar |
|
covar.var |
adjust the second stage (variance component) of the approach by the covariates |
x.sq |
include x-squared in the variance part of the model |
type |
type of test, where
|
jlsp
returns a list
of results:
Q / F |
the test statistic |
DF |
the degrees of freedom |
P |
the p-value |
James Staley [email protected]
x <- rbinom(1000, 1, 0.5) y <- 0.5 + 0.025 * x + rnorm(1000, 0, sqrt(0.005 * x)) + rnorm(1000, 0, 0.1) jlsp(y, x, var.type = 2)
x <- rbinom(1000, 1, 0.5) y <- 0.5 + 0.025 * x + rnorm(1000, 0, sqrt(0.005 * x)) + rnorm(1000, 0, 0.1) jlsp(y, x, var.type = 2)
jlssc
performs the joint location-and-scale score test.
jlssc(y, x, covar = NULL, type = 1, x.sq = FALSE, x.reg = TRUE)
jlssc(y, x, covar = NULL, type = 1, x.sq = FALSE, x.reg = TRUE)
y |
vector of outcome values |
x |
vector of exposure values |
covar |
|
type |
type of test, where
|
x.sq |
include x-squared in the model |
x.reg |
regress out the covariates from the exposure terms |
jlst
returns a data.frame
of results:
Q |
the test statistic |
DF |
the degrees of freedom |
P |
the p-value |
James Staley [email protected]
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)
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)
vartest performs variability tests by either the Breusch-Pagan or Brown-Forsythe methods.
vartest(y, x, covar = NULL, covar.var = FALSE, type = 1, x.sq = FALSE)
vartest(y, x, covar = NULL, covar.var = FALSE, type = 1, x.sq = FALSE)
y |
vector of outcome values |
x |
vector of exposure values |
covar |
|
covar.var |
adjust the second stage (variance component) of the approach by the covariates |
type |
type of test, where
|
x.sq |
include x-squared in the variance part of the model |
vartest
returns a list
of results:
coef |
model coefficients from variance part of the model |
test |
|
F
: the test statistic
DF
: the degrees of freedom
P
: the p-value
James Staley [email protected]
x <- rbinom(1000, 1, 0.5) y <- 0.5 + 0.025 * x + rnorm(1000, 0, sqrt(0.005 * x)) + rnorm(1000, 0, 0.1) vartest(y, x, type = 2)
x <- rbinom(1000, 1, 0.5) y <- 0.5 + 0.025 * x + rnorm(1000, 0, sqrt(0.005 * x)) + rnorm(1000, 0, 0.1) vartest(y, x, type = 2)