ancova.circ.lin: Nonparametric analysis of covariance tests for circular...

View source: R/ancova.circ.lin.R

ancova.circ.linR Documentation

Nonparametric analysis of covariance tests for circular regression

Description

Function ancova.circ.lin computes nonparametric ANCOVA tests to compare regression curves with a circular predictor variable and a real-valued response variable. The null hypothesis may be either equality or parallelism of the regression curves, as described in Alonso-Pena et al. (2021). It uses the nonparametric Nadaraya-Watson estimator or the Local-Linear estimator for circular-linear data described in Di Marzio et al. (2009) and Oliveira et al. (2013).

Function ancova.lin.circ computes nonparametric ANCOVA tests to compare regression curves with a real-valued predictor variable and a circular response variable. The null hypothesis may be either equality or parallelism of the regression curves, as described in Alonso-Pena et al. (2021). It uses the nonparametric Nadaraya-Watson estimator or the Local-Linear estimator for linear-circular data described in Di Marzio et al. (2012).

Function ancova.circ.circ computes nonparametric ANCOVA tests to compare regression curves with a circular predictor variable and a circular response variable. The null hypothesis may be either equality or parallelism of the regression curves, as described in Alonso-Pena et al. (2021). It uses the nonparametric Nadaraya-Watson estimator or the Local-Linear estimator for circular-circular data described in Di Marzio et al. (2012).

Usage

ancova.circ.lin(x, y, g, bw, bw1, test = "eq", method = "LL",calib = "chisq", 
   n_boot = 500)
ancova.lin.circ(x, y, g, bw, bw1, test = "eq", method = "LL", n_boot = 500)
ancova.circ.circ(x, y, g, bw, bw1, test = "eq", method = "LL", n_boot = 500)

Arguments

x

Vector of data for the independent variable. The object is coerced to class circular when using functions ancova.circ.lin and ancova.circ.circ.

y

Vector of data for the dependent variable. This must be same length as x. The object is coerced to class circular when using functions ancova.lin.circ and ancova.circ.circ.

g

Vector of group indicators.

bw

Smoothing parameter to be used. If not provided it selects the parameter obtained by cross-validation.

bw1

Preliminary smoothing parameter for the parallelism test.

test

Character string giving the type of test to be performed. Must be one of "eq" for the test of equality or "paral" for the test of parallelism. Default is test="eq".

method

Character string giving the estimator to be used. This must be one of "LL" for Local-Linear estimator or "NW" for Nadaraya-Watson estimator. Default method="LL".

calib

Character string giving the calibration method to be used in ancova.circ.lin function. This must be one of "chisq" for the chi-squared approximation or "boot" for the bootstrap calibration.

n_boot

Number of bootstrap resamples. Default is n_boot=500. In function ancova.circ.lin, only if calib="boot".

Details

See Alonso-Pena et al. (2021). The NAs will be automatically removed.

Value

A list with class "htest" containing the following components:

statistic

observed value of the statistic.

bw

Smoothing parameter used.

p.value

p-value for the test.

data.name

a character string giving the name(s) of the data.

alternative

a character string describing the alternative hypothesis.

Author(s)

Maria Alonso-Pena, Jose Ameijeiras-Alonso and Rosa M. Crujeiras

References

Alonso-Pena, M., Ameijeiras-Alonso, J. and Crujeiras, R.M. (2021) Nonparametric tests for circular regression. Journal of Statistical Computation and Simulation, 91(3), 477–500.

Di Marzio, M., Panzera A. and Taylor, C. C. (2009) Local polynomial regression for circular predictors. Statistics and Probability Letters, 79, 2066–2075.

Di Marzio, M., Panzera A. and Taylor, C. C. (2012) Non–parametric regression for circular responses. Scandinavian Journal of Statistics, 40, 228–255.

Oliveira, M., Crujeiras R.M. and Rodriguez-Casal, A. (2013) Nonparametric circular methods for exploring environmental data. Environmental and Ecological Statistics, 20, 1–17.

See Also

kern.reg.circ.lin, kern.reg.lin.circ, kern.reg.circ.circ

Examples


# ANCOVA circ-lin
set.seed(2025)
x1 <- rcircularuniform(100)
x2 <- rcircularuniform(100)
x <- c(x1, x2)
y1 <- 2*sin(as.numeric(x1)) + rnorm(100, sd=2)
y2 <- 4 + 2*sin(as.numeric(x2)) + rnorm(100, sd=2)
y <- c(y1, y2)
g <- c(rep(0,100), rep(1,100))
ancova.circ.lin(x, y, g,  test = "eq")
ancova.circ.lin(x, y, g,  test = "paral")


# ANCOVA lin-circ
set.seed(2025)
x1 <- runif(100)
x2 <- runif(100)
y1 <- 3*pi*x1^2 + rvonmises(100, mu = 0, kappa = 6)
y2 <- 2*pi/8 + 3*pi*x2^2 + rvonmises(100, mu = 0, kappa = 6)
x <- c(x1, x2)
y <- c(y1, y2)
g<-c(rep(0, 100), rep(1, 100))
ancova.lin.circ(x, y, g,  test = "eq")
ancova.lin.circ(x, y, g,  test = "paral")


# ANCOVA circ-circ
set.seed(2025)
x1 <- rcircularuniform(100)
x2 <- rcircularuniform(100)
y1 <- 2*sin(2*x1) + rvonmises(100, mu = 0, kappa = 8 )
y2 <- pi/8 + 2*sin(2*x2) + rvonmises(100, mu = 0, kappa = 8 )
x <- c(x1, x2)
y <- c(y1, y2)
g<-c(rep(0, 100), rep(1, 100))
ancova.circ.circ(x, y, g,  test = "eq")
ancova.circ.circ(x, y, g,  test = "paral")


NPCirc documentation built on Nov. 10, 2022, 5:48 p.m.